Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
c8cc0048
Commit
c8cc0048
authored
Mar 16, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix HuggingFace org/model path detection in LiteLLM normalization
parent
26b84ba4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
litellm.py
codai/openai/litellm.py
+13
-3
No files found.
codai/openai/litellm.py
View file @
c8cc0048
...
@@ -110,10 +110,20 @@ class LiteLLMBackend:
...
@@ -110,10 +110,20 @@ class LiteLLMBackend:
resolved_model
=
self
.
_resolve_model_alias
(
model
)
resolved_model
=
self
.
_resolve_model_alias
(
model
)
print
(
f
"DEBUG litellm: After alias resolution: {resolved_model}"
)
print
(
f
"DEBUG litellm: After alias resolution: {resolved_model}"
)
# If already has a provider prefix (contains /),
return as-is
# If already has a provider prefix (contains /),
check if it's valid
if
'/'
in
resolved_model
:
if
'/'
in
resolved_model
:
print
(
f
"DEBUG litellm: Model has provider prefix, returning: {resolved_model}"
)
# Check if the prefix is a known litellm provider
return
resolved_model
known_providers
=
[
'openai'
,
'anthropic'
,
'gemini'
,
'meta'
,
'mistral'
,
'cohere'
,
'ai21'
,
'bedrock'
,
'azure'
,
'ollama'
,
'huggingface'
,
'deepseek'
,
'qwen'
,
'sagemaker'
,
'vertex'
,
'aiplatform'
,
'vllm'
,
'tgi'
]
prefix
=
resolved_model
.
split
(
'/'
)[
0
]
.
lower
()
if
prefix
in
known_providers
:
print
(
f
"DEBUG litellm: Known provider prefix, returning: {resolved_model}"
)
return
resolved_model
# Otherwise, it's likely a HuggingFace org/model path, add huggingface prefix
result
=
f
"huggingface/{resolved_model}"
print
(
f
"DEBUG litellm: HuggingFace org/model detected, adding huggingface prefix: {result}"
)
return
result
# Common model name patterns and their providers
# Common model name patterns and their providers
provider_map
=
{
provider_map
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment