Commit Graph

29524 Commits

Author SHA1 Message Date
ゆり 9ba27d85ce feat(types): add output_text property to ResponsesAPIResponse (#18491)
Add the output_text convenience property to ResponsesAPIResponse that
aggregates all output_text items from the output list, matching the
OpenAI SDK's Response.output_text behavior.

The property iterates through output items, collects text content from
message-type outputs, and returns them concatenated into a single
string. Returns empty string if no output_text content exists.

Handles both dict and Pydantic model access patterns for compatibility
with different output formats.

Fixes #18470

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

Co-authored-by: yurekami <yurekami@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 00:38:32 +05:30
ゆり dc62cdb300 fix: handle empty error objects in response conversion (#18493)
Some OpenAI-compatible providers (e.g., Apertis) return empty error
objects even on successful responses. The previous check only verified
that error was not None, causing spurious APIErrors.

Now the code checks if the error object contains meaningful data:
- For dict errors: non-empty message OR non-null code
- For string errors: non-empty string
- Other truthy values are still treated as errors

Fixes #18407

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

Co-authored-by: yurekami <yurekami@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 00:37:52 +05:30
Deepak Walia 3a4ebf173f fix(sap): honor allowed_openai_params in transform_request (#18432) 2026-01-04 00:35:53 +05:30
Mehmet Can Şakiroğlu a3503e59c2 Litellm feat helm lifecycle support (#18517)
* feat(helm): add lifecycle hook support for helm

* add tests
2026-01-04 00:22:50 +05:30
Krish Dholakia 969790c463 Iam roles anywhere docs (#18559)
* Add documentation for IAM Roles Anywhere

Co-authored-by: krrishdholakia <krrishdholakia@gmail.com>

* Refactor Bedrock provider docs for IAM Roles Anywhere

Co-authored-by: krrishdholakia <krrishdholakia@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-04 00:10:07 +05:30
Cesar Garcia bdd05475bc fix: correct cost calculation when reasoning_tokens present without text_tokens (#18607)
Fixes #18599

When OpenAI models (gpt-5-nano, o1-*, o3-*) and other providers return
reasoning_tokens in completion_tokens_details but don't provide text_tokens,
LiteLLM was incorrectly calculating costs using only reasoning_tokens,
ignoring the remaining completion tokens.

Changes:
- Modified generic_cost_per_token() in llm_cost_calc/utils.py to calculate
  text_tokens as: completion_tokens - reasoning_tokens - audio_tokens - image_tokens
  when text_tokens is not explicitly provided
- Added comprehensive test case test_reasoning_tokens_without_text_tokens_gpt5_nano()
  to verify all completion_tokens are billed correctly

Example:
- completion_tokens: 977
- reasoning_tokens: 768
- Before: only 768 tokens billed (21% less)
- After: all 977 tokens billed correctly

Affected models:
- OpenAI: gpt-5-nano, o1-*, o3-*
- Perplexity: sonar-reasoning*
- Any model returning reasoning_tokens without text_tokens
2026-01-04 00:09:00 +05:30
Krish Dholakia 87fe62229f feat: Add adopters page and data structure (#18605)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-03 21:51:19 +05:30
Krish Dholakia 0aae5153b6 docs: Clarify Bedrock AgentCore documentation (#18603)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-01-03 16:06:07 +05:30
yuneng-jiang 921f3167a0 Merge pull request #18602 from BerriAI/litellm_ui_useful_links_2
[Fix] UI - Useful Links Remove Modal on Adding Links
2026-01-02 19:31:01 -08:00
yuneng-jiang e6da33dc4a Remove modal in useful links 2026-01-02 19:22:56 -08:00
yuneng-jiang dacfe153ba Merge pull request #18601 from BerriAI/litellm_ui_test_coverage_xd
[Infra] UI - Adding Unit Tests to Increase Coverage
2026-01-02 18:56:45 -08:00
yuneng-jiang b7aac24653 Merge pull request #18600 from BerriAI/litellm_ui_sso_refactor
[Feature] UI - SSO Settings Page
2026-01-02 18:52:01 -08:00
yuneng-jiang f4c712506d Unit tests to increase test coverage 2026-01-02 18:49:01 -08:00
yuneng-jiang 470e4c26c3 Merge pull request #18593 from BerriAI/litellm_ui_sso_role_mapping
[Feature] UI - Allow Adding Role Mappings for SSO
2026-01-02 18:31:11 -08:00
yuneng-jiang 546fba9849 tests 2026-01-02 18:28:10 -08:00
yuneng-jiang f16fb63434 New SSO Settings Page 2026-01-02 18:22:37 -08:00
YutaSaito 61e666c457 Merge pull request #18597 from BerriAI/litellm_fix_openapi_to_mcp
fix openapi to mcp
2026-01-03 09:43:06 +09:00
Yuta Saito 8e633ab513 fix: reuse shared async client in mcp openapi generator 2026-01-03 09:33:12 +09:00
Yuta Saito 101fa6bdc6 refactor: extract http request helper for mcp openapi tools 2026-01-03 09:07:59 +09:00
Yuta Saito 6168e500a8 fix: add checking path param 2026-01-03 08:57:54 +09:00
Alexsander Hamir 2983b556d3 Lazy load 9 heavy imports in litellm/utils.py (#18595) 2026-01-02 14:54:09 -08:00
yuneng-jiang 0f0da07661 fixing build 2026-01-02 14:00:55 -08:00
yuneng-jiang 0a2e241651 Allow adding role mapping in UI 2026-01-02 13:57:28 -08:00
Alexsander Hamir 3b1792d728 feat: lazy load heavy imports to reduce memory usage at import time (#18592)
- Lazy load remove_index_from_tool_calls via __getattr__
- Lazy load _service_logger module via __getattr__ in __init__.py
- Lazy load audio_utils.utils with module-level caching in utils.py
- Remove direct imports that trigger heavy module loading

These changes reduce import-time memory usage by deferring imports
until they are actually needed, while maintaining performance through
caching for subsequent accesses.
2026-01-02 13:51:28 -08:00
kevinpauer 705b54bf04 Feat/add watsonx fields (#18569) 2026-01-03 02:53:17 +05:30
Alexsander Hamir 44d309f270 refactor: Add lazy loading for get_llm_provider (#18591) 2026-01-02 13:18:57 -08:00
Alexsander Hamir e2f3eaefab Add UnboundedDataStructurePattern to memory test detector (#18590) 2026-01-02 11:49:32 -08:00
Small 05a78fb0cf add dimensions for ollama embedding (#18536) 2026-01-03 00:58:27 +05:30
Alexsander Hamir b732710ed0 Add memory pattern detection test and fix bad memory patterns (#18589) 2026-01-02 10:52:25 -08:00
Harshit Jain cc659b8702 fix(logging_worker): handle event loop changes in multiprocessing by checking bound_loop (#18423) 2026-01-03 00:19:14 +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
Alex Gertz 3bd309f808 fix: return empty data array instead of 500 when no models configured (#18556)
- /v2/model/info now returns {"data": []} when llm_router is None or model_list is empty
- /model_group/info now returns {"data": []} when llm_model_list is None or empty
- Fixes UI crash on fresh installs with STORE_MODEL_IN_DB=True
- Added 4 unit tests for empty model list scenarios
2026-01-02 23:36:05 +05:30
Chetan Choudhary 687adc6024 Add log_format parameter to GenericAPILogger (#18587)
Adds log_format parameter supporting json_array (default), ndjson, and single formats. NDJSON format enables webhook integrations like Sumo Logic to parse individual log records at ingest time. Defaults to json_array for backward compatibility.
2026-01-02 23:28:30 +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 c380ad70d5 Merge pull request #18588 from BerriAI/litellm_fix_sameer_cicd
fix background cost tracking tests
2026-01-02 21:52:44 +05:30
Sameer Kankute 5ed83756eb Merge pull request #18583 from BerriAI/litellm_block_negative_budget
Add validation for negative budget
2026-01-02 21:52:15 +05:30
Sameer Kankute 233ba9d4b8 fix mock tests 2026-01-02 21:40:27 +05:30
Sameer Kankute ed59a9b376 fix background cost tracking tests 2026-01-02 21:12:25 +05:30
Sameer Kankute c8bb92afdc Merge pull request #18579 from BerriAI/litellm_remove_prompt_chaching_header
Remove prompt caching headers as the support has been removed
2026-01-02 21:01:50 +05:30
Sameer Kankute 973f850cf3 Merge pull request #18581 from BerriAI/litellm_gemini_non_tool_call_thought_sign
Add thought signature for non tool call requests
2026-01-02 21:01:07 +05:30
Sameer Kankute 7512b327d4 Merge pull request #18585 from BerriAI/litellm_gemini_system_instructions
Preserve system instructions for gemini
2026-01-02 20:59:44 +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 05e37e0600 fix ruff check 2026-01-02 20:55:35 +05:30
Sameer Kankute 0543ab5e77 Update the logic to work with GET request 2026-01-02 20:49:12 +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 bfbe13bbd4 Merge pull request #18190 from RensDimmendaal/add-gemini-img-tool-result-support
Fix Gemini 3 imgs in tool response
2026-01-02 17:06:51 +05:30
Sameer Kankute ec1403ada0 Merge pull request #18496 from Chesars/feat/add-minimax-provider-ui
feat: Add MiniMax provider support to UI dashboard
2026-01-02 16:53:24 +05:30
Sameer Kankute ccdbe921e1 Merge pull request #18514 from xuan07t2/fix/vertex-ai-tools-one-type-per-object
fix(vertex_ai): separate Tool objects for each tool type per API spec
2026-01-02 16:21:17 +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
Sameer Kankute 9aa280fde9 Add all sizes and resolution for gpt-image-1.5 to model map 2026-01-02 15:40:13 +05:30