Commit graph

42355 commits

Author SHA1 Message Date
Sameer Kankute
74382f1c89 fix(vertex-ai): address greptile review feedback on batch cancel
- Replace misleading endpoint extraction with explicit endpoint = "cancel"
- Compute retrieve_api_base from URL components directly instead of
  stripping ":cancel" from the post-proxy URL, removing the hard ValueError
  that broke any custom Vertex AI proxy configuration
- Align cancel_batch provider priority in proxy endpoints to match
  create_batch order: body field → request headers → query params → default

Made-with: Cursor
2026-03-18 09:28:19 +05:30
Chesars
aaf860c19b docs: add Azure custom deployment name guidance for auto-routing 2026-03-18 00:56:11 -03:00
Sameer Kankute
a41239cb96 greptile comments 2026-03-18 09:24:34 +05:30
yuneng-jiang
5e2fb72f42 fix: address review feedback on v2/team/list
- Fix org admin own-query regression: always check org admin status
  before the standard route check so own-queries see all org teams
- Clear user_id when org admin is detected so org scope replaces
  user-membership scope
- Remove dead isinstance(organization_id, list) branch
- Remove unused datetime import
- Remove orphaned _convert_teams_to_response helper

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 20:50:58 -07:00
Sameer Kankute
52bf372319 fix(gpt5): treat missing supports_minimal_reasoning_effort as supported
Add _is_reasoning_effort_level_explicitly_disabled to use opt-out semantics
for minimal effort: unknown/unlisted models pass through, only blocked when
the model map explicitly sets supports_minimal_reasoning_effort=false.

xhigh keeps opt-in semantics (must be explicitly supported).

Adds test for unknown-model passthrough and explicit-disabled detection.

Made-with: Cursor
2026-03-18 09:17:57 +05:30
Cesar Garcia
3c7e37799a
Merge pull request #23928 from Chesars/fix/gemini-context-caching-custom-api-base
fix(gemini): pass model to context caching URL builder for custom api_base
2026-03-18 00:43:16 -03:00
Sameer Kankute
018ccff23f fix(vertex-ai): address greptile review feedback on batch cancel
- Add try/except httpx.HTTPStatusError blocks in _async_cancel_batch for
  both POST cancel and GET retrieve calls, with verbose_logger error logging
- Fix endpoint extraction inconsistency: compute endpoint from URL without
  :cancel suffix so it matches behaviour of create_batch/retrieve_batch
- Add explicit validation that api_base ends with ':cancel' before
  stripping it, raising a descriptive error for unsupported custom proxy
  URL rewriting scenarios
- Use string-based patch() in test instead of patch.object() for robustness
  against import order changes

Made-with: Cursor
2026-03-18 09:11:20 +05:30
Sameer Kankute
6514446dcb
Update litellm/llms/azure_ai/agents/handler.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-18 09:09:30 +05:30
Chesars
ff536e664a fix(gemini): propagate model to check_cache/async_check_cache for custom api_base
check_and_create_cache calls check_cache first (to avoid duplicates),
which also needs model for the URL when api_base is set. Without this,
the full flow still raises ValueError before reaching the create step.
2026-03-18 00:38:35 -03:00
yuneng-jiang
bd2502eeaf [Feature] /v2/team/list: Add org admin access control, members_count, and indexes
Add org admin support to /v2/team/list so org admins can list teams
within their organizations instead of getting 401. Also enrich the
response with members_count and add missing indexes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 20:34:15 -07:00
Sameer Kankute
6fe3188af0 fix(azure-ai-agents): accumulate annotations from multiple text items in streaming
- Fix bug where only last text item's annotations were preserved when
  thread.message.completed contained multiple text content items
- Accumulate annotations via extend() instead of overwriting
- Add test_azure_ai_agents_streaming_annotations_from_completed_message
- Add test_azure_ai_agents_streaming_accumulates_annotations_from_multiple_text_items

Addresses Greptile review on PR #23849

Made-with: Cursor
2026-03-18 09:04:00 +05:30
Cesar Garcia
f059ba55a9
Merge pull request #23925 from Chesars/fix/mistral-diarize-segments-response
fix(mistral): preserve diarization segments in transcription response
2026-03-18 00:32:53 -03:00
Cesar Garcia
a46b88c237
Merge pull request #23906 from Chesars/fix/anthropic-file-block-cache-control
fix(anthropic): preserve cache directive on file-type content blocks
2026-03-18 00:32:35 -03:00
Cesar Garcia
4947074aac
Merge pull request #23907 from Chesars/fix/vertex-count-tokens-location-override
fix(vertex): respect vertex_count_tokens_location for Claude count_tokens
2026-03-18 00:30:55 -03:00
Cesar Garcia
501ddb428c
Merge pull request #23618 from gambletan/fix/file-to-input-file-mapping
fix: map Chat Completion file type to Responses API input_file
2026-03-18 00:29:06 -03:00
Sameer Kankute
c20c465a02 greptile comments 2026-03-18 08:55:40 +05:30
Sameer Kankute
0564e9547b Fix greptile comments 2026-03-18 08:37:31 +05:30
Chesars
8828f002be fix(gemini): pass model to context caching URL builder for custom api_base
_get_token_and_url_context_caching() was hardcoding model=None when
calling _check_custom_proxy(), which raises ValueError when api_base
is set because Gemini proxy URLs need the model name:
{api_base}/models/{model}:cachedContents

Fixes #23846
2026-03-17 23:21:24 -03:00
Chesars
cb15296693 fix(azure): auto-route gpt-5.4+ tools+reasoning to Responses API
Azure GPT-5.4+ models now get the same auto-routing treatment as OpenAI
when both `reasoning_effort` and `tools` are used in `litellm.completion()`.
Previously, `reasoning_effort` was silently dropped for Azure; now the
request is bridged to the Responses API which supports both parameters.

Fixes #23914
2026-03-17 23:06:39 -03:00
Chesars
9afc469725 fix(mistral): preserve diarization segments in transcription response
Fixes #23890 — Mistral's Voxtral transcription with `diarize=true` returns
`segments` (with speaker_id, timestamps) and `language`, but these fields
were dropped when mapping the response to TranscriptionResponse.
2026-03-17 23:04:51 -03:00
yuneng-jiang
cfeafbe388
Merge pull request #23921 from BerriAI/litellm_mar17_extras
[Infra] Security and Proxy Extras for Nightly

Only known flaky tests failing. The fix for security and proxy extras worked
2026-03-17 18:01:19 -07:00
Krish Dholakia
5e570b3a66
Merge pull request #23911 from kelvin-tran/fix/cache-control-params-anthropic-document-file-message-blocks 2026-03-17 18:00:05 -07:00
Krish Dholakia
3bd4422a97
Merge pull request #23881 from xianzongxie-stripe/xianzong-upstream-changes 2026-03-17 17:58:36 -07:00
d 🔹
88f59e1465 fix: use AsyncMock for concurrent test consistency
Address review feedback from greptile — use new_callable=AsyncMock
on the concurrent test's patch.object to ensure the mock is properly
typed as async, even though side_effect already handles the coroutine.
2026-03-18 00:54:23 +00:00
Ishaan Jaffer
bae2eddd73 docs fix sidebar 2026-03-17 17:50:58 -07:00
Ishaan Jaff
fc315ab4af
docs(mcp_zero_trust): add MCP zero trust auth guide (#23918)
* docs(mcp_zero_trust): add MCP zero trust auth guide with hero image

* fix(docs): move hero image to static/img/ for Docusaurus build
2026-03-17 17:45:16 -07:00
yuneng-jiang
62835ff03d adding package-lock 2026-03-17 17:44:01 -07:00
yuneng-jiang
3e2845181c bumping next version 2026-03-17 17:38:09 -07:00
yuneng-jiang
cc37bf5934 adding build 2026-03-17 17:37:25 -07:00
yuneng-jiang
9fa1809c30 bump: version 0.4.56 → 0.4.57 2026-03-17 17:37:04 -07:00
yuneng-jiang
ac0de1d6a2
Merge pull request #23919 from BerriAI/mar17_ver_bump
[Infra] bump: version 1.82.3 → 1.82.4
2026-03-17 17:33:21 -07:00
yuneng-jiang
709581c5f9 bump: version 1.82.3 → 1.82.4 2026-03-17 17:31:45 -07:00
yuneng-jiang
195c0ee54d
Merge pull request #23917 from BerriAI/litellm_/loving-noyce
[Fix] Add contents:write permission to ghcr_deploy release job
2026-03-17 17:27:36 -07:00
yuneng-jiang
b8ffbba352 [Fix] Add contents:write permission to release job in ghcr_deploy workflow
The release job was failing with "Resource not accessible by integration"
because other jobs explicitly set permissions, causing GitHub to scope the
default token down for all jobs. The release job needs contents:write to
create GitHub releases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:23:39 -07:00
Mr. Ånand
96bd1a3b74
Merge branch 'Arindam200:v0-docs' into v0-docs 2026-03-18 04:55:09 +05:30
Mr. Ånand
12822f14ab docs: sidebar updates, letta resources links, Google GenAI SDK, cost tracking order
- Fix Letta Resources links: proxy, SDK (#litellm-python-sdk), observability, correct Letta docs URL
- Add Google GenAI SDK to Agent SDKs, remove from AI Tools
- Move Track Usage for Coding Tools to end of AI Tools section
- Remove Letta from Agent SDKs sidebar
- Guides, Learn, Tutorials index updates

Made-with: Cursor
2026-03-18 04:28:06 +05:30
Arindam200
16fecb06c1 docs: update Docker quick start guide for LiteLLM proxy 2026-03-18 04:23:00 +05:30
Kelvin Tran
c6e9a2a40f
Merge branch 'main' into fix/cache-control-params-anthropic-document-file-message-blocks 2026-03-17 15:34:00 -07:00
Chesars
8f015e2db2 fix(vertex): respect vertex_count_tokens_location for Claude count_tokens
The count_tokens handler unconditionally overrode vertex_location to
us-central1 for Claude models, ignoring the user-configured
vertex_count_tokens_location parameter. Also, us-central1 is no longer
a supported region — Google now supports us-east5, europe-west1, and
asia-southeast1.

Now vertex_count_tokens_location takes precedence, vertex_location is
used as fallback, and us-east5 is the default only when neither is set.

Fixes #23872
2026-03-17 19:14:08 -03:00
Chesars
20f8d413e5 fix(anthropic): preserve cache_control on file-type content blocks
Fixes #23873
2026-03-17 19:10:19 -03:00
Arindam200
f9f7d0a21c docs: simplify sidebar labels and remove outdated project links 2026-03-18 03:37:29 +05:30
Cesar Garcia
1f5a67ab45
Merge pull request #23895 from Chesars/fix/streaming-tool-call-finish-reason-empty-content
fix(vertex): streaming finish_reason='stop' instead of 'tool_calls' for gemini-3.1-flash-lite-preview
2026-03-17 18:49:27 -03:00
Cesar Garcia
c1db67ab67
Merge pull request #23899 from Chesars/fix/map-anthropic-refusal-finish-reason
fix(core): map Anthropic 'refusal' finish reason to 'content_filter'
2026-03-17 18:49:03 -03:00
Rohan
bed44f5fe5
Add Akto Guardrails to LiteLLM (#23250)
* akto guardrails support in litellm

* docs(guardrails): add akto to supported values in types/guardrails.py

* frontend changes + fixes

* feat(akto): update Akto guardrail integration with new configuration options and modes

* docs(akto): enhance Akto documentation and configuration descriptions for clarity

* feat(tests): add proxy server request headers to sample request data

* refactor(akto): remove optional account and VXLAN IDs; update documentation and tests

* feat(akto): add event_type parameter for enhanced observability in guardrail logging

* refactor(akto): update environment variable references

* refactor the python codes

* refactor and fix linting

* refactor(akto): remove unused event hook and clean up imports

* refactor(akto): enhance AktoGuardrail with async support and improved logging

* fix: Register DynamoAI guardrail initializer and enum entry (#23752)

* fix: Register DynamoAI guardrail initializer and enum entry

Fix the "Unsupported guardrail: dynamoai" error by:
1. Adding DYNAMOAI to SupportedGuardrailIntegrations enum
2. Implementing initialize_guardrail() and registries in dynamoai/__init__.py

The DynamoAI guardrail was added in PR #15920 but never properly registered
in the initialization system. The __init__.py was missing the
guardrail_initializer_registry and guardrail_class_registry dictionaries
that the dynamic discovery mechanism looks for at module load time.

Fixes #22773

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

* Update litellm/proxy/guardrails/guardrail_hooks/dynamoai/__init__.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update litellm/proxy/guardrails/guardrail_hooks/dynamoai/__init__.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* test: Add tests for DynamoAI guardrail registration

Verifies enum entry, initializer registry, class registry,
instance creation, and global registry discovery.

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

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* docs: add v1.82.3 release notes and update provider_endpoints_support.json (#23816)

* Revert "docs: add v1.82.3 release notes and update provider_endpoints_support…" (#23817)

This reverts commit 966124966f.

* Refactor Akto guardrail configuration and tests; update UI description and tags

* add account and vxlan ID parameters to Akto guardrail initialization; update Akto logo format

* enhance Akto guardrail documentation and improve error handling for non-JSON responses

* address greptile issues

* fix: update payload handling to use 'data' instead of 'json' in AktoGuardrail and adjust tests accordingly

---------

Co-authored-by: Harshit Jain <48647625+Harshit28j@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Joe Reyna <joseph.reyna@gmail.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-03-17 14:38:04 -07:00
Kelvin Tran
d0c5f494a8 fix: cache_control directive dropped anthropic document/file blocks 2026-03-17 14:30:12 -07:00
Arindam200
79e6005076 docs: enhance gateway and SDK quickstart documentation 2026-03-18 02:52:50 +05:30
Chesars
8b4a74a69c fix(core): map Anthropic 'refusal' finish reason to 'content_filter'
Anthropic's 'refusal' stop_reason was missing from _FINISH_REASON_MAP,
causing it to fall through to the default 'stop' — hiding the fact that
the model refused to respond due to safety policies.

Fixes #23793
2026-03-17 18:06:42 -03:00
Chesars
0c28b47057 fix(vertex): streaming finish_reason="stop" instead of "tool_calls" for gemini-3.1-flash-lite-preview
Models like gemini-3.1-flash-lite-preview send the final streaming chunk
with empty content (text:"") alongside finishReason:"STOP", instead of
omitting content entirely. The existing fix (PR #21577) only handled
chunks without content, so this case was missed.

Now, after processing candidates, if tool_calls were seen in earlier
chunks and a choice has finish_reason="stop", it is overridden to
"tool_calls" to match the OpenAI spec.

Fixes #22900
2026-03-17 17:47:01 -03:00
yuneng-jiang
251c279b17
Merge pull request #23891 from BerriAI/litellm_/mystifying-tereshkova
[Test] UI: Add unit tests for 10 untested components
2026-03-17 13:32:38 -07:00
yuneng-jiang
e0e1ac617a [Test] UI: Add unit tests for 10 previously untested components
Add Vitest + RTL tests for HelpLink, DebugWarningBanner, ExportFormatSelector,
ExportTypeSelector, ExportSummary, MetricCard, PolicySelect,
ComplexityRouterConfig, RateLimitTypeFormItem, and AgentCardGrid (67 tests total).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 13:30:06 -07:00