Commit graph

1980 commits

Author SHA1 Message Date
mateo-berri
059aec8887 Merge remote-tracking branch 'origin/litellm_internal_staging' into pr37112-head 2026-08-20 11:18:30 -07:00
Devin AI
b7017a7949 fix(model_prices): consolidate nine open registry audits into one changeset
Combines the model-cost-map data from #35911, #36017, #36080, #36113, #36188, #36444, #37029, #37252 and #37632 onto current litellm_internal_staging, merged per entry field so older branches no longer revert fields the base has gained since they were opened. Drops the Gemini deprecation dates from #36188 and the text-embedding-004 date from #36080 that the official docs contradict.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-20 18:13:39 +00:00
mateo-berri
10829fff04 Merge remote-tracking branch 'origin/litellm_internal_staging' into pr-37110-check 2026-08-20 11:00:02 -07:00
mateo-berri
4fac88790d fix(mistral): correct zai-glm-5-2 limits, add cached-input price and glm-5-2 alias
Mistral's live /v1/models reports max_context_length 1048576 and capabilities.reasoning
true for zai-glm-5-2, and its docs price cached input at $0.14/M. Without
cache_read_input_token_cost LiteLLM billed every cached prompt token at $0, so a repeat
request against a 21k-token cached prefix logged $0.0000135 instead of its real cost.

Mistral also serves the model under the short glm-5-2 name, which had no cost map entry
at all and therefore no pricing, so add it alongside.
2026-08-20 10:45:24 -07:00
Mateo Wang
e51addb802
Merge pull request #37628 from BerriAI/litellm_lit5876_openai_prompt_cache_breakpoint
feat(prompt-caching): map cache_control_injection_points to OpenAI prompt_cache_breakpoint on GPT-5.6+ targets
2026-08-20 10:24:43 -07:00
mateo-berri
d9aaa95978 Gate OpenAI prompt cache breakpoints on the real target and carry them through /v1/responses
The cache control hook also runs on litellm.responses() input. On a
GPT-5.6 deployment it wrapped a string-content item into a chat-shaped
{"type": "text"} part, which the Responses API rejects, and it never
marked input_text, input_image or input_file parts, so no breakpoint and
no prompt_cache_options reached the provider. Add the Responses part
types to the eligible block set and translate chat-shaped text parts on
non-assistant items to input_text in
ResponsesAPIRequestUtils.merge_prompt_management_input, which both the
async and the sync prompt management sites go through.

The dialect also fired for any GPT-5.6 name that resolved to provider
openai, including deployments pointed at a custom api_base that does not
understand prompt_cache_breakpoint. Decide it once per request from the
provider, the model map and the resolved api_base (request, then
litellm.api_base, then OPENAI_BASE_URL / OPENAI_API_BASE): only
api.openai.com and *.api.openai.com hosts speak the dialect, a top-level
prompt_cache_options opts a custom target in, and litellm_proxy/ targets
never get it. maybe_seed_default_injection_points takes api_base and
stamps the finished decision on the points as _litellm_openai_dialect so
the sync completion() path, whose hook params do not carry api_base,
honors it; maybe_inject_cache_control takes api_base from the
/v1/messages handler.

Eligibility now comes from a supports_prompt_cache_breakpoint model map
flag on the OpenAI gpt-5.6 entries, exposed through
litellm.utils.supports_prompt_cache_breakpoint, with the GPT version rule
kept only for models the map does not know. The OpenAI dialect no longer
reserves a slot for tool_config points, which OpenAI has no cache block
for, and with_prompt_cache_breakpoint plus the chat bridge helper return
a new block instead of mutating their input.
2026-08-20 05:17:13 -07:00
Mateo Wang
952c6d5675
Merge pull request #37517 from BerriAI/devin_ai_bedrock_grok_4_6_cost_map
feat: add bedrock grok 4.6 to model cost map
2026-08-20 03:03:44 -07:00
Mateo Wang
6fcdea03b0
Merge pull request #36969 from oneKn8/fix-cost-map-mid-conversation-flag
fix: add supports_mid_conversation_system to bare first-party Claude cost-map keys
2026-08-20 02:04:56 -07:00
Tin Chi Lo
42cffe93c8 Add moonshot/kimi-k3 to model prices and context window map
Pricing per https://platform.kimi.ai/docs/pricing/chat-k3:
- $3.00/M input (cache miss), $0.30/M cache read, $15.00/M output
- 1,048,576 context window; max_completion_tokens settable up to 1,048,576
- Supports reasoning (reasoning_effort low/high/max), tool calling,
  structured output, vision and video input

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 20:49:23 -07:00
Mateo Wang
a6163e0146
Merge pull request #37543 from BerriAI/litellm_lit_5785_vertex_regional_pricing
fix(vertex_ai): apply regional endpoint uplift to cost tracking
2026-08-19 17:56:34 -07:00
Mateo Wang
634e699555
Merge pull request #36331 from BerriAI/devin_ai_agentcore_search
feat(search): add Amazon Bedrock AgentCore web search provider
2026-08-19 15:59:17 -07:00
mateo-berri
a870d45a8a Merge branch 'litellm_internal_staging' of https://github.com/BerriAI/litellm into litellm_lit_5785_vertex_regional_pricing
# Conflicts:
#	litellm/model_prices_and_context_window_backup.json
#	model_prices_and_context_window.json
2026-08-19 15:31:42 -07:00
mateo-berri
b39a339b7d fix(vertex_ai): apply regional endpoint uplift to cost tracking 2026-08-19 15:21:06 -07:00
Mateo Wang
d58b1c8558
Merge pull request #37516 from BerriAI/litellm_gemini_prompt_cache_min_tokens_4096
fix(model_prices): set prompt_cache_min_tokens=4096 for Gemini 3.5/3.6/3.7 Flash and 3.1 Pro Preview
2026-08-19 15:11:00 -07:00
mateo-berri
45884b9bd3 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_gemini_prompt_cache_min_tokens_4096
# Conflicts:
#	litellm/model_prices_and_context_window_backup.json
#	model_prices_and_context_window.json
2026-08-19 14:55:44 -07:00
Mateo Wang
b8d5139701
Merge pull request #37473 from BerriAI/litellm_model_registry_audit_20260819
fix(model_prices): correct gemini 3.1 flash image and deepseek v4 pricing, add openai deprecation dates
2026-08-19 14:50:49 -07:00
Mateo Wang
f4b46c81da
Merge pull request #37283 from BerriAI/devin/1787058723-registry-deprecation-dates
fix(model_prices): add provider-announced deprecation_date to 205 registry entries
2026-08-19 14:43:45 -07:00
Devin AI
1f6bef79ca fix: drop source url from grok 4.6 cost map entries
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-19 21:24:29 +00:00
Devin AI
087cdcff07 feat: add bedrock grok 4.6 to model cost map
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-19 21:18:12 +00:00
mateo-berri
77716eeaed fix(model_prices): set prompt_cache_min_tokens=4096 for Gemini 3.5/3.6/3.7 Flash and 3.1 Pro Preview 2026-08-19 14:13:00 -07:00
Devin AI
5a0a8ffafe fix(model_prices): correct gemini and deepseek pricing and add deprecation dates
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-19 13:17:15 +00:00
mateo-berri
24fc3f721c fix(databricks): match the claude 4.6 context limits to Anthropic's published values 2026-08-18 17:55:45 -07:00
mateo-berri
4285ffd82b fix(databricks): drop the minimal reasoning effort flag from the claude-opus-4-6 entry 2026-08-18 17:09:17 -07:00
Mateo Wang
f570af9fcf
Merge branch 'litellm_internal_staging' into add-databricks-model-pricing 2026-08-18 16:55:02 -07:00
yassin
cf2e50077c Merge branch 'litellm_internal_staging' into devin_ai_agentcore_search
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-18 21:53:22 +00:00
mateo-berri
be594f5984 feat(guardrails): count bedrock guardrail cost against spend and budgets
Price ApplyGuardrail usage units recorded by PR #37225 with a new
bedrock/guardrails entry in the model cost map (regional override via
bedrock/{region}/guardrails), add the per-request guardrail_cost to the
standard logging payload's response_cost and CostBreakdown, surface it in
the x-litellm-response-cost header, and bill blocked requests through the
failure hook so key and team budgets see what AWS bills
2026-08-18 14:16:07 -07:00
KnyazSh
d7d2e440e0 Merge branch 'litellm_internal_staging' into feature/improve-gigachat-provider 2026-08-18 20:31:27 +00:00
Devin AI
3d523d6d81 fix(model_prices): add provider-announced deprecation_date to 205 registry entries
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-18 13:14:42 +00:00
mateo
94a29e0708 fix(gemini): price gemini 3.6 flash at Google's introductory rates on every service tier
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-17 18:42:57 +00:00
mubashir1osmani
539a61be08 feat(perplexity): add Agent API third-party models (DeepSeek V4 Flash, GLM 5.2, Kimi K3, Kimi K2.7 Code) 2026-08-16 14:45:22 -04:00
mubashir1osmani
ffa37d05b7 feat(mistral): add zai-glm-5-2 model pricing and metadata 2026-08-16 14:28:50 -04:00
Anmol Jaiswal
0059b497f4
fix(model_map): flag native structured outputs on Anthropic-direct claude-sonnet-5 and claude-haiku-4-5 (#35930)
* fix(model_map): flag native structured outputs on Anthropic-direct claude-sonnet-5 and claude-haiku-4-5

The Bedrock twins of both models already carry
supports_native_structured_output, but the Anthropic-direct entries do not,
so response_format requests to anthropic/claude-sonnet-5 and
anthropic/claude-haiku-4-5 fall back to the json_tool_call emulation and
inherit its nested-envelope failure modes (#8898) despite the API supporting
output_format natively.

Verified live against the Anthropic API on 2026-08-05: both models accept
output_format (structured outputs beta header) and return exact schema
instances, including a large nested production schema validated with
pydantic. Same two lines applied to the bundled backup map.

* fix(model_map): cover the versioned claude-haiku-4-5-20251001 alias

Exact-match capability lookup of anthropic/claude-haiku-4-5-20251001
resolved the versioned entry, which lacked the flag, so response_format
for that identifier still took the tool-emulation path. Flag it in both
the root and bundled maps, matching its unversioned alias.

* fix(anthropic): bound $defs inlining in output_format with the shared schema-bomb budget

map_response_format_to_anthropic_output_format called unpack_defs with
no max_inlined_bytes, so an authenticated caller could send a compact
schema whose repeated $refs expand without bound before reaching the
provider. Reuse the existing 10MB inlining budget (renamed from
_LEGACY_DEFS_MAX_INLINED_BYTES to DEFS_MAX_INLINED_BYTES now that two
call sites share it); overflow raises ValueError instead of
materialising the expansion.

Regression tests: a compact schema bomb is rejected, a normal $defs
schema still resolves; the bomb test fails when the bound is removed.

* chore: retrigger CI (benchmarks job flaked on a PyPI download timeout)

---------

Co-authored-by: Anmol Jaiswal <anmolg1997@users.noreply.github.com>
2026-08-15 11:51:35 -07:00
Mateo Wang
fb3459d78c
Merge pull request #36788 from BerriAI/litellm_model_map_deprecation_refresh
fix(model_prices): add gemini 3.1 flash tts preview and legacy OpenAI shutdown dates
2026-08-15 11:48:39 -07:00
Mateo Wang
87abb8781e
Merge pull request #36925 from BerriAI/litellm_model_registry_lifecycle_audit_20260814 2026-08-15 09:58:31 -07:00
mateo-berri
32917b07fc fix(model_prices): drop xai/grok-4.6-latest, xAI does not serve that alias
xAI's chat completions API answers grok-4.6-latest with "Model not found"
and its language-models listing shows no alias for grok-4.6
2026-08-15 01:37:23 -07:00
Devin AI
30b14597af fix(model_prices): revert unverified Gemini deprecation dates
Google's Gemini deprecations page lists no shutdown date for the 2.5 GA models and May 14, 2028 for gemini-embedding-001; keep only the DeepSeek V4 max output correction.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-15 08:35:58 +00:00
mateo-berri
16e6aa2e9f fix(model_prices): correct deprecation dates flagged in review
Revert gemini-embedding-001 to its published 2028-05-14 shutdown, move
gpt-4-turbo-preview to the 2026-03-26 shutdown of the gpt-4-0125-preview
snapshot it aliases, and drop the unannounced Gemini 2.5 shutdown dates
2026-08-15 01:33:01 -07:00
Mateo Wang
70d51a196f
Merge pull request #35286 from BerriAI/devin_ai_lit_5013_web_search_cost
fix(cost): track OpenAI/Azure web search tool cost per call
2026-08-14 18:16:59 -07:00
mateo-berri
7e539405ed fix(cost-tracking): price web search on dated search-preview map entries 2026-08-14 17:29:56 -07:00
Ilan Chemla
f99d0a4b38
feat(search): add Nimble as a search provider (#36347)
* feat(search): add Nimble as a search provider

Adds `NimbleSearchConfig` so `search_provider: nimble` works across the SDK,
the proxy /v1/search endpoint, the Search Tools dashboard, and spend tracking.

Nimble's /v2/search already uses the Perplexity unified spec's parameter names,
so the request transform is close to a pass-through. `search_domain_filter`
splits into include_domains/exclude_domains on the spec's `-` prefix, `country`
is upper-cased to the ISO form Nimble documents, and everything else is
forwarded so focus, search_depth, time_range and the rest stay reachable. On the
response side, snippet prefers `content` and falls back to `description`, and a
malformed body raises an attributed error rather than reporting an empty search.

Also tightens `BaseSearchConfig.get_supported_perplexity_optional_params` to
return `frozenset[str]` instead of a bare mutable `set`, which every caller
already treats as read-only.

* fix(search): surface Nimble error bodies instead of empty results

Greptile flagged that a null or absent `results` degraded to a successful empty
search. A search with no hits comes back as `"results": []`, verified against the
live API, so the field is now required and anything else raises the attributed
schema error the other malformed bodies already take.

Also unwraps Nimble's second error envelope. Collection failures return
`{"success", "task_id", "message"}` rather than the `{"detail"}` shape validation
errors use, and only the latter was being read.

Drops comments that restated the adjacent code.

* docs(search): drop the Nimble param list from the transform docstring

It restated the vendor's API reference, which the module docstring already links,
and would go stale the moment Nimble adds a focus mode.
2026-08-14 17:09:58 -07:00
mateo-berri
4193445647 Merge remote-tracking branch 'origin/litellm_internal_staging' into devin_ai_lit_5013_web_search_cost
# Conflicts:
#	litellm/model_prices_and_context_window_backup.json
#	model_prices_and_context_window.json
#	tests/test_litellm/litellm_core_utils/prompt_templates/test_bedrock_converse_strict_tools_opus_47_48.py
2026-08-14 17:05:08 -07:00
Shifat Islam Santo
4cd1c81a2d fix: add supports_mid_conversation_system to bare first-party Claude cost-map keys 2026-08-14 14:53:11 -05:00
Devin AI
b066ed3e31 fix(model_prices): correct Gemini 2.5 shutdown dates and DeepSeek V4 max output tokens
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-14 13:10:27 +00:00
bhuvan2134686
d499e68e55 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_scx_ai_provider
# Conflicts:
#	ui/litellm-dashboard/src/components/provider_info_helpers.tsx
2026-08-14 19:15:02 +10:00
Emerson Gomes
4ea5749642
feat(azure-ai): add Grok 4.3 model metadata (#27932)
* Add Azure AI Grok 4.3 metadata

* Address Azure Grok 4.3 test feedback

* Drop empty tool choice in responses bridge

* style(azure-ai): update Grok metadata tests
2026-08-13 17:25:17 -07:00
Emerson Gomes
b85f557f30
fix: enable xhigh reasoning support for gpt-5.4-mini models (#26909)
* fix: sync gpt-5.4 reasoning capability flags

* fix(models): keep GPT-5.4 service tiers consistent
2026-08-13 17:24:58 -07:00
Emerson Gomes
603fe93758
feat(azure_ai): add Fireworks FW model pricing on Azure AI Foundry (#35613)
* feat(azure_ai): add Fireworks FW model pricing on Azure AI Foundry

* fix(azure_ai): drop incorrect FW-Kimi-K2.6-Code alias

* test(azure-ai): assert FW max token metadata

* feat(azure_ai): add Inkling and Nemotron 3 Ultra pricing
2026-08-13 17:24:38 -07:00
Emerson Gomes
0e3f52a4c0
feat(model_prices): add gemini-3.1-flash-lite-image
Register Nano Banana 2 Lite on the unprefixed, gemini/, and vertex_ai/ keys
so completion_cost and pass-through spend tracking no longer treat the
model as unmapped
2026-08-13 19:18:22 -05:00
mateo
cbcc3715c6 Merge branch 'litellm_internal_staging' into litellm_add_muse_spark_1_2 2026-08-13 21:54:41 +00:00
mateo
6b8d6406e3 Merge origin/litellm_internal_staging, resolve grok-4.6 conflict
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-13 21:52:03 +00:00