From 60d9c28b64ee67a16bfa9869e84c62722542baea Mon Sep 17 00:00:00 2001 From: Tracewebstudio Dev Date: Fri, 17 Jul 2026 00:48:19 +0200 Subject: [PATCH] fix: use configured model for all LiteLLM completions complete_as and complete_as_user were passing internal logical model names (jd-generator, profile-writer, etc.) directly to LiteLLM, which only knows the configured model alias (askash-main). Route all completions through self.model so LiteLLM can resolve the correct backend model. Co-Authored-By: Claude Sonnet 4.6 --- src/providers/llm/litellm_provider.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/providers/llm/litellm_provider.rs b/src/providers/llm/litellm_provider.rs index f9d71bb..d8b0343 100644 --- a/src/providers/llm/litellm_provider.rs +++ b/src/providers/llm/litellm_provider.rs @@ -142,17 +142,20 @@ impl AiProvider for LiteLLMProvider { async fn complete_as( &self, - model: &str, + _model: &str, system_prompt: &str, user_prompt: &str, ) -> Result { - self.chat(&self.api_key, model, system_prompt, user_prompt).await + // LiteLLM routes everything through the configured model (e.g. askash-main). + // Logical model names like "jd-generator" are internal identifiers only. + let model = self.model.clone(); + self.chat(&self.api_key, &model, system_prompt, user_prompt).await } async fn complete_as_user( &self, user_id: Option<&str>, - model: &str, + _model: &str, system_prompt: &str, user_prompt: &str, ) -> Result { @@ -160,7 +163,8 @@ impl AiProvider for LiteLLMProvider { (Some(uid), Some(client)) => client.get_key(uid).await, _ => None, }; - self.chat(key.as_deref().unwrap_or(&self.api_key), model, system_prompt, user_prompt) + let model = self.model.clone(); + self.chat(key.as_deref().unwrap_or(&self.api_key), &model, system_prompt, user_prompt) .await } }