Commit graph

1205 commits

Author SHA1 Message Date
Sameer Kankute
c5a8d4e34e
Merge branch 'main' into litellm_staging_01_16_2026 2026-01-19 18:11:21 +05:30
Ostap Bodnar
ce1a2c3209
add openai/dall-e base pricing entries (#19133) 2026-01-17 04:48:46 +05:30
YutaSaito
7aba0f738a
Revert "Litellm staging 01 15 2026" 2026-01-17 06:31:34 +09:00
Ishaan Jaffer
b86aae0212 fix stability mode 2026-01-16 09:08:11 -08:00
Sameer Kankute
48d1e769a8 Add azure/gpt-5.2-codex 2026-01-16 18:37:05 +05:30
Sameer Kankute
5782832b82
Merge pull request #19199 from BerriAI/litellm_fix_stability_issues1
[Fix] Bedrock stability model usage issues
2026-01-16 18:17:11 +05:30
Sameer Kankute
c76b527281 Fix model map 2026-01-16 17:17:21 +05:30
Sameer Kankute
f3ca05112e
Merge pull request #19206 from BerriAI/main
merge main
2026-01-16 15:22:16 +05:30
Sameer Kankute
4d45574fc5 fix Updated all 27 occurrences of mode: image_edit to mode: image_edits 2026-01-16 14:47:06 +05:30
Emerson Gomes
e8fa8c5fa1
fix gcp glm-4.7 pricing (#19172) 2026-01-15 18:35:40 -08:00
拐爷&&老拐瘦
92827ead65
Add pricing for volcengine models (deepseek-v3-2, glm-4-7, kimi-k2-thinking) (#19076)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 03:30:34 +05:30
Peter Dave Hello
62eee47618
Add support for OpenAI's gpt-5.2-codex (#19101)
Reference:
- https://openai.com/index/introducing-gpt-5-2-codex/
- https://platform.openai.com/docs/models/gpt-5.2-codex
2026-01-14 11:49:40 -08:00
Emerson Gomes
9f6fa4fb49
Fix Azure Grok prices (#19102) 2026-01-15 00:30:47 +05:30
Cesar Garcia
e0da7ca918
fix(models): correct max_input_tokens for GPT-5 models (#19056)
OpenAI's 400k context window is split between input and output:
- GPT-5/5.1/5.2 models: 272k input + 128k output = 400k context
- GPT-5-pro models: 128k input + 272k output = 400k context

Reference: https://openai.com/index/introducing-gpt-5-for-developers/
"In the API, all GPT-5 models can accept a maximum of 272,000 input
tokens and emit a maximum of 128,000 reasoning & output tokens"

Fixes incorrect 400k max_input_tokens values across 32 models.
2026-01-14 19:01:23 +05:30
Cesar Garcia
2b79d37e39
feat: Add Cerebras zai-glm-4.7 model support and deprecate zai-glm-4.6 (#18864)
- Add cerebras/zai-glm-4.7 with same specs as 4.6 (128K context, $2.25/M input, $2.75/M output)
- Mark cerebras/zai-glm-4.6 with deprecation_date: 2026-01-20
- Both models support function calling, reasoning, and tool choice
2026-01-13 19:45:02 -08:00
Cesar Garcia
a445d8a4b4
fix(pricing): correct cache_read pricing for gemini-2.5-pro models (#18157)
- Fix cache_read_input_token_cost: 3.125e-07 → 1.25e-07 ($0.125/1M)
- Add cache_read_input_token_cost_above_200k_tokens: 2.5e-07 ($0.25/1M)

Models updated:
- gemini-2.5-pro
- gemini-2.5-pro-exp-03-25
- gemini-2.5-pro-preview-03-25
- gemini-2.5-pro-preview-05-06
- gemini-2.5-pro-preview-06-05
- gemini-2.5-pro-preview-tts
- gemini/gemini-2.5-pro
- gemini/gemini-2.5-pro-preview-03-25
- gemini/gemini-2.5-pro-preview-05-06
- gemini/gemini-2.5-pro-preview-06-05
- gemini/gemini-2.5-pro-preview-tts

Pricing source: https://ai.google.dev/gemini-api/docs/pricing
2026-01-14 04:09:24 +05:30
nulone
478bdcb60b
fix(model_prices): sync DeepSeek chat/reasoner to V3.2 pricing (#18884) 2026-01-14 03:52:50 +05:30
Cesar Garcia
d03c5017ff
fix: correct context window sizes for GPT-5 model variants (#18928)
* fix: correct context window sizes for GPT-5 model variants

Updates max_input_tokens for GPT-5, GPT-5.1, and GPT-5.2 model variants
to match OpenAI's official specifications, resolving issue #18927.

Changes:
- GPT-5.1 (base, codex variants): 272k → 400k tokens
- GPT-5.1-chat variants: 272k → 128k tokens (with max_output 16,384)
- GPT-5 (base): 272k → 400k tokens
- GPT-5-chat: 272k → 128k tokens (with max_output 16,384)
- GPT-5-codex: 272k → 400k tokens
- GPT-5-mini: 272k → 400k tokens
- GPT-5-nano: 272k → 400k tokens
- GPT-5-pro: 272k → 400k tokens (max_output 272k)
- GPT-5 dated versions (2025-08-07): 272k → 400k tokens

Affected providers: OpenAI, Azure (all regions), OpenRouter

Fixes #18927

* fix: correct Azure GPT-5 context window limits to match Azure docs

Azure OpenAI has different limits than OpenAI for GPT-5 models.

Changes:
- Azure GPT-5 models: max_input_tokens 400k → 272k (Azure limit)
- Azure GPT-5 Pro: max_output_tokens 272k → 128k (Azure limit)
- OpenAI GPT-5 models: remain at 400k (correct)
- OpenRouter models: remain at 400k (routes to OpenAI)

Azure docs specify 272k input + 128k output = 400k total context.
OpenAI allows full 400k input + 128k output.

* fix: correct Azure GPT-5 max_input_tokens to 272k

Azure has explicit input limit of 272k tokens (not 400k like OpenAI).
Context window 400k = 272k input + 128k output for Azure.
OpenAI allows flexible input up to 400k (context - output).
2026-01-14 03:49:47 +05:30
Robin
b7c5662273
Fix: update novita models prices (#19005)
* feat: ci

* feat: fix novita models prices
2026-01-14 03:30:19 +05:30
Sameer Kankute
5a51b74658 Add pricing of azure_ai/claude-opus-4-5 2026-01-13 09:15:05 +05:30
Sameer Kankute
9a27a52424
Merge pull request #18956 from BerriAI/litellm_staging_01_12_2026
Litellm staging 01 12 2026
2026-01-12 18:27:57 +05:30
Sameer Kankute
ebf61998e0
Merge pull request #18954 from BerriAI/litellm_replicate_support
[Feat] Add all chat replicate models support
2026-01-12 18:15:46 +05:30
Cesar Garcia
932f06104d
fix: include IMAGE token count in cost calculation for Gemini models (#18876)
* fix: include IMAGE token count as separate usage count and pricing

* fix: remove duplicate TypedDict key and variable definitions

- Remove duplicate input_cost_per_image_token in ModelInfoBase TypedDict
- Remove duplicate image_tokens variable declaration in _calculate_usage()

Fixes MyPy errors:
- types/utils.py:146: Duplicate TypedDict key
- vertex_and_google_ai_studio_gemini.py:1541: Name already defined

---------

Co-authored-by: Thomas Rehn <271119+tremlin@users.noreply.github.com>
2026-01-12 17:03:42 +05:30
Sameer Kankute
3d38ec4756 Add all replicate models in model cost map 2026-01-12 15:19:49 +05:30
Sameer Kankute
7e3760b740
Merge pull request #18899 from Chesars/claude/check-gpt-oss-pricing-4wKrq
fix: correct pricing for openrouter/openai/gpt-oss-20b
2026-01-12 09:09:20 +05:30
Chesars
0bc04ce129
fix: correct pricing for openrouter/openai/gpt-oss-20b
Updated pricing from incorrect values to match OpenRouter's official rates:
- Input: $0.18/M → $0.02/M tokens (1.8e-07 → 2e-08)
- Output: $0.80/M → $0.10/M tokens (8e-07 → 1e-07)
2026-01-10 19:39:04 +00:00
Robin
0575bd2d1c
feat: update prices json for novita provider (#18540)
* feat: add novita models

* feat: ci

* feat: add novita support josn
2026-01-10 00:48:06 +05:30
Cesar Garcia
c19c97591e
fix: align max_tokens with max_output_tokens for consistency (#18820)
* fix: align max_tokens with max_output_tokens for consistency

Fixed inconsistent max_tokens definitions in model_prices_and_context_window.json.
According to LiteLLM convention, max_tokens should equal max_output_tokens when available.

Models fixed:
- deepseek-chat: 131072 → 8192 (now equals max_output_tokens)
- dashscope/qwen-flash: 1000000 → 32768 (now equals max_output_tokens)
- databricks/databricks-gemma-3-12b: 128000 → 32000 (now equals max_output_tokens)

This ensures consistency across all providers where max_tokens represents
the maximum number of tokens that can be generated in the output.

* fix: align max_tokens with max_output_tokens for 244 models

- Fix 244 models where max_tokens != max_output_tokens
- Add test to validate max_tokens consistency and prevent regressions

According to model_prices_and_context_window.json spec:
- max_tokens is a LEGACY parameter
- Should always equal max_output_tokens when both are present

This ensures consistency across all model definitions.
2026-01-10 00:37:45 +05:30
Cesar Garcia
86b71d4713
fix(workflow): Update issue labeling with working regex pattern (#18821)
* fix: align max_tokens with max_output_tokens for consistency

Fixed inconsistent max_tokens definitions in model_prices_and_context_window.json.
According to LiteLLM convention, max_tokens should equal max_output_tokens when available.

Models fixed:
- deepseek-chat: 131072 → 8192 (now equals max_output_tokens)
- dashscope/qwen-flash: 1000000 → 32768 (now equals max_output_tokens)
- databricks/databricks-gemma-3-12b: 128000 → 32000 (now equals max_output_tokens)

This ensures consistency across all providers where max_tokens represents
the maximum number of tokens that can be generated in the output.

* fix(workflow): Update issue labeling with working regex pattern

- Replace contains() with regex pattern using \s* for flexible whitespace matching
- Consolidate 4 separate steps into single unified component labeling step
- Tested and verified pattern works for all components: SDK, Proxy, UI Dashboard, Docs
- Pattern handles GitHub's issue body formatting with ### headers and variable newlines
2026-01-08 23:48:41 +05:30
Emerson Gomes
6c00f6f342
Add support to zai glm-4.7 model in Vertex (#18782)
* Add support to zai glm-4.7 model in Vertex

* Avoid failed on missing 'created' streaming chunk key
2026-01-08 13:20:02 +05:30
Ishaan Jaff
3430325919
[Feat] Add Azure BFL - Flux 2 models (#18764)
* add azure_ai/flux.2-pro

* get_flux2_image_generation_url

* azure_client_params

* docs
2026-01-07 23:28:28 +05:30
Lundin Matthews
762345172c
Add LlamaGate as a new provider (#18673)
Adds LlamaGate (https://llamagate.dev) as an OpenAI-compatible provider with:
- Provider configuration in providers.json
- Documentation page with usage examples
- Model pricing for 17 models across categories:
  - General purpose (Llama 3.1/3.2, Mistral, Qwen, Dolphin)
  - Reasoning (DeepSeek R1, OpenThinker)
  - Code (Qwen Coder, DeepSeek Coder, CodeLlama)
  - Vision (Qwen VL, LLaVA, Gemma 3)
  - Embeddings (Nomic, Qwen3 Embedding)

Provider details:
- Base URL: https://api.llamagate.dev/v1
- Auth: Bearer token via LLAMAGATE_API_KEY
- Pricing: $0.02-$0.55 per 1M tokens
- All models are open-weights
2026-01-07 00:00:30 +05:30
Isaac Reis
a17757159c
add amazon.nova-2-multimodal-embeddings-v1:0 to model_prices_and_context_window.json (#18710) 2026-01-06 23:57:35 +05:30
Sameer Kankute
0cd92e895f fix model map 2026-01-06 18:14:00 +05:30
Sameer Kankute
ffc462465d fix: remove display name 2026-01-06 16:31:07 +05:30
Sameer Kankute
2baec27657
Revert "feat(model_cost): add display_name, model_vendor, and model_version metadata to model entries" 2026-01-06 15:29:42 +05:30
Sameer Kankute
9c795a2baa fix: test_all_models_have_display_name 2026-01-06 14:09:43 +05:30
Sameer Kankute
a087df365e fix: test_aaamodel_prices_and_context_window_json_is_valid 2026-01-06 14:04:09 +05:30
Sameer Kankute
694e44551f
Merge pull request #17330 from nmgarza5/add-model-metadata
feat(model_cost): add display_name, model_vendor, and model_version metadata to model entries
2026-01-06 10:56:49 +05:30
0717376
12f02f6c54
feat: Add GigaChat provider support (#18564)
* feat: Add GigaChat provider support

Add native support for GigaChat API (Sber AI, Russia's leading LLM).

Supported features:
- Chat completions (sync/async)
- Streaming (sync/async)
- Function calling / Tools
- Structured output via JSON schema (emulated through function calls)
- Image input (base64 and URL)
- Embeddings

Closes #18515

* fix: resolve mypy type errors in GigaChat handler

- Fix _prepare_file_data return type (use 3-tuple for cleaner type flow)
- Add type annotations for lists in _process_content_parts methods
- Add type annotations in _collapse_user_messages
- Use ChatCompletionToolCallChunk for proper tool_use typing
- Add type: ignore[override] for astreaming async generator

* refactor(gigachat): migrate to BaseConfig pattern

* fix: remove unused imports

* fix: resolve mypy type errors

* fix: mypy type errors

* refactor: address review feedback for GigaChat provider

- Remove singleton pattern, reuse litellm HTTPHandler
- Move constants/errors to transformation files, delete common_utils.py
- Add models to model_prices_and_context_window.json
- Fix ssl_verify not passed to HTTP client for embeddings

* docs: update GigaChat documentation with ssl_verify requirement
2026-01-06 10:10:02 +05:30
Nik
13db8e10dc feat: add display_name, model_vendor, and model_version metadata 2026-01-05 11:01:36 -08:00
Matt Greathouse
b24156079f
Add gemini-3-flash on openrouter (#18247) 2026-01-05 16:37:23 +05:30
cantalupo555
9b1c5f7e36
feat(zai): Add GLM-4.7 model with reasoning support (#18476)
Add support for Z.AI GLM-4.7, latest flagship model with enhanced reasoning capabilities.

Changes:
- Add zai/glm-4.7 to model pricing with /bin/bash.60/M input, .20/M output
- Add cached input pricing (/bin/bash.11/M) for GLM-4.7
- Add supports_reasoning flag to enable thinking parameter
- Update ZAIChatConfig to support thinking parameter for models with reasoning
- Update documentation with GLM-4.7 as latest flagship model
- Add cached input column to pricing table (GLM-4.7 only)
- Add tests for GLM-4.7 reasoning support and cost calculation
- Update all examples to use GLM-4.7

Model specifications:
- Context: 200K input, 128K output
- Supports: reasoning, function calling, tool choice, prompt caching
- Pricing: Same as GLM-4.6 with cache support

See: https://docs.z.ai/guides/llm/glm-4.7
2026-01-04 00:44:19 +05:30
Daniel Yudelevich
af27c7d7ff
fix: add deprecation_date for discontinued Google models (#18550)
Add deprecation dates for Google models that have been discontinued
per https://ai.google.dev/gemini-api/docs/changelog:

- Gemini 1.5 Flash/Pro models: 2025-09-29
- imagen-3.0-generate-002: 2025-11-10
- veo-3.0 preview models: 2025-11-12
- gemini-2.0-flash image generation: 2025-11-14
- gemini-2.5-flash preview models: 2025-11-18
- gemini-2.0-flash-thinking-exp, pro previews: 2025-12-02
- gemini-2.0-flash-live-001: 2025-12-09
- text-embedding-004: 2026-01-14
- gemini-2.5-flash-image-preview: 2026-01-15

Co-authored-by: Daniel Yudelevich <yudelevi@users.noreply.github.com>
2026-01-03 00:12:58 +05:30
Cesar Garcia
c8950a5ba2
fix(cost_calculator): correct gpt-image-1 cost calculation using token-based pricing (#17906)
* fix(cost_calculator): correct gpt-image-1 cost calculation using token-based pricing (#13847)

gpt-image-1 uses token-based pricing (like chat models), not pixel-based pricing
like DALL-E. The old code was calculating incorrect costs by treating it as DALL-E.

Changes:
- Update model pricing JSON with correct token-based costs for gpt-image-1
- Add dedicated cost calculator for OpenAI gpt-image models
- Route gpt-image-1 to token-based calculator in cost router
- Add comprehensive tests for the new calculator

* refactor: simplify gpt-image-1 cost calculator using responses API helper

Reuse _transform_response_api_usage_to_chat_usage and generic_cost_per_token
for gpt-image-1 cost calculation since ImageUsage has the same spec as
ResponseAPIUsage.
2026-01-02 23:08:52 +05:30
Sameer Kankute
ecbc678771
Merge pull request #18586 from BerriAI/litellm_fix_image_cost_track
Add all resolution for gpt-image-1.5
2026-01-02 20:58:59 +05:30
Sameer Kankute
bbb883ffa9
Merge pull request #18483 from yurekami/fix/deepseek-v3p2-pricing
fix: correct deepseek-v3p2 pricing for Fireworks AI
2026-01-02 17:09:12 +05:30
Sameer Kankute
6e91364004 Add all sizes and resolution for gpt-image-1.5 to model map 2026-01-02 15:40:52 +05:30
Alexsander Hamir
825c12149f
[Fix] CI/CD - litellm_utils_testing (#18565) 2026-01-01 12:48:49 -08:00
yurekami
f5024624d7 fix: correct deepseek-v3p2 pricing for Fireworks AI
Updated pricing for fireworks_ai/accounts/fireworks/models/deepseek-v3p2:
- input_cost_per_token: 1.2e-06 -> 5.6e-07 ($0.56/1M tokens)
- output_cost_per_token: 1.2e-06 -> 1.68e-06 ($1.68/1M tokens)

Pricing verified from https://fireworks.ai/models/fireworks/deepseek-v3p2

Fixes #17998

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 03:44:03 +09:00