Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable LiteLLM logging control 🙉 #722

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lukehinds
Copy link
Contributor

Add configurable LiteLLM logging control 🙉

I could not take the noise anymore!

Add the ability to control LiteLLM logging through configuration:
- Add --enable-litellm CLI flag
- Add CODEGATE_ENABLE_LITELLM environment variable
- Add external_loggers.litellm config file option
- Set logger level to CRITICAL+1 when disabled to suppress all logging
- Update documentation with new logging configuration options

This change allows users to enable LiteLLM debug logging when needed while keeping it disabled by default to reduce noise.

I could not take the noise anymore

Add the ability to control LiteLLM logging through configuration:
- Add --enable-litellm CLI flag
- Add CODEGATE_ENABLE_LITELLM environment variable
- Add external_loggers.litellm config file option
- Set logger level to CRITICAL+1 when disabled to suppress all logging
- Update documentation with new logging configuration options

This change allows users to enable LiteLLM debug logging when needed
while keeping it disabled by default to reduce noise.
@lukehinds lukehinds changed the title Add configurable LiteLLM logging control 🙉 [WIP] Add configurable LiteLLM logging control 🙉 Jan 22, 2025
@lukehinds
Copy link
Contributor Author

we could add flags for sqlalchemy, asyncio etc, but I did not want to spend too much time on this and get back to PII

@lukehinds lukehinds changed the title [WIP] Add configurable LiteLLM logging control 🙉 Add configurable LiteLLM logging control 🙉 Jan 22, 2025
blkt
blkt previously approved these changes Jan 23, 2025
Comment on lines 249 to 254
@click.option(
"--enable-litellm",
is_flag=True,
default=False,
help="Enable LiteLLM logging (includes LiteLLM Proxy, Router, and core)",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not a big deal, but this feels like a cosmetic change rather than a functional one, only relevant for developers. For example, removing litellm would make this option useless, and removing it would be a breaking change.

I would avoid exposing this to the end user with an additional option, and rather only rely on environment variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good point! I will make the change.

- `CODEGATE_ENABLE_LITELLM`: enable LiteLLM logging
- `CODEGATE_ENABLE_SQLALCHEMY`: enable SQLAlchemy logging
- `CODEGATE_ENABLE_UVICORN_ERROR`: enable Uvicorn error logging
- `CODEGATE_ENABLE_AIOSQLITE`: enable aiosqlite logging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to add the word "logging" to these environment variables. Else, it hints at enabling us disabling a whole component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants