fix(proxy): change model mismatch logs from WARNING to DEBUG (#20994)

Fixes #20990

PR #19943 added logging when the proxy overrides model names to prevent
internal provider prefixes from leaking to clients. The behavior works
correctly but logs a WARNING on every request with model mismatch.

For high-traffic customers using model aliases or provider prefixes,
this creates millions of warnings per day, flooding logs and causing
disk space issues.

Changed log level from WARNING to DEBUG since:
- The model mismatch is expected behavior when using aliases
- The override happens correctly regardless of log level
- Operators can still enable with LITELLM_LOG=DEBUG for debugging

Changes:
- common_request_processing.py: 2 warnings -> debug (non-streaming)
- proxy_server.py: 1 warning -> debug (streaming)
This commit is contained in:
milan-berri
2026-02-12 16:40:58 -08:00
committed by GitHub
parent ce3bb97d40
commit a2e9e73b64
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -282,7 +282,7 @@ def _override_openai_response_model(
if isinstance(response_obj, dict):
downstream_model = response_obj.get("model")
if downstream_model != requested_model:
verbose_proxy_logger.warning(
verbose_proxy_logger.debug(
"%s: response model mismatch - requested=%r downstream=%r. Overriding response['model'] to requested model.",
log_context,
requested_model,
@@ -301,7 +301,7 @@ def _override_openai_response_model(
downstream_model = getattr(response_obj, "model", None)
if downstream_model != requested_model:
verbose_proxy_logger.warning(
verbose_proxy_logger.debug(
"%s: response model mismatch - requested=%r downstream=%r. Overriding response.model to requested model.",
log_context,
requested_model,
+1 -1
View File
@@ -4915,7 +4915,7 @@ def _restamp_streaming_chunk_model(
chunk.get("model") if isinstance(chunk, dict) else getattr(chunk, "model", None)
)
if not model_mismatch_logged and downstream_model != requested_model_from_client:
verbose_proxy_logger.warning(
verbose_proxy_logger.debug(
"litellm_call_id=%s: streaming chunk model mismatch - requested=%r downstream=%r. Overriding model to requested.",
request_data.get("litellm_call_id"),
requested_model_from_client,