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
9016336b
Commit
9016336b
authored
Mar 19, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Use singleton model_manager and multi_model_manager
parent
afc975ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
main.py
codai/main.py
+3
-6
No files found.
codai/main.py
View file @
9016336b
...
@@ -36,7 +36,7 @@ def main():
...
@@ -36,7 +36,7 @@ def main():
set_load_mode
,
set_load_mode
,
set_grammar_guided_gen
,
set_grammar_guided_gen
,
)
)
from
codai.models.manager
import
ModelManager
,
MultiModelManager
from
codai.models.manager
import
ModelManager
,
MultiModelManager
,
model_manager
,
multi_model_manager
from
codai.backends
import
detect_available_backends
from
codai.backends
import
detect_available_backends
from
codai.models.cache
import
(
from
codai.models.cache
import
(
get_all_cache_dirs
,
get_all_cache_dirs
,
...
@@ -326,11 +326,8 @@ def main():
...
@@ -326,11 +326,8 @@ def main():
print
(
f
"Using backend: {backend}"
)
print
(
f
"Using backend: {backend}"
)
# Initialize model manager based on backend
# Set the backend for the model manager
model_manager
=
ModelManager
(
backend
=
backend
)
model_manager
.
backend_type
=
backend
# Initialize multi-model manager
multi_model_manager
=
MultiModelManager
(
model_manager
)
# Store references globally for API endpoints
# Store references globally for API endpoints
from
codai.api
import
app
as
fastapi_app
from
codai.api
import
app
as
fastapi_app
...
...
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