Commit graph

26565 commits

Author SHA1 Message Date
mogith-pn
ab37d696c3
updated clarifai functions to openai compatible (#15615) 2025-10-16 15:45:34 -07:00
Krish Dholakia
06d3d83f42
Merge pull request #15586 from mubashir1osmani/litellm_arize_ui
fix: add arize from UI
2025-10-16 15:40:15 -07:00
Krrish Dholakia
e43c3b9b88 test: add unit testing 2025-10-16 15:37:26 -07:00
Krrish Dholakia
b85aeb08ce fix(ui_sso.py): support both 'app_roles' and 'roles' claim on jwt decode for SSO handler 2025-10-16 15:29:34 -07:00
Ishaan Jaff
f98f299854
Merge pull request #15617 from BerriAI/litellm_october_alexsander_stanging
[OCT] Alexsander PERF improvements
2025-10-16 15:10:02 -07:00
AlexsanderHamir
bdca4db941 Merge branch 'litellm_october_alexsander_stanging' of https://github.com/BerriAI/litellm into litellm_october_alexsander_stanging 2025-10-16 14:43:30 -07:00
AlexsanderHamir
aad0efd99a fix(proxy): change check_file_size_under_limit to accept Collection[str]
Fixes mypy type error where router_model_names (a set) was incompatible
with List[str] parameter type.

Changed check_file_size_under_limit to accept Collection[str] instead of
List[str] since the parameter is only used for membership checks, making
it more flexible and avoiding unnecessary type conversions.

Resolves: proxy/proxy_server.py:5107 arg-type error
2025-10-16 14:42:27 -07:00
AlexsanderHamir
220fa3feeb Add missing env key 2025-10-16 14:42:27 -07:00
AlexsanderHamir
e154ab6a66 test: ensure model_names is a O(1) datastructure 2025-10-16 14:42:24 -07:00
AlexsanderHamir
3b14866d78 perf(router): optimize model lookups with O(1) data structures
Replace O(n) scans with index map lookups and convert model_names to set. Standardize timing calls.
2025-10-16 14:41:59 -07:00
AlexsanderHamir
76b272dffa test(router): update error message assertion after string concat optimization
Update test_generate_model_id_with_deployment_model_name to accept the new
error message format that results from the list+join optimization.

The function still correctly rejects None values with a TypeError, but the
error message changed from 'unsupported operand type(s) for +=' to
'expected str instance, NoneType found' due to the implementation change
from string concatenation to list joining.
2025-10-16 14:41:59 -07:00
AlexsanderHamir
f842b2a6ce perf(router): optimize string concatenation in hash generation
Replace string concatenation in loop with list append + join pattern.
This improves time complexity from O(n²) to O(n) and avoids creating
many temporary string objects during hash ID generation.
2025-10-16 14:41:59 -07:00
AlexsanderHamir
8c58d165a7 perf(router): use shallow copy instead of deepcopy for model aliases
Replace copy.deepcopy() with dict.copy() in _get_all_deployments when
creating model aliases.

Safe because:
1. Only modifies top-level 'model_name' field (isolated by shallow copy)
2. Nested dicts (litellm_params, model_info) are never modified after return
3. When model_alias=None, returns original dict with NO copy, proving
   callers expect nested structures to be read-only
4. Key insight: Code that needs to modify nested structures does deepcopy FIRST.
   This proves the contract is: \"treat returned deployments as read-only for
   nested fields.\" (see line 6894: copy.deepcopy before modifying litellm_params)

Performance: ~10-100x faster than deepcopy on nested dict structures.
Tests: All 114 router unit tests pass.
2025-10-16 14:41:58 -07:00
AlexsanderHamir
35de05dc8b test: add static analysis to prevent O(n) linear scans in router
Add AST-based test to detect 'for ... in self.model_list' anti-pattern.
Enforces use of index maps (model_id_to_deployment_index_map and
model_name_to_deployment_indices) for O(1) lookups instead of O(n) iteration.
2025-10-16 14:41:58 -07:00
AlexsanderHamir
254f50a655 perf(router): optimize model lookups with O(1) index maps and standardize timing
- Use model_id_to_deployment_index_map and model_name_to_deployment_indices for O(1) lookups in get_model_info, get_deployment_by_model_group_name, and get_model_ids
2025-10-16 14:41:58 -07:00
Ishaan Jaff
6f69b009c8
[Fix] Dall-e-2 for Image Edits API (#15604)
* feat: add DallE2ImageEditConfig

* fix: get_openai_image_edit_config

* fix get_provider_image_edit_config

* fix _add_image_to_files

* fix DallE2ImageEditConfig

* fix TestOpenAIImageEditDallE2
2025-10-16 13:24:24 -07:00
Krish Dholakia
3bf32e8e5c
feature: update pillar security integration to support no persistence mode in litellm proxy
feature: update pillar security integration to support no persistence mode in litellm proxy
2025-10-16 12:13:37 -07:00
Krish Dholakia
69e4a9cc3c
Merge pull request #15495 from Classic298/patch-2
correct claude opus
2025-10-16 12:06:10 -07:00
Alexsander Hamir
2ef3a76013
Merge pull request #15606 from BerriAI/litellm_fix_staging_branch
[Fix] CI/CD - Missing env key & Linter type error
2025-10-16 11:51:49 -07:00
AlexsanderHamir
8a325530fc fix(proxy): change check_file_size_under_limit to accept Collection[str]
Fixes mypy type error where router_model_names (a set) was incompatible
with List[str] parameter type.

Changed check_file_size_under_limit to accept Collection[str] instead of
List[str] since the parameter is only used for membership checks, making
it more flexible and avoiding unnecessary type conversions.

Resolves: proxy/proxy_server.py:5107 arg-type error
2025-10-16 11:33:04 -07:00
AlexsanderHamir
18c5ec8ff7 Add missing env key 2025-10-16 11:33:04 -07:00
Ariel Fogel
59c3aa02c3 respond to review comments 2025-10-16 20:38:49 +03:00
Krish Dholakia
71b9becfdd
Merge pull request #15535 from konekohana/openrouter-anthropic-caching
Prompt caching for anthropic models with openrouter
2025-10-16 09:30:01 -07:00
Krish Dholakia
67237e56fe
Merge pull request #15554 from eddierichter-amd/lemonade-model-update
Adding new models to the lemonade provider
2025-10-16 09:28:40 -07:00
Alexsander Hamir
d07e4f414b
Merge pull request #15574 from BerriAI/litellm_router_index_change
perf(router): optimize model lookups with O(1) index maps
2025-10-16 09:08:53 -07:00
Alexsander Hamir
1846363b94
Merge branch 'litellm_october_alexsander_stanging' into litellm_router_index_change 2025-10-16 09:07:15 -07:00
AlexsanderHamir
5e929dad2d test: add static analysis to prevent O(n) linear scans in router
Add AST-based test to detect 'for ... in self.model_list' anti-pattern.
Enforces use of index maps (model_id_to_deployment_index_map and
model_name_to_deployment_indices) for O(1) lookups instead of O(n) iteration.
2025-10-16 09:04:57 -07:00
Mubashir Osmani
a54445dc0e
Merge branch 'main' into litellm_arize_ui 2025-10-16 11:24:53 -04:00
Krish Dholakia
455dc8a31c
Merge pull request #15569 from FelipeRodriguesGare/fix/gpt-5-codex-params-off
adding support parameters to model_prices json
2025-10-16 07:33:55 -07:00
Krish Dholakia
68caebe119
Merge pull request #15580 from aniketmaurya/patch-1
Add type hint to function_to_dict and fix typo
2025-10-16 07:30:29 -07:00
Krish Dholakia
e95a42d0b8
Merge pull request #15583 from TeddyAmkie/fix/entraid-app-roles-jwt-claim-clean
Fix/entraid app roles jwt claim clean
2025-10-16 07:29:49 -07:00
Krish Dholakia
af8cf6861d
Merge pull request #15591 from TensorNull/fix/cometapi
fix(cometapi): improve CometAPI provider support (embeddings, image generation, docs)
2025-10-16 07:26:59 -07:00
Ariel Fogel
b075cf4a6c PLR-2400: support no persistence in litellm proxy 2025-10-16 17:22:58 +03:00
Krish Dholakia
e314d946e2
Merge pull request #15598 from shinharaguchi/feature/add_jp_haiku4_5_price
Add JP Cross-Region Inference jp.anthropic.claude-haiku-4-5-20251001
2025-10-16 07:12:58 -07:00
shinharaguchi
359a095319 Add jp.anthropic.claude-haiku-4-5-20251001 price 2025-10-16 21:52:44 +09:00
TensorNull
074b9954a0 docs(readme): Add CometAPI to supported providers table 2025-10-16 14:18:55 +08:00
TensorNull
e3566faf15 fix(cookbook): Remove the CometAPI key used for testing. 2025-10-16 14:14:58 +08:00
TensorNull
55a6dd3a8b feat(cometapi): Add CometAPI provider support (embeddings, image generation, docs)
- Add CometAPI embedding and image generation transformations and configs
- Add image cost calculator and export/init files
- Register provider in constants, utils, main (embedding path) and sidebars
- Add CometAPI docs page and cookbook notebook (Colab) for usage examples
2025-10-16 13:08:14 +08:00
mubashir1osmani
0c4aae0347 fix: add arize from ui 2025-10-15 22:07:16 -04:00
berri-teddy
1b55803c76 test: reduce EntraID app roles tests to essential scenarios
- Keep only 2 focused tests: single role extraction and no roles claim
- Remove complex fixtures and edge case tests
- Maintain clean, maintainable test coverage
2025-10-15 18:15:04 -07:00
berri-teddy
6b166e046d fix: correct EntraID app roles JWT claim extraction
- Fix get_app_roles_from_id_token to use 'app_roles' claim instead of 'roles'
- Add comprehensive unit tests for EntraID app roles functionality
- Prevent regressions in Microsoft EntraID SSO authentication

Resolves issue where EntraID app roles were not being extracted correctly
from JWT tokens, causing authentication failures for users with assigned
app roles in Microsoft EntraID.
2025-10-15 18:06:03 -07:00
Alexsander Hamir
a17f3a7aa8
Merge pull request #15578 from BerriAI/litellm_remove_list_lookup
perf(router): optimize model lookups with O(1) data structures
2025-10-15 17:59:55 -07:00
AlexsanderHamir
56838e2388 test: ensure model_names is a O(1) datastructure 2025-10-15 17:52:44 -07:00
Andreas
f1fbae8409
feat(pricing): Add Gemini 2.5 Flash Image (Nano Banana) in GA (#15557)
* feat(pricing): Add Gemini 2.5 Flash Image (Nano Banana) in GA

* change mode to image_generation

---------

Co-authored-by: Andreas Feldl <andreas.feldl@netlight.com>
2025-10-15 17:50:15 -07:00
Ishaan Jaffer
fd83b292a6 test_bedrock_anthropic_prompt_caching 2025-10-15 17:46:44 -07:00
Ishaan Jaffer
8ab720409c bump v 2025-10-15 17:44:29 -07:00
Ishaan Jaff
354e62bde4
[Feat] Add anthropic.claude-haiku-4-5-20251001-v1:0 on Bedrock, VertexAI (#15581)
* add claude 4-5

* add anthropic.claude-haiku-4-5-20251001-v1:0
2025-10-15 17:41:09 -07:00
Aniket Maurya
495e6c0a2b
Add type hint to function_to_dict and fix typo
Updated type hint for function_to_dict and fixed typo in docstring.
2025-10-16 01:36:32 +01:00
Mubashir Osmani
ad7f4411a3
added claude-haiku-4.5 (#15579) 2025-10-15 17:28:49 -07:00
Alexsander Hamir
4e84937efc
Merge pull request #15575 from BerriAI/litellm_remove_constly_string_operation
perf(router): optimize string concatenation in hash generation
2025-10-15 17:26:32 -07:00