Commit graph

13596 commits

Author SHA1 Message Date
mateo-berri
2548e960f1 fix(cost-map): correct Gemini TTS and native-audio rates
Gemini 2.5 Flash Preview TTS, Gemini 2.5 Pro Preview TTS, and the three
gemini-2.5-flash-native-audio entries carried rates copied from the text
models, so audio output was billed 2x to 6x under Google's published
prices. Set the published per-token rates on all ten keys, add
output_cost_per_audio_token to the native-audio entries, and drop the
long-context tier rates Google does not publish for Pro TTS.
2026-08-26 14:43:21 -07:00
mateo-berri
3b9f6ee2aa fix(proxy): apply empty DB router_settings lists only where yaml sets no value 2026-08-26 14:37:29 -07:00
mateo-berri
f772cad959 fix(cost-map): backfill prompt_cache_min_tokens for the remaining Claude 4.x re-export entries 2026-08-26 14:31:45 -07:00
mateo-berri
43b8ed0fd9 fix(prompts): validate only the litellm_params a PATCH sends 2026-08-26 14:20:26 -07:00
mateo-berri
dbc819dc77 fix(prompts): apply prompt templates before routing on /v1/responses and honor ignore_prompt_manager_model
On /v1/responses the prompt template ran inside litellm.aresponses, after the
router had already resolved a deployment and injected its api_key/api_base, so a
prompt whose metadata.model pointed at another provider sent the old
deployment's credentials cross-provider (401). The proxy now runs the prompt
template for aresponses in the pre-call hook, before routing, so the router
picks the deployment that matches the swapped model. As a backstop, the SDK
refuses a cross-provider swap when explicit credentials are already present
instead of forwarding them.

ignore_prompt_manager_model and ignore_prompt_manager_optional_params saved on
a prompt were only read by the generic manager, so dotprompt prompts ignored
them on every endpoint. PromptManagementBase now merges the prompt spec's flags
with the per-request ones for every manager, and the generic manager no longer
drops caller flags when no spec is present.
2026-08-26 14:12:28 -07:00
mateo-berri
951cef1e98 fix(cost_calculator): strip duplicated region segment from alias cost keys 2026-08-26 14:10:05 -07:00
mateo-berri
465ebb1bdd fix(mcp): join discovery for a clientless DCR bridge still missing its registration endpoint 2026-08-26 14:08:09 -07:00
Mateo Wang
f57e4b812c
Merge pull request #38403 from BerriAI/litellm_lit3373_valkey_acl
fix(caching): require the namespace delimiter when checking already-namespaced redis keys
2026-08-26 14:04:51 -07:00
ryan-crabbe-berri
870328f8cc test(team): fake the budget table instead of patching new_budget and update_budget
The three member-budget tests patched litellm internals and asserted only on
the mock, which tripped the TQ002 and TQ008 test-quality ratchet. Fake the
prisma budget table on the shared client and assert on the row that reaches
the database plus the returned team payload.
2026-08-26 14:00:45 -07:00
mateo-berri
caa97eea22 fix(cost-map): correct prompt_cache_min_tokens for Claude Fable 5 and backfill Anthropic re-export entries 2026-08-26 14:00:39 -07:00
mateo-berri
6d1b295dae fix(proxy): stop empty DB router_settings lists from clobbering yaml fallbacks 2026-08-26 13:58:00 -07:00
mateo-berri
6fa5164d86 fix(prompts): reject keyed prompt_data with prompt_id and populate prompt version
POST /prompts silently stored an empty template when litellm_params.prompt_id
was combined with prompt_data keyed by template name, because the loader
wrapped the already-keyed dict under prompt_id a second time. The loader now
wraps only a flat template (a dict carrying a content key), and create,
update, and patch reject the ambiguous keyed+prompt_id combination with a 400
that names both valid shapes. The API also returned version null on every
create and lost version, environment, and created_by on registry reload; both
now carry through. Versioned ids like my-prompt.v1, which the create API
itself returns, now resolve to their base template on the SDK prompt hooks,
and a flat DB prompt with no litellm_params.prompt_id registers under its base
API id instead of garbage.
2026-08-26 13:57:10 -07:00
Yucheng Zhu
27207659f8 fix(gemini-realtime): drop OpenAI stock voice names instead of pairing them to Gemini voices 2026-08-26 13:56:01 -07:00
Mateo Wang
3c24f37502
Merge pull request #38394 from BerriAI/litellm_lit6253_cache_hit_callback_flush
fix(logging_worker): rescue dequeued logging tasks lost at event loop close
2026-08-26 13:50:02 -07:00
mateo-berri
57f553aec8 fix(caching): treat an empty cache namespace as no namespace 2026-08-26 13:48:45 -07:00
milan
99d4741586 fix(team): allow no-reset default budgets for team members
The Default Budget Duration field in Team Member Settings only offered daily, weekly and monthly, so a team member budget could never be set to never reset. It now uses the shared BudgetDurationDropdown, and /team/update writes an explicitly null duration through to the member budget row along with its reset time.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-26 13:48:08 -07:00
Mateo Wang
c66c5eb5e7
Merge pull request #38400 from BerriAI/litellm_lit_3369_global_ssl_verify
fix(aiohttp): honor global ssl_verify on the aiohttp_openai handler path
2026-08-26 13:45:54 -07:00
yuneng-jiang
a5d8963616
Merge pull request #38308 from BerriAI/litellm_key-update-redis-evict
fix(proxy): stop cache eviction errors from failing /key/update
2026-08-26 13:44:20 -07:00
ryan-crabbe-berri
22b503d337
Merge pull request #36518 from kunal2002/enforce-rpm-tpm-on-model-add
feat(proxy): enforce rpm/tpm on model add + fix validation error title in UI
2026-08-26 13:42:17 -07:00
mateo-berri
19e6f03a3c fix(mcp): let root oauth routes defer discovery to the endpoint-gated flow join 2026-08-26 13:39:35 -07:00
tin-berri
e4037978f1
fix(router): resolve model_group_alias before pre-routing strategy dispatch (#38382)
A model_group_alias whose target is an auto-router shows up in /v1/models and
/model_group/info but 400s on call with "Unmapped LLM provider for this
endpoint. You passed model=complexity_router, custom_llm_provider=auto_router".
async_pre_routing_hook picks the strategy using the name the caller passed,
while the alias is only resolved further down in
_common_checks_available_deployment, so the four strategy registries, all keyed
by the marker deployment's model_name, never match. The hook then declines, and
the auto_router/ marker deployment goes out as if it were a real model

Resolve the alias once at the top of the hook, for lookups only, so the
registries, the tag-filtering escape hatch and the marker's forwardable params
all see the name they are keyed under. The caller-facing name is untouched:
spend metadata is stamped before routing and the response still carries the
alias the client sent

Second half, so the same symptom cannot reach a provider through the entry
points this does not fix (the sync selection path that never runs the hook, a
team-scoped router keyed on its internal name), a group that resolves only to
strategy markers is no longer callable: it raises a BadRequestError naming the
marker instead of handing the auto_router/ pseudo-model to the provider
2026-08-26 13:38:55 -07:00
mateo-berri
09c9e4360e test(mcp): keep manifest test active on Python 3.10 via tomli fallback 2026-08-26 13:35:27 -07:00
mateo-berri
ef7ba3e54b fix(logging_worker): swallow cancellation in exit flush and revive dequeued tasks on loop change 2026-08-26 13:30:40 -07:00
ryan-crabbe-berri
968c96143f test(proxy): assert the rpm/tpm guard returns None on the passing paths
Satisfies the TQ001 zero-assert gate
2026-08-26 13:27:02 -07:00
mateo-berri
7b8d48782b fix(caching): require the namespace delimiter when checking already-namespaced redis keys 2026-08-26 13:25:23 -07:00
mateo-berri
f0412345b5 fix(aiohttp): honor global ssl_verify on the aiohttp_openai handler path 2026-08-26 13:24:36 -07:00
mateo-berri
1eb538de18 fix(mcp): add litellm[mcp] extra and actionable error when streamable_http_client is missing
The MCP client's HTTP transport needs mcp>=1.24.0 for streamable_http_client,
but a base litellm install declares no mcp constraint and no extra existed to
pin one, so environments carrying an older mcp fail at connect time with
'streamable_http_client is not available. Please install mcp with HTTP
support.', which names no version floor and no installable remedy.

Add a litellm[mcp] extra matching the proxy extra's mcp>=1.28.1,<2.0 and
replace the vague ImportError with one naming the required floor, the
installed mcp version, and the pip commands that fix it.
2026-08-26 13:23:51 -07:00
mateo-berri
6d1a7ff8a8 Merge remote-tracking branch 'origin/litellm_internal_staging' into fix-cost-alias-double-prefix 2026-08-26 13:22:45 -07:00
mateo-berri
c33454fdec fix(cost_calculator): keep custom-priced router ids when resolving slash aliases 2026-08-26 13:22:45 -07:00
ryan-crabbe-berri
a85036ec3e Merge branch 'litellm_internal_staging' into enforce-rpm-tpm-on-model-add
Drop the notifications_manager.tsx keyword tweak: staging replaced the
substring classifier with lib/toast.ts, which already titles
validation_error responses as Validation Error
2026-08-26 13:19:07 -07:00
Yucheng Zhu
c3c9903ba5 fix: collapse image_url blocks whose payload lacks a url instead of forwarding them 2026-08-26 13:19:06 -07:00
Mateo Wang
f6571a653f
Merge pull request #38385 from BerriAI/litellm_lit6184_sdk_async_redis_cache_write
fix(caching): flush async cache writes cancelled at event loop shutdown
2026-08-26 13:17:43 -07:00
Mateo Wang
abf6ef96db
Merge pull request #36762 from danielva-monday/fix/bedrock-converse-1h-cache-cost
fix(bedrock): parse cacheDetails for Converse 1h/5m cache write cost split
2026-08-26 13:12:33 -07:00
Yucheng Zhu
df7b1f0fce fix: forward image content lists to DeepSeek vision models 2026-08-26 13:08:22 -07:00
Yucheng Zhu
8e1dcf02ea style(gemini-realtime): wrap overlong docstrings to the 120 char limit 2026-08-26 12:54:44 -07:00
Mateo Wang
724c5c2d96
Merge pull request #38390 from BerriAI/litellm_realtime_health_ga_protocol
fix(health): probe Azure GA realtime path for transcription-only models
2026-08-26 12:53:05 -07:00
Yucheng Zhu
002407af90 fix(gemini-realtime): map OpenAI stock voice names to Gemini prebuilt voices 2026-08-26 12:48:01 -07:00
mateo-berri
8fcbc357e5 fix(mcp): gate deferred oauth discovery on the endpoint each flow needs and read the resolved server
The token exchange no longer joins deferred discovery when the token url is
already stored, so it cannot 503 over an unreachable issuer it needs nothing
from. After a request joins discovery, authorize and token now read the
resolved server for the DCR bridge relay decision and the rest of the flow,
so a registration endpoint resolved mid-request routes a front-door client
to its own redirect binding. The encrypt seam in the issuer-yield authorize
test now uses a real salt key instead of patching an SDK internal.
2026-08-26 12:45:25 -07:00
mateo-berri
ca177f9cbc Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_pr36762_bedrock_cache_details
# Conflicts:
#	litellm/llms/bedrock/chat/converse_transformation.py
2026-08-26 12:45:15 -07:00
Mateo Wang
c850ed3c8e
Merge pull request #38393 from BerriAI/litellm_minimax_messages_env_key
fix(minimax): attach MINIMAX_API_KEY on anthropic messages requests
2026-08-26 12:44:01 -07:00
mateo-berri
1ba1a8038c fix(logging_worker): rescue dequeued logging tasks lost at event loop close
Cache-hit success callbacks in short-lived SDK scripts enqueue
Logging.async_success_handler onto the global logging worker; the worker
loop dequeues the task and asyncio.run cancels the processing task before
it ever starts, so the coroutine leaves the queue unawaited and the atexit
flush finds an empty queue and rescues nothing. Track dequeued-but-unfinished
tasks with strong refs and have the atexit flush run any whose coroutine
never started
2026-08-26 12:42:08 -07:00
Mateo Wang
43ae3507e0
Merge pull request #37090 from Siraj637909/fix/gh-36898-health-leak-extra-headers
fix(health): strip credential fields from GET /health output
2026-08-26 12:35:43 -07:00
mateo-berri
7c717c7c6a test(realtime): pin mode-only transcription detection and correct a stale docstring 2026-08-26 12:33:46 -07:00
mateo-berri
3c9690c4f5 test(realtime): fully type the capturing websocket connect double 2026-08-26 12:27:05 -07:00
Mateo Wang
74b6149d18
Merge pull request #38370 from BerriAI/litellm_azure_gpt_5_6_cache_write_pricing
fix(pricing): add azure gpt-5.6 cache write rates and correct data zone priority
2026-08-26 12:21:39 -07:00
mateo-berri
74263bcb23 fix(minimax): attach MINIMAX_API_KEY on anthropic messages requests 2026-08-26 12:19:37 -07:00
Mateo Wang
99789733fb
Merge pull request #38378 from BerriAI/litellm_anthropic_fast_mode_cache_and_response_speed
fix(anthropic): scale cache costs by fast mode and trust served speed
2026-08-26 12:18:44 -07:00
mateo-berri
e56c42862c fix(health): probe Azure GA realtime path for transcription-only models
The realtime health check always built the Azure websocket URL with the
default beta protocol, so GA-only transcription models such as
azure/gpt-realtime-whisper got probed at /openai/realtime and were
rejected with HTTP 400 on every /health run, while real calls through
the proxy resolved the GA path via intent=transcription and worked.

The probe now resolves the protocol the way the real call path does:
an explicit realtime_protocol (argument, deployment litellm_params, or
LITELLM_AZURE_REALTIME_PROTOCOL) wins, transcription-only models fall
back to GA with intent=transcription, and everything else keeps beta.
Transcription-only detection reads both mode and supported_endpoints
from get_model_info because a live proxy overwrites the catalog mode
with the operator's deployment model_info (mode: realtime) during
router registration, while supported_endpoints survives it.
get_model_info now propagates supported_endpoints from the cost map;
it declared the field but never populated it.
2026-08-26 12:14:52 -07:00
Yuneng Jiang
291484a5e2
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/search-tools-sync-issue-e522a2 2026-08-26 12:11:06 -07:00
mateo-berri
ece187ea24 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_anthropic_fast_mode_cache_and_response_speed
# Conflicts:
#	tests/test_litellm/test_cost_calculator.py
2026-08-26 12:10:33 -07:00