Commit 42e514c3 authored by Your Name's avatar Your Name

Fix model name extraction for user providers - keep actual model ID when format is provider/model

parent e241ce57
......@@ -11499,7 +11499,13 @@ async def user_chat_completions_by_username(request: Request, username: str, bod
detail=f"Provider '{provider_name}' credentials not available."
)
body_dict['model'] = provider_name
# Extract actual model name: if format is "provider/model", keep only "model" part
if actual_model.startswith(f"{provider_name}/"):
actual_model_name = actual_model[len(provider_name)+1:]
body_dict['model'] = actual_model_name
else:
# Keep original model name if no slash
body_dict['model'] = actual_model
if body.stream:
return await handler.handle_streaming_chat_completion(request, provider_name, body_dict)
......
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