From 695e9ca695327fd384e15ed202416a051db73c4f Mon Sep 17 00:00:00 2001 From: Anish De <63192115+AnishDe12020@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:20:40 +0200 Subject: [PATCH] feat: add LiteLLM provider support for model name remapping LiteLLM proxy expects plain model IDs without the provider prefix. This change strips the 'litellm/' prefix from model names before sending API requests, following the same pattern as zai-coding-plan. Example: - Spacebot config: channel = "litellm/kimi-k2p5" - API request: {"model": "kimi-k2p5"} Tested with dev instance: - 60+ successful API calls - All 6 agents generating profiles correctly - Fallback chains working as expected Fixes: model routing with LiteLLM proxy gateway --- src/llm/model.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/llm/model.rs b/src/llm/model.rs index ddaef3cd2..002c8e6d1 100644 --- a/src/llm/model.rs +++ b/src/llm/model.rs @@ -2937,6 +2937,13 @@ fn remap_model_name_for_api(provider: &str, model_name: &str) -> String { .strip_prefix("zai/") .unwrap_or(model_name) .to_string() + } else if provider == "litellm" { + // LiteLLM proxy expects plain model ids without provider prefix. + // Spacebot uses "litellm/model-name" but LiteLLM expects "model-name". + model_name + .strip_prefix("litellm/") + .unwrap_or(model_name) + .to_string() } else { model_name.to_string() }