Commit graph

34410 commits

Author SHA1 Message Date
Chesars
fba19f089a refactor: reduce code duplication in files/main.py with credential helpers
Extract repeated OpenAI and Azure credential resolution logic into
_get_openai_credentials() and _get_azure_credentials() helper functions,
reducing ~270 lines of duplicated code across 5 file operations.
Also removes dead Vertex AI code path in create_file that was unreachable
since ProviderConfigManager.get_provider_files_config() handles it first.
2026-03-03 15:02:24 -03:00
Chesars
909e3ce6c9 test: create fresh ModelResponse per test to avoid shared mutable state 2026-03-03 14:54:11 -03:00
yuneng-jiang
b4980340fb
Merge pull request #22680 from BerriAI/litellm_fix_mcp_server_dates
[Fix] MCP server: preserve created_at and updated_at timestamps
2026-03-03 09:53:37 -08:00
github-actions[bot]
8665e92aa8
chore: regenerate poetry.lock to match pyproject.toml (#3)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-03 17:52:45 +00:00
Chesars
f6264a9c0f docs(openrouter): add image edit documentation
Add OpenRouter image edit docs to both the provider page and the
main image_edits reference page, including supported models, parameter
mappings (size→aspect_ratio, quality→image_size), usage examples,
proxy configuration, and a note about 4K quality model support.
2026-03-03 14:50:41 -03:00
yuneng-jiang
76e3dba0f8 fix mcp server created_at and updated_at timestamps being overwritten with current time
- Add created_at field to MCPServer type (was missing)
- Map created_at from LiteLLM_MCPServerTable in build_mcp_server_from_table()
- Use server.created_at and server.updated_at instead of datetime.now() in _build_mcp_server_table() and health check table builder
- Add regression tests to verify timestamps are preserved through round-trip conversions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 09:41:45 -08:00
Chesars
1fe2e92d32 fix(main): forward enable_json_schema_validation to acompletion_with_mcp
The parameter was declared in completion() signature but not passed
to acompletion_with_mcp, causing per-request JSON schema validation
to silently fall back to the global default when MCP tools are present.
2026-03-03 14:34:32 -03:00
Harshit28j
b44755db96 fix(proxy): make common_checks opt-in for custom auth via custom_auth_run_common_checks
Replaces the skip_route_check approach from PR #22662 with a configurable
opt-in flag. By default, common_checks() is not run for custom auth flows,
preserving backwards compatibility with pre-#22164 behavior.

Users who want budget/team/route enforcement on custom auth can enable it:
  general_settings:
    custom_auth_run_common_checks: true

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 22:50:34 +05:30
Harshit28j
22e682b1e8 feat: guardrail-mode-default-list 2026-03-03 22:45:32 +05:30
Sameer Kankute
afc7b87b36
Merge pull request #22656 from BerriAI/litellm_add_vector_store_Ui
Add support for Attaching knowledge base to model via UI
2026-03-03 22:25:59 +05:30
Sameer Kankute
daa0397f30
Merge pull request #22674 from BerriAI/litellm_gemini-3.1-flash-lite-preview
Day 0 gemini 3.1 flash lite preview support
2026-03-03 22:23:17 +05:30
Sameer Kankute
9d06106af0 Fix gemini-3.1-flash-lite-preview for streaming 2026-03-03 22:22:57 +05:30
Sameer Kankute
c3fe4634b6 Add correct pricing for gemini 3.1 flash lite 2026-03-03 22:06:16 +05:30
Ephrim Stanley
b83373d29c Managed batches - Address PR bot comments from #22464 2026-03-03 11:01:49 -05:00
Cesar Garcia
a0cc550f48
Merge pull request #22665 from Chesars/feat/add-zai-glm-5-model-pricing
feat(models): add zai/glm-5 and zai/glm-5-code to model cost map
2026-03-03 12:17:42 -03:00
Chesars
75518c3ca7 feat(models): add zai/glm-5 and zai/glm-5-code to model cost map
Add native ZhipuAI GLM-5 and GLM-5-Code model entries with pricing
from docs.z.ai/guides/overview/pricing.
2026-03-03 12:03:40 -03:00
Harshit28j
7d322e0d44 Merge branch 'main' of https://github.com/BerriAI/litellm into litellm_custm_auth 2026-03-03 20:24:44 +05:30
Cesar Garcia
dfd7203d7f
Merge pull request #22650 from Chesars/fix/add-missing-dashscope-glm5-pricing
fix(pricing): add 7 missing DashScope model pricing entries
2026-03-03 11:53:30 -03:00
Cesar Garcia
105a40ba4f
Merge pull request #22649 from Chesars/fix/add-missing-openrouter-model-pricing
fix(pricing): add 5 missing OpenRouter model pricing entries
2026-03-03 11:53:07 -03:00
Harshit28j
6d535e5639 fix(proxy): allow custom auth routes to bypass route authorization checks
Custom user-added routes (e.g. /ldap/ngs/ready) used with Depends(user_api_key_auth) were being rejected as admin-only after _run_post_custom_auth_checks was introduced in commit 14badde13c.

The route authorization check in common_checks is designed for LiteLLM's own management routes. Custom auth flows that add their own routes should be trusted since the custom auth function already validated the request. Budget and expiry checks still run.

Add skip_route_check parameter to common_checks() and pass skip_route_check=True from _run_post_custom_auth_checks() to skip route authorization while preserving budget/team/model checks.

Regression test added: test_common_checks_skip_route_check_for_custom_auth

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-03 20:20:47 +05:30
Chesars
59bde4a81a refactor(proxy): extract encode_batch_response_ids helper and fix list_batches encoding
Extract duplicated batch ID encoding logic into a shared helper
encode_batch_response_ids() in common_utils.py. Use it in create_batch,
retrieve_batch, and cancel_batch. Also add encoding to list_batches
when x-litellm-model is used.
2026-03-03 11:38:50 -03:00
Chesars
7506fd0426 fix(proxy): re-encode response IDs in cancel_batch for model-based routing 2026-03-03 11:22:43 -03:00
Sameer Kankute
c1b39a6425
Merge pull request #22651 from BerriAI/litellm_encrypted_content_affinity_2
Add support for encrypted content affinity
2026-03-03 19:43:47 +05:30
Sameer Kankute
a9ee8ff5d2
Merge pull request #22641 from BerriAI/litellm_remove_default_litellm_thinking
[Chore]Remove defualt hardcoded thinking levels for gemini 3 family
2026-03-03 19:42:40 +05:30
Sameer Kankute
bdfc602dbf
Merge pull request #22625 from BerriAI/litellm_azure_ai_finetune
Fix: Azure ai finetuning api
2026-03-03 19:42:17 +05:30
Chesars
9fd4c00b06 fix(proxy): re-encode response IDs in retrieve_batch for model-based routing
The provider returns raw IDs in the retrieve response (output_file_id,
error_file_id). These need to be encoded with model info so the client
can use them for subsequent file download calls through the proxy.
2026-03-03 11:06:38 -03:00
Harshit Jain
bb1da7091a
Merge pull request #22631 from Harshit28j/litellm_bump_litellm_08_03
bump: version 1.82.0 → 1.82.1
2026-03-03 19:35:56 +05:30
Sameer Kankute
88dd1b5801
Merge pull request #22657 from BerriAI/revert-22654-litellm_add_Qwen3.5-397B-A17B
Revert "feat(togetherai): add support for togetherai/Qwen3.5-397B-A17B model"
2026-03-03 19:35:39 +05:30
Sameer Kankute
24ec7f882f
Revert "feat(togetherai): add support for togetherai/Qwen3.5-397B-A17B model" 2026-03-03 19:35:26 +05:30
Sameer Kankute
6c0387d170 Add support for Attaching knowledge base to model via UI 2026-03-03 19:31:55 +05:30
Chesars
9463de0c66 fix: correct indentation from commit suggestions and add missing Optional import 2026-03-03 10:51:48 -03:00
Sameer Kankute
974c02fae4
Merge pull request #22654 from Varad2001/litellm_add_Qwen3.5-397B-A17B
feat(togetherai): add support for togetherai/Qwen3.5-397B-A17B model
2026-03-03 19:19:41 +05:30
Varad Khonde
d66f8bc15d feat(togetherai): add support for togetherai/Qwen3.5-397B-A17B model 2026-03-03 19:17:28 +05:30
Cesar Garcia
096edface5
Update litellm/proxy/batches_endpoints/endpoints.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-03 10:46:14 -03:00
Cesar Garcia
7d664f0c09
Update tests/litellm/proxy/test_batch_x_litellm_model_encoding.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-03 10:45:00 -03:00
Cesar Garcia
3426b905ce
Update tests/litellm/proxy/test_batch_x_litellm_model_encoding.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-03 10:44:47 -03:00
Chesars
5ad0d03671 fix(proxy): encode batch IDs with model info when x-litellm-model header is used
When create_batch routes via x-litellm-model header, the response batch_id
was returned raw without model routing info. This meant retrieve_batch could
not determine which provider/credentials to use, defaulting to "openai"
instead of the correct provider (e.g., VLLM).

Now encodes batch_id, output_file_id, and error_file_id with model info
(same pattern as the model-embedded file_id flow in Scenario 1), so
retrieve_batch can decode and route back to the correct provider.
2026-03-03 10:26:03 -03:00
Sameer Kankute
9ffbd9e30e
Merge pull request #22464 from Point72/ephrimstanley/batch-fixes-feb27
Managed batches fixes for vertex
2026-03-03 18:53:53 +05:30
Sameer Kankute
2f6279d189 Fix import issue 2026-03-03 18:41:15 +05:30
Sameer Kankute
ca597e18c8 Fix routing of encrypted content 2026-03-03 18:37:28 +05:30
Sameer Kankute
521f804350 Fix encrypted content streaming affinity issue 2026-03-03 18:37:22 +05:30
Sameer Kankute
2bc4da76ce Update the tests 2026-03-03 18:36:07 +05:30
Sameer Kankute
37834f1d2a Update the docs 2026-03-03 18:36:07 +05:30
Sameer Kankute
7928d41e9a Update the routing 2026-03-03 18:36:07 +05:30
Sameer Kankute
122f534d87 Add encoding method for Encrypted-content-aware deployment 2026-03-03 18:36:07 +05:30
Sameer Kankute
adec115db8 Fix logging for error 2026-03-03 18:36:07 +05:30
Sameer Kankute
18bf3f2df6 Fix mock github test 2026-03-03 18:36:07 +05:30
Sameer Kankute
a88a17796b Fix logging and encrypted content extraction 2026-03-03 18:36:07 +05:30
Sameer Kankute
37612bdf56 ADd incident report 2026-03-03 18:36:07 +05:30
Sameer Kankute
fbec5c5ccf Add docs for encrypted_content_affinity 2026-03-03 18:36:07 +05:30