mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +00:00
Vertex AI and Gemini context caching now remember each cache they create or find until 10s before its expireTime, so a repeat cache-marked request goes straight to generateContent instead of listing every cachedContents first. Concurrent async requests for one prefix share one lookup or create When generation rejects a remembered cache with a 400, 403 or 404 that names the cached content, the request rebuilds the cache and sends once more. Any other 400, 403 or 404 drops the record without a retry Fixes #36395
10 lines
257 B
Python
10 lines
257 B
Python
import pytest
|
|
|
|
from litellm.llms.vertex_ai.context_caching.known_cached_contents import known_cached_contents
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _forget_known_cached_contents():
|
|
known_cached_contents.clear()
|
|
yield
|
|
known_cached_contents.clear()
|