litellm/tests/e2e
devin-ai-integration[bot] fac43df9b9
fix(complexity_router): return empty dict from _classifier_call_metadata when metadata is absent (#33452)
* fix(complexity_router): return empty dict from _classifier_call_metadata when metadata is absent

The LLM classifier reads request_kwargs.get("litellm_metadata"), but the proxy stores request metadata under "metadata", so this returned None. _classifier_call_metadata then passed None straight through to the classifier acompletion call, which assumes a dict and blows up with 'NoneType' object has no attribute 'update'; the router swallowed it and silently fell back to heuristic scoring, so the configured LLM classifier never ran. Returning an empty dict keeps the classifier call well-formed.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(e2e): cover complexity-router LLM classifier routes over the proxy

Add a live e2e regression for the complexity auto-router: a lexically simple but hard prompt ("Is P equal to NP?") is routed by the LLM classifier to the higher-tier anthropic backend, read back from the spend log's model. Before the metadata fix the classifier silently crashed and the router fell back to heuristic SIMPLE scoring on the openai backend, so this test fails pre-fix and passes post-fix.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-15 17:46:00 -07:00
..
access_control test(e2e): migrate access-control and inference-endpoint regression tests (#32016) 2026-07-05 01:39:10 +00:00
batches fix(e2e): bound spend-log snapshots to a /spend/logs/v2 window (#33265) 2026-07-14 13:32:10 -07:00
claude_code test(claude_code): rename misleading REPO_ROOT to SUITE_ROOT in test_v0_layout 2026-07-15 16:23:26 -07:00
coverage_registry fix(complexity_router): return empty dict from _classifier_call_metadata when metadata is absent (#33452) 2026-07-15 17:46:00 -07:00
llm_translation test(e2e): scope virtual keys to the deployment under test 2026-07-14 17:12:15 -07:00
logging test(e2e): failed request error span carries the full untruncated message and status (LIT-4179) (#33304) 2026-07-14 22:13:13 -07:00
management test(e2e): cover key rpm/tpm rate limiting, window reset, and pacing headers 2026-07-11 16:15:16 -07:00
quota_management refactor: make the code easier to read 2026-07-14 13:58:23 -07:00
router fix(complexity_router): return empty dict from _classifier_call_metadata when metadata is absent (#33452) 2026-07-15 17:46:00 -07:00
bob_the_builder.py test: litellm fix failing tests (#32577) 2026-07-09 13:54:45 -07:00
CLAUDE.md test(claude_code): move the Claude Code compatibility matrix under tests/e2e (#32548) 2026-07-14 19:19:03 -07:00
conftest.py refactor(e2e): move budgets and spend_tracking suites under quota_management 2026-07-11 16:14:21 -07:00
CONTRIBUTING.md ci: gate tests/e2e on zero basedpyright errors in pre-commit and lint CI 2026-07-11 10:25:22 -07:00
docker-compose.yml fix(complexity_router): return empty dict from _classifier_call_metadata when metadata is absent (#33452) 2026-07-15 17:46:00 -07:00
e2e_config.py test(e2e): otel trace completeness on /v1/messages (#33133) 2026-07-13 20:19:06 -07:00
e2e_gateway.py fix(e2e): bound spend-log snapshots to a /spend/logs/v2 window (#33265) 2026-07-14 13:32:10 -07:00
e2e_http.py test(e2e): otel trace completeness on streaming chat, messages, and responses (LIT-3787) (#33234) 2026-07-14 20:23:54 -07:00
lifecycle.py test(e2e): add live batches suite across providers and routing scenarios (#30958) 2026-07-02 08:05:23 -07:00
models.py test(e2e): otel trace completeness on streaming chat, messages, and responses (LIT-3787) (#33234) 2026-07-14 20:23:54 -07:00
pytest.ini refactor(e2e): move budgets and spend_tracking suites under quota_management 2026-07-11 16:14:21 -07:00
test_e2e_gateway.py fix(e2e): bound spend-log snapshots to a /spend/logs/v2 window (#33265) 2026-07-14 13:32:10 -07:00
test_lifecycle.py test: add e2e tests for spend, budgets and llms (#30869) 2026-06-24 15:01:57 -07:00
test_transport.py test(e2e): probe the full spend read surface including schema-hidden routes (#32267) 2026-07-06 14:02:05 -07:00
transport.py test(e2e): probe the full spend read surface including schema-hidden routes (#32267) 2026-07-06 14:02:05 -07:00