mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-29 01:03:17 +00:00
* fix(caching): reuse async embedding entries in sync calls Expand per-input dictionary cache entries into normal sync embedding responses with the stored vector, model and token usage. Treat unusable entries as cache misses. Preserve full responses, cache controls, callbacks and custom non-dict mapping passthrough. Add deterministic regression tests for mixed sync and async use, metadata, token arrays, cache controls and custom backend compatibility. Fixes #53723 * fix(caching): add response metadata to sync per-input embedding hits A sync hit on a per-input embedding entry skipped the shared converter tail, so it came back without timing, call id, model name, cost and headers metadata. The expanded response now goes through _convert_cached_result_to_model_response, which leaves non-dict results unconverted and only applies cache_hit and update_response_metadata. Unusable entries still miss before that step. Type the new test helpers' signatures, and add a regression test that compares a per-input hit's metadata keys with a full-response hit's, using explicit call ids. --------- Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _event_loop_reuse.py | ||
| redis_batch_double.py | ||
| test_azure_blob_cache.py | ||
| test_cache_preset_key.py | ||
| test_caching.py | ||
| test_caching_handler.py | ||
| test_check_and_fix_namespace_none_guard.py | ||
| test_dual_cache.py | ||
| test_embedding_router.py | ||
| test_evicted_client_closer.py | ||
| test_gcs_cache.py | ||
| test_in_memory_cache.py | ||
| test_llm_caching_handler.py | ||
| test_llm_client_cache_e2e.py | ||
| test_qdrant_semantic_cache.py | ||
| test_redis_batch.py | ||
| test_redis_cache.py | ||
| test_redis_cluster_cache.py | ||
| test_redis_cluster_node_isolation.py | ||
| test_redis_connection_pool.py | ||
| test_redis_semantic_cache.py | ||
| test_request_redis_batch_post_call.py | ||
| test_request_redis_batch_pre_call.py | ||
| test_responses_stream_cache_keys.py | ||
| test_s3_cache.py | ||
| test_unit_test_caching.py | ||
| test_valkey_semantic_cache.py | ||