Commit graph

5051 commits

Author SHA1 Message Date
Alexsander Hamir
a5fed1d67f feat: Add lazy loading for get_llm_provider to reduce import time
- Add get_llm_provider to lazy import registry system
- Remove eager import from __init__.py
- Fix circular import by updating internal modules to import directly from source:
  - realtime_api/main.py
  - router_utils/pattern_match_deployments.py
- Add type stub for get_llm_provider in TYPE_CHECKING block
- Add tests for lazy loading of LLM provider logic functions

This reduces initial import time and memory usage by deferring the import
of get_llm_provider until it's actually accessed.
2026-01-02 12:55:08 -08:00
Alexsander Hamir
e2f3eaefab
Add UnboundedDataStructurePattern to memory test detector (#18590) 2026-01-02 11:49:32 -08:00
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
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
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
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
65e60a16d3
Merge pull request #18497 from DevajMody/fix/vertex-ai-anthropic-image-urls
fix(vertex_ai): convert image URLs to base64 for Vertex AI Anthropic
2026-01-02 14:50:04 +05:30
Sameer Kankute
81cbd7a8d8 Preserve system instructions for gemini 2026-01-02 14:39:25 +05:30
YutaSaito
e9365c496d
Merge pull request #18580 from BerriAI/litellm_feat_support_metaurl_on_ui
feat: add UI support for configuring meta URLs
2026-01-02 17:54:26 +09:00
Yuta Saito
7107da2fb7 fix: test mock 2026-01-02 17:38:52 +09:00
YutaSaito
4b131a77a0
Merge pull request #18573 from BerriAI/litellm_fix_normalize-model-name
fix: unify model names to provider-defined names
2026-01-02 17:37:28 +09:00
Lukas de Boer
edc8413f1e
Add Kubernetes ServiceAccount JWT authentication support (#18055)
* Allow get_nested_value dot notation to support escaping for Kubernetes JWT Support

* Add support for team and org alias fields, add docs, tests

* Fix lint issue with max statements in handle jwt logic
2026-01-02 14:02:31 +05:30
Yuta Saito
0e01d225ff fix: test_edit_mcp_server_redacts_credentials error 2026-01-02 17:13:31 +09:00
Yuta Saito
89ce8091bb fix: test 2026-01-02 16:32:33 +09:00
Sameer Kankute
57c373c5d8 Add validation for negative budget 2026-01-02 12:57:39 +05:30
Sameer Kankute
dd96f91254 Add thought signature for non tool call requests 2026-01-02 12:31:31 +05:30
Yuta Saito
3ae38c2a6d fix: test_langfuse_logging_completion_with_bedrock_llm_response 2026-01-02 15:55:02 +09:00
Yuta Saito
35f9a75d55 feat: add UI support for configuring meta URLs 2026-01-02 15:07:37 +09:00
Sameer Kankute
ca94990307 remove prompt caching headers as the support has been removed 2026-01-02 11:08:35 +05:30
Sameer Kankute
7ba14a30ed
Merge pull request #18500 from systec-dk/fix_anthropic
fix authentication errors at messages API via azure_ai
2026-01-02 09:22:12 +05:30
Yuta Saito
f7241a7905 fix: unify model names to provider-defined names 2026-01-02 08:36:58 +09:00
Alexsander Hamir
d2f2fe1be5
[Fix] CI/CD - litellm_mapped_tests_proxy (#18572) 2026-01-01 15:27:51 -08:00
Alexsander Hamir
3f6312c0ef
[Fix] CI/CD - litellm_mapped_tests_llms (#18563) 2026-01-01 11:46:32 -08:00
Alexsander Hamir
a7da4833da
[Fix] CI/CD - check_code_and_doc_quality (#18560) 2026-01-01 11:18:59 -08:00
yuneng-jiang
9be2173d5b
Merge pull request #18557 from BerriAI/litellm_deactivate_other_ui_token
[Feature] Expire Previous UI Session Tokens on Login
2026-01-01 09:11:17 -08:00
yuneng-jiang
269bc5b26b Expire Previous UI Session Tokens 2025-12-31 19:26:59 -08:00
YutaSaito
faf58dc351
Merge pull request #18553 from BerriAI/litellm_fix_ends_parent_span_in_otel
fix: prevent LiteLLM from closing external OTEL spans
2026-01-01 11:49:12 +09:00
Yuta Saito
b343d15157 fix: prevent LiteLLM from closing external OTEL spans 2026-01-01 08:28:48 +09:00
xuan07t2
f3f1acd338 fix(vertex_ai): separate Tool objects for each tool type per API spec
Fix Vertex AI API error: "tools[0].tool_type: one_of 'tool_type' has more
than one initialized field"

The Vertex AI API requires each Tool object to contain exactly one type
of tool (e.g., FunctionDeclaration, GoogleSearch, CodeExecution).
Previously, all tool types were combined into a single Tool object,
causing INVALID_ARGUMENT errors when using multiple tools simultaneously.

This change creates separate Tool objects for each tool type:
- Function declarations in one Tool
- Google Search in its own Tool
- Code Execution in its own Tool
- etc.

Ref: https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1beta1/Tool

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 08:48:35 +07:00
YutaSaito
cc8e310736
Merge pull request #18530 from BerriAI/litellm_refactor_mcp_health_check
feat: optimize MCP server listing by separating health checks
2025-12-31 08:03:12 +09:00
Yuta Saito
7fdea85b5c feat: optimize MCP server listing by separating health checks 2025-12-31 06:55:47 +09:00
yuneng-jiang
ff4e16b306
Merge pull request #18502 from BerriAI/litellm_key_list_user_object
[Feature] Add Optional Query Param "expand" to /key/list
2025-12-29 15:02:38 -08:00
YutaSaito
b9e8b38cd3
Merge branch 'main' into fix/mcp-rest-auth-ssrf 2025-12-30 07:22:01 +09:00
yuneng-jiang
de551889f3 Add optional field expand to /key/list 2025-12-29 14:20:04 -08:00
Daniel Krueger
d7468dab7e fix authentication errors at messages API via azure_ai
Use x-api-key instead of api-key.
This has been removed by commit 61e737e361 for unknown reason.
2025-12-29 15:29:54 +01:00
YutaSaito
a569369195
Merge pull request #18443 from BerriAI/litellm_fix_health_status
fix health status
2025-12-29 14:16:38 +09:00
Devaj
e4c9b0bea2 fix(vertex_ai): convert image URLs to base64 for Vertex AI Anthropic
Fixes #18430

  - Pass custom_llm_provider to anthropic_messages_pt instead of hardcoded 'anthropic'
  - Add check for vertex_ai provider to force base64 conversion for image URLs
  - Add tests to verify behavior for both Vertex AI and regular Anthropic
2025-12-29 09:55:41 +05:30
Yuta Saito
6888d34ea5 feat: Log actual executed event type in guardrail logging 2025-12-27 07:20:24 +09:00
Yuta Saito
c25ceb5596 refactor: MCP health check 2025-12-26 16:55:51 +09:00
YutaSaito
78b5d40664
Merge pull request #18418 from BerriAI/litellm_fix_datadog-llm-observability-intermittent-failure
fix: Datadog span kind fallback when parent_id missing
2025-12-26 10:05:08 +09:00