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
f69d5798
Commit
f69d5798
authored
Mar 18, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add debug logging to model resolution
parent
5b3d49ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
utils.py
codai/models/utils.py
+9
-3
No files found.
codai/models/utils.py
View file @
f69d5798
...
...
@@ -121,16 +121,22 @@ def get_resolved_model_name(requested_model: str, current_manager = None) -> str
# If requested_model is "default" or empty, get the actual loaded model
if
requested_model
in
(
"default"
,
""
,
None
)
or
not
requested_model
:
# Try default_model first
if
hasattr
(
current_manager
,
'default_model'
)
and
current_manager
.
default_model
and
current_manager
.
default_model
!=
"default"
:
return
current_manager
.
default_model
default_model
=
getattr
(
current_manager
,
'default_model'
,
None
)
print
(
f
"DEBUG resolve: default_model = {default_model}, models = {list(current_manager.models.keys())}"
)
if
default_model
and
default_model
!=
"default"
:
print
(
f
"DEBUG resolve: returning default_model: {default_model}"
)
return
default_model
# Otherwise return the first model that is not a special key (default, image:, audio:)
for
key
in
current_manager
.
models
.
keys
():
# Skip special model keys
if
key
in
(
"default"
,
"image"
,
"audio"
)
or
key
.
startswith
(
"image:"
)
or
key
.
startswith
(
"audio:"
):
continue
print
(
f
"DEBUG resolve: returning first non-special key: {key}"
)
return
key
# Fallback to first model if all are special keys
return
list
(
current_manager
.
models
.
keys
())[
0
]
fallback
=
list
(
current_manager
.
models
.
keys
())[
0
]
print
(
f
"DEBUG resolve: fallback to first: {fallback}"
)
return
fallback
# Check if the model is loaded in the manager
for
key
,
model
in
current_manager
.
models
.
items
():
if
requested_model
==
key
or
requested_model
in
key
:
...
...
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