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
c52d2e2b
Commit
c52d2e2b
authored
Mar 16, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable litellm debug mode when --debug flag is set
parent
04b971a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
litellm.py
codai/openai/litellm.py
+22
-0
No files found.
codai/openai/litellm.py
View file @
c52d2e2b
...
@@ -93,6 +93,9 @@ class LiteLLMBackend:
...
@@ -93,6 +93,9 @@ class LiteLLMBackend:
litellm
.
base_url
=
self
.
base_url
litellm
.
base_url
=
self
.
base_url
if
self
.
api_key
:
if
self
.
api_key
:
litellm
.
api_key
=
self
.
api_key
litellm
.
api_key
=
self
.
api_key
# Turn on litellm debug mode if global debug is enabled
_setup_litellm_debug
()
def
normalize_model_name
(
self
,
model
:
str
)
->
str
:
def
normalize_model_name
(
self
,
model
:
str
)
->
str
:
"""
"""
...
@@ -745,6 +748,25 @@ class LiteLLMBackend:
...
@@ -745,6 +748,25 @@ class LiteLLMBackend:
default_litellm_backend
:
Optional
[
LiteLLMBackend
]
=
None
default_litellm_backend
:
Optional
[
LiteLLMBackend
]
=
None
# Turn on litellm debug mode if global debug is enabled
def
_setup_litellm_debug
():
"""Turn on litellm debug mode if global debug is enabled."""
global
global_debug
try
:
# Import global_args from coderai
import
sys
import
os
# Try to get global_args from the coderai module
if
'coderai'
in
sys
.
modules
:
from
coderai
import
global_debug
as
coderai_debug
if
coderai_debug
:
import
litellm
litellm
.
_turn_on_debug
()
print
(
"DEBUG litellm: Debug mode enabled"
)
except
Exception
as
e
:
print
(
f
"DEBUG litellm: Could not enable debug mode: {e}"
)
def
get_litellm_backend
(
def
get_litellm_backend
(
model
:
str
=
"gpt-3.5-turbo"
,
model
:
str
=
"gpt-3.5-turbo"
,
api_key
:
Optional
[
str
]
=
None
,
api_key
:
Optional
[
str
]
=
None
,
...
...
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