mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* fix(caching): count the caller's messages for max_messages on the chat completion bridges responses() and anthropic.messages on providers that bridge to completion() checked max_messages against the translated chat messages, so 5 Responses items with grouped function calls were cached and 3 Anthropic messages with 3 tool results never were. Each bridge now stamps the caller's count into the inner call's cache controls as a frozen CallerMessageCount, which the cache gate reads before counting the request. A count an outer bridge already stamped is kept, a forged int or dict under the key is ignored, and string Responses input stays unstamped so it keeps its current gate. * test(caching): cover string input, system prompts and async writes on the chat completion bridges Restrict the cache to completion call types so the outer Responses and Messages caches cannot hide the inner gate, and check that string Responses input keeps its chat message count at max_messages 0 and 1, that a separate system prompt is not a caller message, and that async Messages under the limit is cached. Async tests now await cache writes and flush the logging worker in a finally block. --------- Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| _support | ||
| audio_tests | ||
| base_sdk_tests | ||
| basic_proxy_startup_tests | ||
| benchmarks | ||
| code_coverage_tests | ||
| documentation_tests | ||
| e2e | ||
| e2e_harness | ||
| fixtures | ||
| harness_e2e | ||
| integration | ||
| rust-python-harness | ||
| test_litellm_rust | ||
| typing | ||
| unit | ||
| windows_tests | ||
| __init__.py | ||
| _fake_openai_endpoint_server.py | ||
| _flush_vcr_cache.py | ||
| _live_test_helpers.py | ||
| _master_key.py | ||
| _module_state.py | ||
| _openai_record_replay_proxy.py | ||
| _process_helpers.py | ||
| _vcr_conftest_common.py | ||
| _vcr_redis_persister.py | ||
| _wait_helpers.py | ||
| _ws_vcr.py | ||
| AGENTS.md | ||
| capturing_transport.py | ||
| eval_swe_bench.py | ||
| fake_openai_endpoint.py | ||
| gettysburg.wav | ||
| large_text.py | ||
| openai_batch_completions.jsonl | ||
| pyrightconfig.json | ||
| README.MD | ||
| test_logging.conf | ||
| test_rust_python_harness.py | ||
| VCR_TESTING.md | ||
| white_100x100.png | ||
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/unit
This folder can only run mock tests.