fix: use configured model for all LiteLLM completions
All checks were successful
build-and-release / build (push) Successful in 3m38s
All checks were successful
build-and-release / build (push) Successful in 3m38s
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 <noreply@anthropic.com>
This commit is contained in:
parent
ed6a094003
commit
60d9c28b64
1 changed files with 8 additions and 4 deletions
|
|
@ -142,17 +142,20 @@ impl AiProvider for LiteLLMProvider {
|
|||
|
||||
async fn complete_as(
|
||||
&self,
|
||||
model: &str,
|
||||
_model: &str,
|
||||
system_prompt: &str,
|
||||
user_prompt: &str,
|
||||
) -> Result<String, AppError> {
|
||||
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<String, AppError> {
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue