diff --git a/README.md b/README.md index c6200745..184aecaf 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ llm_providers: - name: ministral-3b access_key: $MISTRAL_API_KEY - provider: mistral + provider: openai model: ministral-3b-latest ``` diff --git a/arch/envoy.template.yaml b/arch/envoy.template.yaml index 3e278c1c..a145add8 100644 --- a/arch/envoy.template.yaml +++ b/arch/envoy.template.yaml @@ -133,7 +133,7 @@ static_resources: exact: {{ provider.name }} route: auto_host_rewrite: true - cluster: {{ provider.provider }} + cluster: {{ provider.name }} timeout: 60s {% endfor %} http_filters: @@ -378,7 +378,7 @@ static_resources: exact: {{ provider.name }} route: auto_host_rewrite: true - cluster: {{ provider.provider }} + cluster: {{ provider.name }} timeout: 60s {% endfor %} - match: diff --git a/crates/common/src/configuration.rs b/crates/common/src/configuration.rs index e196be21..5fb96ef4 100644 --- a/crates/common/src/configuration.rs +++ b/crates/common/src/configuration.rs @@ -162,11 +162,17 @@ pub struct EmbeddingProviver { pub model: String, } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum LlmProviderType { + #[serde(rename = "openai")] + OpenAI +} + #[derive(Debug, Clone, Serialize, Deserialize)] //TODO: use enum for model, but if there is a new model, we need to update the code pub struct LlmProvider { pub name: String, - pub provider: String, + pub provider: LlmProviderType, pub access_key: Option, pub model: String, pub default: Option, diff --git a/crates/llm_gateway/src/stream_context.rs b/crates/llm_gateway/src/stream_context.rs index 7169d8cd..9bb87de8 100644 --- a/crates/llm_gateway/src/stream_context.rs +++ b/crates/llm_gateway/src/stream_context.rs @@ -80,7 +80,7 @@ impl StreamContext { fn select_llm_provider(&mut self) { let provider_hint = self .get_http_request_header(ARCH_PROVIDER_HINT_HEADER) - .map(|provider_name| provider_name.into()); + .map(|llm_name| llm_name.into()); debug!("llm provider hint: {:?}", provider_hint); self.llm_provider = Some(routing::get_llm_provider( diff --git a/demos/currency_exchange_ollama/arch_config.yaml b/demos/currency_exchange_ollama/arch_config.yaml index d5a006df..c555a302 100644 --- a/demos/currency_exchange_ollama/arch_config.yaml +++ b/demos/currency_exchange_ollama/arch_config.yaml @@ -8,7 +8,7 @@ listener: llm_providers: - name: local-llama - provider: local-llama + provider: openai model: llama3.2 endpoint: host.docker.internal:11434 diff --git a/docs/source/resources/includes/arch_config_full_reference.yaml b/docs/source/resources/includes/arch_config_full_reference.yaml index 291f68e5..28f3b123 100644 --- a/docs/source/resources/includes/arch_config_full_reference.yaml +++ b/docs/source/resources/includes/arch_config_full_reference.yaml @@ -46,12 +46,12 @@ llm_providers: unit: minute - name: Mistral8x7b - provider: mistral + provider: openai access_key: $MISTRAL_API_KEY model: mistral-8x7b - name: MistralLocal7b - provider: local + provider: openai model: mistral-7b-instruct endpoint: mistral_local