mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
fix(ui): expose response cost header and correct prompt caching test copy
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
5bec242629
commit
865424fb1c
3 changed files with 9 additions and 1 deletions
|
|
@ -205,6 +205,7 @@ LITELLM_UI_ALLOW_HEADERS: Final = [
|
|||
"x-litellm-guardrail-scan-id",
|
||||
"x-litellm-guardrail-scan-metadata",
|
||||
"x-litellm-cache-key",
|
||||
"x-litellm-response-cost",
|
||||
]
|
||||
|
||||
# Gemini model-specific minimal thinking budget constants
|
||||
|
|
|
|||
|
|
@ -102,6 +102,13 @@ def test_cors_exposes_cache_key_header_to_browser_js():
|
|||
assert "x-litellm-cache-key" in cors_middleware.kwargs["expose_headers"]
|
||||
|
||||
|
||||
def test_cors_exposes_response_cost_header_to_browser_js():
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
cors_middleware = next(m for m in app.user_middleware if m.cls is CORSMiddleware)
|
||||
assert "x-litellm-response-cost" in cors_middleware.kwargs["expose_headers"]
|
||||
|
||||
|
||||
def test_login_v2_returns_redirect_url_and_sets_cookie(monkeypatch):
|
||||
mock_login_result = {"user_id": "test-user"}
|
||||
mock_prisma_client = MagicMock()
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ const PromptCachingTestCard: React.FC<PromptCachingTestCardProps> = ({
|
|||
<CardContent>
|
||||
<CardTitle>Test prompt caching</CardTitle>
|
||||
<p className="mt-1 break-words text-xs text-muted-foreground">
|
||||
Sends two identical requests with a ~5k token system prompt and no cache_control of its own. If LiteLLM
|
||||
Sends two identical requests with a ~9k token system prompt and no cache_control of its own. If LiteLLM
|
||||
injects the breakpoints, the first call writes the cache and the second reads it.
|
||||
</p>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue