[Bug]: `Auto-router baseline observation could not be initialized` warning logged on every /v1/messages request when no auto-router is involved
Description
Since upgrading to v1.103.0, the proxy logs this warning on every /v1/messages request:
LiteLLM Proxy:WARNING: autorouter_baseline_cache.py:180 - Auto-router baseline observation could not be initializedWe have no auto-router configured. All our /v1/messages traffic (Claude Code) goes to regular model groups, so the log fills with one warning per request. Inference, spend tracking, and responses are all unaffected. The only problem is the log noise.
Expected: requests that were not routed by an auto-router skip the baseline observation silently.
Cause: AutoRouterBaselineCache (added in #41177) is registered unconditionally through PROXY_HOOKS whenever a database is configured. async_pre_call_deployment_hook then runs for every anthropic_messages call and validates the request metadata against _Metadata:
https://github.com/BerriAI/litellm/blob/v1.103.0/litellm/proxy/hooks/autorouter_baseline_cache.py#L78-L82 https://github.com/BerriAI/litellm/blob/v1.103.0/litellm/proxy/hooks/autorouter_baseline_cache.py#L136
_autorouter_baseline_route is a required field. The router only writes it when an auto-router made a decision with a savings baseline. On every other request, Router._record_routing_decision passes None, and _stamp_or_clear_metadata_key pops the key:
https://github.com/BerriAI/litellm/blob/v1.103.0/litellm/router.py#L13718-L13777
As a result, model_validate raises for every non-auto-routed request, and the broad except logs the warning:
A second effect: because the warning is logged without exc_info and fires on all traffic, a real initialization failure on auto-routed traffic would look exactly the same as this noise.
Suggested fix: return early when the stamp is absent. Put the check after the retry-invalidation check so fallback handling still works, and before _Metadata.model_validate:
if logging_obj.baseline_cache_context is not None:
await invalidate_baseline_cache(logging_obj, "retried_request")
return
if metadata.get("_autorouter_baseline_route") is None:
return
request: Final = _Metadata.model_validate(metadata)Optionally, add exc_info=True to the warning on L180, or log it at debug level, so that a warning that does get emitted is actionable.
Prior sighting: #42345 lists "autorouter_baseline_cache.py:180 warning on every boot" under Surprises and leaves it alone. As far as I can tell, it fires per /v1/messages request, not per boot. I couldn't find an existing issue for it.
Config
Abridged to the parts that matter: a database is configured (the hook is only registered when a Prisma client exists), and there is no auto-router / complexity router.
model_list:
- model_name: my-model
litellm_params:
model: hosted_vllm/my-model
api_base: http://vllm.example.com:8000/v1
general_settings:
master_key: os.environ/LITELLM_MASTER_KEY
database_url: os.environ/DATABASE_URL
store_model_in_db: true
router_settings:
redis_host: redis
redis_port: 6379
redis_password: os.environ/REDIS_PASSWORD
litellm_settings:
drop_params: trueLiteLLM Version
v1.103.0 (ghcr.io/berriai/litellm-non_root:1.103.0). Not present in v1.102.1; the hook first ships in v1.103.0-rc.1. It is unchanged on main as of 2026-09-29.
Steps to Repro
- Start the proxy with a
database_urlconfigured and no auto-router models. - Send any Anthropic Messages request:
curl -X POST http://localhost:4000/v1/messages \ -H "Authorization: Bearer sk-..." \ -H "Content-Type: application/json" \ -d '{"model": "my-model", "max_tokens": 64, "messages": [{"role": "user", "content": "hi"}]}' - Response:
200with a normal Messages response. - Proxy log shows, once per request:
LiteLLM Proxy:WARNING: autorouter_baseline_cache.py:180 - Auto-router baseline observation could not be initialized - Expected: no warning for requests that were not routed by an auto-router.
Which part of LiteLLM is this about?
Routing: load balancing, fallbacks, retries, cooldowns
How are you deploying?
Docker
Source: BerriAI/litellm