mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-26 18:19:24 +00:00
* fix(adapter): populate cache_read_input_tokens from prompt_tokens_details The Anthropic adapter's translate_openai_response_to_anthropic checked only the private _cache_read_input_tokens attr (set by Anthropic/DeepSeek) but not prompt_tokens_details.cached_tokens (set by OpenAI/Azure). Use prompt_tokens_details.cached_tokens directly — it is already extracted and is the standard field populated by all providers. Fixes #22089 * fix(adapter): apply same cache_read_input_tokens fix to streaming path The streaming path in translate_streaming_openai_response_to_anthropic had the same bug — relying on _cache_read_input_tokens instead of prompt_tokens_details.cached_tokens.
Testing for litellm/
This directory 1:1 maps the the litellm/ directory, and can only contain mocked tests.
The point of this is to:
- Increase test coverage of
litellm/ - Make it easy for contributors to add tests for the
litellm/package and easily run tests without needing LLM API keys.
File name conventions
litellm/proxy/test_caching_routes.pymaps tolitellm/proxy/caching_routes.pytest_<filename>.pymaps tolitellm/<filename>.py