Commit 87acdc45 authored by Your Name's avatar Your Name

Fix model name normalization to preserve org name

- Instead of defaulting to 'huggingface' for org/model paths,
  now preserves the original org name as the provider
- Example: TeichAI/Qwen3-8B-... now becomes openai/TeichAI/Qwen3-8B-...
  instead of openai/huggingface/TeichAI/Qwen3-8B-...
parent df7875e3
...@@ -133,9 +133,12 @@ class LiteLLMBackend: ...@@ -133,9 +133,12 @@ class LiteLLMBackend:
result = f"openai/{prefix}/{model_part}" result = f"openai/{prefix}/{model_part}"
print(f"DEBUG litellm: Known provider '{prefix}', returning: {result}") print(f"DEBUG litellm: Known provider '{prefix}', returning: {result}")
return result return result
# Otherwise, it's likely a HuggingFace org/model path # Otherwise, treat the first part as the org/provider name (not default to huggingface)
result = f"openai/huggingface/{resolved_model}" # This allows custom model paths like TeichAI/model-name to work correctly
print(f"DEBUG litellm: HuggingFace org/model, returning: {result}") org_name = parts[0]
model_part = '/'.join(parts[1:])
result = f"openai/{org_name}/{model_part}"
print(f"DEBUG litellm: Custom org/model, returning: {result}")
return result return result
# No provider prefix - detect provider from model name pattern # No provider prefix - detect provider from model name pattern
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment