Commit Graph

34 Commits

Author SHA1 Message Date
Yuta Saito 18bcb429fc Manual revert #19078 2026-01-17 06:54:08 +09:00
YutaSaito 7aba0f738a Revert "Litellm staging 01 15 2026" 2026-01-17 06:31:34 +09:00
YutaSaito eec4ed640b Revert "Stabilise mock tests" 2026-01-17 06:26:18 +09:00
Sameer Kankute f3ca05112e Merge pull request #19206 from BerriAI/main
merge main
2026-01-16 15:22:16 +05:30
choigawoon d76f3acb80 fix: video status/content credential injection for wildcard models (#18854)
* fix: video status/content credential injection for wildcard models

When using wildcard model patterns like `vertex_ai/*`, the video status
and content endpoints failed to resolve the model_name correctly,
causing credential injection to be skipped.

Changes:
- router.py: Added `custom_llm_provider` parameter to
  `resolve_model_name_from_model_id` method
- router.py: Added Strategy 2 (provider prefix matching) and
  Strategy 4 (wildcard pattern matching)
- endpoints.py: Pass `provider_from_id` to resolver in video_status,
  video_content, and video_remix endpoints

This allows video_id like `vertex_ai:veo-3.0-generate-preview:...` to
correctly match `vertex_ai/*` wildcard pattern and inject credentials
from the model config.

Fixes: Video status returns "Your default credentials were not found"
when using Vertex AI video generation with wildcard model patterns.

* pr18845-video기능버그픽스 (vibe-kanban e43e2d2d)

pr코멘트 대응

litellm fork해서 branch만들고 작업후 pull request를 올렸는데 피드백을줬어.

이 내용 파악해서 내가 올린 pr 브랜치에 해당 작업 이어서 해야할거같아.

https://github.com/BerriAI/litellm/pull/18854#discussion\_r2677026995

여기 내용 읽고 현황 파악해서 작업하자.

테스트코드 작성해달라는데 테스트코드작성후 로컬에서 테스트명령어 한번 돌리고 커밋 푸시하려고.

litellm에서 pull request를 위한 문서가 있어.

https://docs.litellm.ai/docs/extras/contributing\_code

CRA서명은 했어. 그다음거부터 양식에 맞게 해야할듯. 지금 버그만 바로 고쳐서 pr했거든.

* fix: resolve mypy type error in resolve_model_name_from_model_id

Rename loop variable to avoid type conflict between DeploymentTypedDict
and Dict[Any, Any] from pattern_router.route() return type.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 03:45:25 +05:30
Sameer Kankute 3af994a32a Fix: test router 2026-01-15 19:21:31 +05:30
Sameer Kankute 7dbf09cb12 Fix all 130126 tests 2026-01-14 17:47:03 +05:30
rohan.w.charles bc88dbfbc9 fix: implement mid-stream fallback handling based on user preference 2026-01-14 16:28:51 +05:30
Ishaan Jaff 5ea0854eda [Feat] Guardrails Load Balancing - Allow Platform admins to load balance between guardrails (#18181)
* add _aguardrail_helper for LB

* add _aguardrail_helper on router.py

* test_proxy_logging_pre_call_hook_load_balancing

* add _execute_guardrail_with_load_balancing

* add LB TEsting

* docs guard lb

* fix linting

* fix lint
2025-12-19 00:08:03 +05:30
yuneng-jiang d2b3ef0667 Add aws_bedrock_runtime_endpoint into Credential Types (#17053) 2025-11-24 20:48:51 -08:00
Alan Ponnachan 7b292ccdf5 router fallback for unknown models (#16419) 2025-11-10 19:33:01 -08:00
Ishaan Jaffer 33371d18f4 test fix claude-sonnet-4-5-20250929 2025-10-28 19:05:13 -07:00
Ishaan Jaffer 1b49dba1dd fix claude-sonnet-4-5 2025-10-28 17:37:08 -07:00
Ishaan Jaffer 0bedf1c0a7 fix tests 2025-10-25 10:19:24 -07:00
Ishaan Jaffer cc5eac4965 fix _add_deployment_model_to_endpoint_for_llm_passthrough_route 2025-10-16 15:10:54 -07:00
Ishaan Jaffer c27beb74b9 test fix 2025-09-27 12:40:34 -07:00
Krrish Dholakia 2c0520635d test: cleanup old tests 2025-08-18 22:58:29 -07:00
Krish Dholakia 9f6f96d76c Litellm dev 08 07 2025 p1 (#13418)
* fix(router.py): support base model for model group usage

allows model group info to show accurate cost information for azure models

* fix(router.py): fix changes

* test: add unit tests

* build(pyproject.toml): bump openai version requirements

support custom tool from responses api

 Closes https://github.com/BerriAI/litellm/issues/13391

* docs(responses_api.md): add verbosity + free-form function calling parameters

* docs(responses_api.md): add cfg + minimal reasoning to docs

Closes https://github.com/BerriAI/litellm/issues/13391

* docs(responses_api.md): add proxy examples to docs

* refactor: fix ruff error
2025-08-09 16:30:04 -07:00
Krish Dholakia eb49f987de Ensure disable_llm_api_endpoints works + Add wildcard model support for 'team-byok' model (#13278)
* fix(route_checks.py): ensure disable llm api endpoints is correctly set

* fix(route_checks.py): raise httpexception

raise expected exceptions

* fix(router.py): handle team only wildcard models

fixes issue where team only wildcard models were not considered during auth checks

* fix(router.py): handle team only wildcard models

fixes issue where team only wildcard models were not considered during auth checks
2025-08-04 23:19:51 -07:00
Krrish Dholakia 461b615bde test: update tests 2025-08-01 09:12:44 -07:00
Krish Dholakia 78997c2e35 Anthropic - working mid-stream fallbacks (#13149)
* fix(router.py): add acompletion_streaming_iterator inside router

allows router to catch errors mid-stream for fallbacks

Work for https://github.com/BerriAI/litellm/issues/6532

* fix(router.py): working mid-stream fallbacks

* fix(router.py): more iterations

* fix(router.py): working mid-stream fallbacks with fallbacks set on router

* fix(router.py): pass prior content back in new request as assistant prefix message

* fix(router.py): add a system prompt to help guide non-prefix supporting models to use the continued text correctly

* fix(common_utils.py): support converting `prefix: true` for non-prefix supporting models

* fix: reduce LOC in function

* test(test_router.py): add unit tests for new function

* test: add basic unit test

* fix(router.py): ensure return type of fallback stream is compatible with CustomStreamWrapper

prevent client code from breaking

* fix: cleanup

* test: update test

* fix: fix linting error
2025-07-31 21:22:49 -07:00
Krish Dholakia ea6b4b08d3 move to use_prisma_migrate by default + resolve team-only models on auth checks + UI - add sagemaker on UI (#13117)
* fix(proxy_cli.py): make use_prisma_migrate proxy default

Fixes https://github.com/BerriAI/litellm/issues/13046

 Prisma migrate deploy prevents resetting db

* fix(auth_checks.py): resolve team only models while doing auth checks on model access groups

Fixes issue where key had access via an access group, but team only model could not be called

* test(test_router.py): add unit testing

* feat(provider_specific_fields.tsx): add aws sagemaker on UI
2025-07-29 21:56:18 -07:00
Krish Dholakia a89a49f1e1 Allow forwarding clientside headers by model group (#12753)
* feat: initial commit for forwarding client headers by model group

* fix(router.py): support new forwarclientsideheadersbymodelgroup class

enables headers to be forwarded to backend model, by model group

* fix(proxy_server.py): load in model group settings from config correctly

* refactor(litellm_pre_call_utils.py): litellm_pre_call_utils.py

introduce new 'secret_fields' field

includes raw request headers (not the sanitized ones used for logging) - needed to support forwarding clientside headers to llm api

* feat(router.py): log the deployment model name as well

allows wildcard models to support forward_client_headers_to_llm_api

* test(test_router.py): add more unit testing

* feat(router.py): specify the model group alias in metadata kwargs

allows usage for internal routing logic

* fix: fix ruff check errors

* fix(router.py): refactor to cleanup optional pre-call checks

* fix: fix ruff check

* test: add missing unit test
2025-07-19 15:17:13 -07:00
Krish Dholakia 07e8609edb Resolve model group alias on Auth + /v1/messages Fallback support (#12440)
* fix(auth_checks.py): resolve a model group alias when key has access to underlying model

Fixes LIT-293

* feat(anthropic/): add mock_response to anthropic /v1/messages

makes it easy to test fallback logic

* fix(router.py): support fallbacks on /v1/messages

adds working fallbacks on generic api route

* refactor(router.py): point _ageneric_api_call_with_fallbacks to updated function

* test: add unit test for new helper on router

* fix(router.py): use correct metadata variable name

* fix(router.py): use correct metadata field

* docs(config_settings.md): document new param
2025-07-09 22:27:55 -07:00
Krish Dholakia 66d8c653fd (Router) don't add invalid deployment to router pattern match (#12459)
* fix security - mcp

* fix(router.py): validate model provider before adding deployment to pattern

prevents routing on pattern match to invalid deployment

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
2025-07-09 11:42:11 -07:00
Ishaan Jaff d774b08766 test_arouter_filter_team_based_models 2025-07-03 23:05:03 -07:00
Ishaan Jaff 467dc4fa38 test router 2025-07-03 22:37:25 -07:00
Krish Dholakia df49b24bc0 Azure - responses api bridge - respect responses/ + Gemini - generate content bridge - handle kwargs + litellm params containing stream (#12224)
* fix(main.py): handle router custom azure model name for responses api bridge

* fix(responses/handler): ensure azure model name is stripped before sending to provider

Fixes model name error

* fix(google_genai/main.py): handle stream=true being set in kwargs

* docs: cleanup icons from sidebar

* fix(test-litellm.yml): add google-genai to test litellmyml

* fix(main.py): strip 'responses/' from bridge

* fix(main.py): fix linting errors

* fix(types/openai.py): allow item to be none

handle azure streaming response

* fix(base.py): allow extra fields + handle azure item = none value in response output item added event

* fix(main.py): correctly handle removing responses/

* test(test_main.py): add unit tests
2025-07-02 13:53:52 -07:00
Krish Dholakia cec7e4941a UI QA Fixes - prevent team model reset on model add + return team-only models on /v2/model/info + render team member budget correctly (#12144)
* fix(team_endpoints.py): prevent overwriting current list of team models on new model add

* fix(networking.tsx): fix default proxy base url

* fix(proxy_server.py): include team only models when retrieving all deployments on `/v2/model/info` helper util

ensures team only models are shown to user

* fix(router.py): check model name by team public model name when team id given

Fixes issue where team member could not see team only models when clicking into that team on `Models + Endpoints`

* fix(team_member_view.tsx): fix rendering team member budget, when budget is set

* test: update tests

* test: update unit test
2025-06-28 22:04:49 -07:00
Krrish Dholakia c3857e60f2 Store batch output file id in DB + Store batch file status in DB + (experimental) BATCH API COST TRACKING 2025-06-25 22:41:22 -07:00
Krish Dholakia 1a7fd1d1c7 Litellm dev 06 25 2025 p2 (#12049)
* test(test_router.py): initial unit test confirming router.afile_content uses dynamic api key / api base

* fix(managed_files.py): filter deployments for only those within file id mapping

ensure call works - only route to models where the file was written

* fix(proxy_server.py): fix loading in model ids from config, if config id is int

* fix(router.py): return all model file id mappings on create_file

if multiple deployments - this ensures all the file id mappings are bubbled up

Fixes issue when trying to use loadbalanced deployments - only 1 file id mapping was being stored

* feat(router_utils/common_utils.py): filter models by team id when selecting for routing

Prevents team only models from being used by other teams

* fix(common_utils.py): additional fixes around filtering team-based models

* fix(batches_endpoints/endpoints): support list batches with target model names specified

* fix(common_utils.py): more testing for team deployment filters
2025-06-25 21:54:13 -07:00
Krish Dholakia e2f6fb2d7c Managed Files + Batches - filter deployments to only those where file was written + save all model file id mappings in DB (prev just 1st one) (#12048)
* test(test_router.py): initial unit test confirming router.afile_content uses dynamic api key / api base

* fix(managed_files.py): filter deployments for only those within file id mapping

ensure call works - only route to models where the file was written

* fix(proxy_server.py): fix loading in model ids from config, if config id is int

* fix(router.py): return all model file id mappings on create_file

if multiple deployments - this ensures all the file id mappings are bubbled up

Fixes issue when trying to use loadbalanced deployments - only 1 file id mapping was being stored
2025-06-25 21:27:06 -07:00
Krish Dholakia 0d09c8ec96 Litellm dev 06 18 2025 p1 (#11872)
* fix(spend_tracking_utils.py): add user agent tags from standard logging payload, in spend logs payload

* feat(litellm_logging.py): identify user agent tags as `User-Agent: ..` and allow admin to disable storing user agent as tag

* fix(azure_ai/): pass content type header in azure ai request

Fixes https://github.com/BerriAI/litellm/issues/11227

* test: add unit test

* fix(router.py): fix passing dynamic credentials to retrieve batch

Fixes batch retrieval when using router

* test: add more unit tests
2025-06-18 21:24:36 -07:00
Krish Dholakia ef42461c1e Litellm fix GitHub action testing (#11163)
* test: add __init__.py files

* refactor: rename test folder to avoid naming conflict

* test: update workflows

* test: update tests

* test: update imports

* test: update tests

* test: remove unused import

* ci(test-litellm.yml): add pytest retry to github workflow

* test: fix test
2025-05-26 14:41:42 -07:00