Commit graph

25841 commits

Author SHA1 Message Date
Ishaan Jaff
69a464fc97
[Fix Security] Ensure OCI secret fields not shared on /models and /v1/models endpoints (#15085)
* fix: remove_sensitive_info_from_deployment

* fix: remove_sensitive_info_from_deployment

* test_model_info_v1_oci_secrets_not_leaked
2025-09-30 14:55:54 -07:00
Ishaan Jaffer
75d22d3d79 fix code qa check 2025-09-30 14:03:05 -07:00
Copilot
71b9b58fa9
[Feature]: Replace HTTPException with ParallelRequestLimitError in parallel_request_limiter_v3 (#15033)
* Initial plan

* Implement ParallelRequestLimitError custom exception to replace HTTPException

Co-authored-by: ishaan-jaff <29436595+ishaan-jaff@users.noreply.github.com>

* Add ParallelRequestLimitError to litellm main module exports

Co-authored-by: ishaan-jaff <29436595+ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ishaan-jaff <29436595+ishaan-jaff@users.noreply.github.com>
2025-09-30 13:57:14 -07:00
Alexsander Hamir
05dd104ce6
perf(router): Cache nested dict lookups in hot path (#15084)
Cache deployment["litellm_params"] and deployment["model_info"]
at loop start to avoid repeated dict hash lookups.

- _pre_call_checks: 3 fewer lookups per deployment per request
- deployment_callback_on_failure: 1 fewer lookup per failure
- _set_model_group_info: 4 fewer lookups per model

Saves CPU cycles on every routing decision and failure callback.
2025-09-30 13:36:42 -07:00
Alexsander Hamir
927e15996e
perf(router): Remove unnecessary hasattr checks in get_model_list() (#15082)
Remove redundant hasattr() checks for model_list and model_group_alias
in get_model_list() method. Both attributes are always initialized in
__init__, making these runtime checks unnecessary overhead.

Changes:
- Remove hasattr(self, "model_list") check
- Remove hasattr(self, "model_group_alias") check
- Move model_group_alias initialization earlier in __init__ to ensure
  it's available when set_model_list() calls get_model_names()
- Simplify control flow by removing nested conditional blocks

Performance Impact:
- hasattr should not appear in the profile of a proxy server handling thousands of requests. This change ensures it no longer does.
2025-09-30 13:35:27 -07:00
Ishaan Jaff
60230e5666
[Feat] UI - add snowflake on UI (#15083)
* UI - add snowflake on UI

* fixes snowflake creds
2025-09-30 13:16:04 -07:00
Ishaan Jaff
862736e74b
feat: add groq/moonshotai/kimi-k2-instruct-0905 (#15079) 2025-09-30 12:51:21 -07:00
Krish Dholakia
39d1d2a379
Merge pull request #14840 from eddierichter-amd/lemonade-integration
Add AMD Lemonade provider support
2025-09-30 12:34:30 -07:00
Ishaan Jaffer
45bfd2599c docs fix 2025-09-30 11:35:15 -07:00
Eddie Richter
7da05df534 Removing unecessary import 2025-09-30 12:12:24 -06:00
Eddie Richter
19e7070b73 Removing get_model_info from Lemonade provider. Implemented get_models which gets hooked into get_valid_models litellm utility. Also, added a simple cost calculator implementation for Lemonade so calling cost_calculator.completion_cost() doesn't return an error when a model is not found in the model_cost json. 2025-09-30 12:12:24 -06:00
Eddie Richter
1e1e4c36ac Fixing key name 2025-09-30 12:12:24 -06:00
Eddie Richter
bbfa00c61b fixing mypy lint errors 2025-09-30 12:12:24 -06:00
Eddie Richter
3d62596daa fix lint-ruff 2025-09-30 12:12:24 -06:00
Eddie Richter
abaf77da43 Small updates to documentation 2025-09-30 12:12:24 -06:00
Eddie Richter
929510ef5d Adding unit tests and documentation 2025-09-30 12:12:24 -06:00
Eddie Richter
6916f43843 Adding functionality for Lemonade to check to see if it is aware of a model and if so use that model 2025-09-30 12:12:24 -06:00
Eddie Richter
351b63bc67 Adding max_tokens to constructor of LemonadeChatConfig 2025-09-30 12:12:24 -06:00
Eddie Richter
f9e98f75a6 Adding max_input_tokens and max_output_tokens 2025-09-30 12:12:24 -06:00
Eddie Richter
0e045e0bb7 Setting the response model so the cost can be calculated 2025-09-30 12:12:24 -06:00
Eddie Richter
eb71611a97 Adding lemonade transform 2025-09-30 12:12:24 -06:00
Eddie Richter
ae92404d05 Initial addition of Lemonade provider. 2025-09-30 12:12:24 -06:00
Krish Dholakia
fd1a986596
Merge pull request #15013 from serializer/patch-1
[bug]: Update request handling for original exceptions
2025-09-29 21:59:26 -07:00
Krish Dholakia
79d071c25c
Merge pull request #15022 from BerriAI/litellm_gemini_tool_search
Ignore type param for gemini tools
2025-09-29 21:57:50 -07:00
Krish Dholakia
db62e33a4f
Merge pull request #15025 from Isydmr/main
fix: use extra_query for download results (Batch API)
2025-09-29 21:57:15 -07:00
Krish Dholakia
551a171243
Merge pull request #15043 from cedarm/fix-remove-vertex-latest
fix: remove invalid vertex -latest models
2025-09-29 21:54:53 -07:00
Krish Dholakia
9a44fcdc32
Merge pull request #15050 from uc4w6c/fix/regression-mcp-protocol-version
fix: resolve regression with duplicate Mcp-Protocol-Version header
2025-09-29 21:53:00 -07:00
Krish Dholakia
56fccee731
Merge pull request #15058 from uc4w6c/doc/add_api_key_to_bedrock
doc: add missing api_key parameter
2025-09-29 21:52:31 -07:00
Yuta Saito
def4afedd7 doc: add missing api_key parameter 2025-09-30 12:52:17 +09:00
Ishaan Jaff
708c0bd78d
[Feat] Return Cost for Responses API Streaming requests (#15053)
* test_basic_openai_responses_api_streaming

* _transform_chat_completion_usage_to_responses_usage

* ResponseAPIUsage.cost

* test fixes for anthropic cost with /responses

* fix mypy typng
2025-09-29 19:47:04 -07:00
Ishaan Jaffer
3e474b9e81 fix claude-sonnet-4-5 model cost map 2025-09-29 18:26:29 -07:00
Ishaan Jaffer
f1578b49e2 vertex_httpx_mock_post 2025-09-29 18:25:54 -07:00
Copilot
f22fd4cddd
Fix: Add /v1/messages/count_tokens to Anthropic routes for non-admin user access (#15034)
* Initial plan

* Fix: Add /v1/messages/count_tokens to Anthropic routes for user access

Co-authored-by: ishaan-jaff <29436595+ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ishaan-jaff <29436595+ishaan-jaff@users.noreply.github.com>
2025-09-29 18:16:52 -07:00
Ishaan Jaff
ebf72f5eb9
[Fix] Parallel Request Limiter v3 - use well known redis cluster hashing algorithm (#15052)
* test_keyslot_for_redis_cluster

* fix _is_redis_cluster

* Update litellm/proxy/hooks/parallel_request_limiter_v3.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-29 18:12:44 -07:00
Ishaan Jaff
f6d7683261
[Feat] LiteLLM Overhead metric tracking - Add support for tracking litellm overhead on cache hits (#15045)
* test_litellm_overhead

* vertex track overhead

* fix config.yaml used for testing

* test_litellm_overhead_stream

* add update_response_metadata for caching handler

* add CachingDetails

* fix update_response_metadata import

* add CachingDetails metrics

* add CachingDetails

* test_litellm_overhead_cache_hit

* test_litellm_overhead_cache_hit

* test_litellm_overhead_cache_hit
2025-09-29 17:33:27 -07:00
Ishaan Jaffer
55110ba6ae Revert "fix _is_redis_cluster"
This reverts commit 67abd8880a.
2025-09-29 16:42:31 -07:00
Ishaan Jaffer
f303860881 Revert "test_keyslot_for_redis_cluster"
This reverts commit 52de33787b.
2025-09-29 16:42:15 -07:00
Ishaan Jaffer
52de33787b test_keyslot_for_redis_cluster 2025-09-29 16:41:32 -07:00
Ishaan Jaffer
67abd8880a fix _is_redis_cluster 2025-09-29 16:40:46 -07:00
Alexsander Hamir
d4830e34e5
fix: remove router inefficiencies (from O(M*N) to O(1)) - 62.5% faster P99 latency (#15046)
* fix: remove redundant deep copy

set_model_list already does the deep copy at the beginning of the call.

* fix: remove unused model_list arguments

The `model_list` parameter was being passed to classes that did not use it.

* fix: reduce per-request memory and time from O(N×M) to O(N)

No need to create a whole array for a simple look up.

* add: missing test

* fix: remove unused parameter
2025-09-29 15:49:46 -07:00
Ishaan Jaffer
e0172b86e2 test_litellm_overhead_non_streaming 2025-09-29 15:48:32 -07:00
Yuta Saito
5359a0d6a6 fix: test 2025-09-30 07:25:32 +09:00
Ishaan Jaff
619577d4e8
[Feat] Add litellm overhead metric for VertexAI (#15040)
* test_litellm_overhead

* vertex track overhead

* fix config.yaml used for testing

* test_litellm_overhead_stream

* add update_response_metadata for caching handler

* Revert "add update_response_metadata for caching handler"

This reverts commit f2a891f2b4.
2025-09-29 15:15:25 -07:00
Yuta Saito
f1f58bd1d1 fix: resolve regression with duplicate Mcp-Protocol-Version header 2025-09-30 07:12:56 +09:00
Ishaan Jaff
05955042d5
Add model pricing and context window for claude-sonnet-4-5 (#15049)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ishaan <ishaan@berri.ai>
2025-09-29 15:09:40 -07:00
Sameer Kankute
3ab1c31e4e
(Feat) Add cost tracking for Vertex AI Passthrough /predict endpoint (#15019)
* Add cost tracking for passthrough for predict endpoint

* restore file
2025-09-29 13:19:04 -07:00
Ishaan Jaff
038863a1fe
[Feat] Add new claude-sonnet-4-5 model family (#15041)
* add new claude-sonnet-4-5

* docs fix

* fix tool_use_system_prompt_tokens

* add anthropic.claude-sonnet-4-5-20250929 to bedrock converse models
2025-09-29 13:09:00 -07:00
Cedar Myers
5357b1e102 fix: remove invalid vertex -latest models 2025-09-29 16:04:33 -04:00
Ishaan Jaff
4dc23e8079
Revert "feat: improve vertex AI/gemini api_base handling for proxy services (…" (#15042)
This reverts commit ff2d19e4ca.
2025-09-29 13:03:46 -07:00
Krrish Dholakia
a9dcb51d03 fix: add lint 2025-09-29 12:28:43 -07:00