fix http hosts header

This commit is contained in:
Adil Hafeez 2025-01-23 11:05:24 -08:00
parent 613192f71c
commit 411b6904b7
5 changed files with 111 additions and 5 deletions

View file

@ -33,6 +33,8 @@ properties:
enum:
- http
- https
http_host:
type: string
additionalProperties: false
required:
- endpoint

View file

@ -486,14 +486,14 @@ static_resources:
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
sni: api.mistral.ai
{% for internal_clustrer in ["arch_fc", "model_server"] %}
- name: {{ internal_clustrer }}
{% for internal_cluster in ["arch_fc", "model_server"] %}
- name: {{ internal_cluster }}
connect_timeout: 5s
type: STRICT_DNS
dns_lookup_family: V4_ONLY
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: {{ internal_clustrer }}
cluster_name: {{ internal_cluster }}
endpoints:
- lb_endpoints:
- endpoint:
@ -501,7 +501,7 @@ static_resources:
socket_address:
address: host.docker.internal
port_value: $MODEL_SERVER_PORT
hostname: {{ internal_clustrer }}
hostname: {{ internal_cluster }}
{% endfor %}
- name: mistral_7b_instruct
connect_timeout: 5s
@ -537,7 +537,11 @@ static_resources:
socket_address:
address: {{ cluster.endpoint }}
port_value: {{ cluster.port }}
{% if cluster.http_host %}
hostname: {{ cluster.http_host }}
{% else %}
hostname: {{ cluster.endpoint }}
{% endif %}
{% if cluster.protocol == "https" %}
transport_socket:
name: envoy.transport_sockets.tls

View file

@ -0,0 +1,79 @@
version: "0.1-beta"
listener:
address: 0.0.0.0
port: 10000
message_format: huggingface
connect_timeout: 0.005s
overrides:
# confidence threshold for prompt target intent matching
prompt_target_intent_matching_threshold: 0.6
endpoints:
acm_service:
endpoint: host.docker.internal:8001
connect_timeout: 0.005s
http_host: localhost
llm_providers:
- name: gpt-4o-mini
access_key: $OPENAI_API_KEY
provider: openai
model: gpt-4o-mini
default: true
system_prompt: |
You are a helpful assistant.
prompt_guards:
input_guards:
jailbreak:
on_exception:
message: Looks like you're curious about my abilities, but I can only provide assistance for weather forecasting.
prompt_targets:
- name: listAllClusterDetails
description: Query your clusters for more details.
endpoint:
http_method: GET
name: acm_service
path: /apis/cluster.open-cluster-management.io/v1/managedclusters
system_prompt: |
You are a helpful assistant. You are given response in json. Show name of the cluster and its status in human readable format also show some related details about the cluster but be concise.
- name: getClusterDetails
description: Query a single cluster for more details
endpoint:
http_method: GET
name: acm_service
path: /apis/cluster.open-cluster-management.io/v1/managedclusters/{cluster_name}
parameters:
- name: cluster_name
in_path: true
description: The name of the cluster to retrieve
required: true
type: str
system_prompt: |
You are a helpful assistant. You are given response in json. Show name of the cluster and its status in human readable format also show some related details about the cluster but be concise.
- name: default_target
default: true
description: This is the default target for all unmatched prompts.
system_prompt: |
You are a helpful assistant that can help answer ACM queries. Following is a list of available commands user can ask. Based on question asked, tell me which command you want to execute.
- name: listAllClusterDetails
description: Query your clusters for more details.
endpoint:
http_method: GET
name: acm_service
path: /apis/cluster.open-cluster-management.io/v1/managedclusters
system_prompt: |
You are a helpful assistant. You are given response in json. Only show name of the cluster and its status.
auto_llm_dispatch_on_response: true
tracing:
random_sampling: 100
trace_arch_internal: true

View file

@ -15,7 +15,7 @@ services:
ports:
- "18080:8080"
environment:
# this is only because we are running the sample app in the same docker container environemtn as archgw
# this is only because we are running the sample app in the same docker container environment as archgw
- CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:10000/v1
extra_hosts:
- "host.docker.internal:host-gateway"

View file

@ -0,0 +1,21 @@
services:
chatbot_ui:
build:
context: ../shared/chatbot_ui
ports:
- "18080:8080"
environment:
# this is only because we are running the sample app in the same docker container environment as archgw
- CHAT_COMPLETION_ENDPOINT=http://host.docker.internal:10000/v1
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./arch_config_openshift.yaml:/app/arch_config.yaml
jaeger:
build:
context: ../shared/jaeger
ports:
- "16686:16686"
- "4317:4317"
- "4318:4318"