Commit graph

42355 commits

Author SHA1 Message Date
ryan-crabbe
fb92ea21bc
Merge pull request #24475 from BerriAI/litellm_fix-sso-return-to-validation
fix(proxy): ignore return_to in SSO when control_plane_url is not con…
2026-03-23 22:15:45 -07:00
Ryan Crabbe
e40f68aec4 test(ui): add unit tests for 5 untested frontend components
- AntDLoadingSpinner: rendering, prop forwarding, icon styling
- MessageManager: static fallback, custom instance delegation
- claude_code_plugins/helpers: all pure utility functions (15 describe blocks, 55 tests)
- AgentSelector: fetch behavior, loading states, error handling, disabled state
- WorkerDropdown: conditional rendering, worker options, selection changes
2026-03-23 22:03:10 -07:00
Ryan Crabbe
0aadf51342 fix(proxy): ignore return_to in SSO when control_plane_url is not configured
Instead of returning a 400 error when return_to is passed without
control_plane_url configured, silently ignore it and proceed with
the normal same-origin SSO flow.
2026-03-23 21:54:29 -07:00
Sameer Kankute
80af635eb1 Fix docs 2026-03-24 09:44:04 +05:30
Sameer Kankute
4e6e566b4d docs(opencode): fix model prefix and clarify drop_params scope
- Use openai/gpt-5 prefix to match existing doc conventions
- Clarify that additional_drop_params must be added to every affected
  model entry, not just one

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:42:59 +05:30
Sameer Kankute
17e6e7a4cc docs(opencode): add guidance for dropping reasoningSummary param
OpenCode sends a `reasoningSummary` Responses API param with chat
completion requests. Document how to use `additional_drop_params` to
drop it and avoid 400 errors from the OpenAI API.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:33:28 +05:30
Krish Dholakia
3292d02aa4
Merge pull request #24460 from DmitriyAlergant/ci/skip-scheduled-workflows-on-forks
ci: skip scheduled workflows on forks
2026-03-23 19:54:50 -07:00
Krish Dholakia
14fffc2770
Merge pull request #24432 from BerriAI/krrishdholakia/project-id-tracking
feat(proxy): add project_alias tracking in callbacks
2026-03-23 19:24:44 -07:00
DmitriyAlergant
1310a275d2 ci: narrow codeql guard to schedule-only
Use event_name check so push/PR-triggered CodeQL scans still run on
forks — only the scheduled run is skipped.
2026-03-23 21:39:11 -04:00
DmitriyAlergant
91bc095e18 ci: skip scheduled workflows on forks
Add `if: github.repository == 'BerriAI/litellm'` guard to scheduled
jobs in stale.yml, codeql.yml, and create_daily_staging_branch.yml.

This matches the existing pattern in auto_update_price_and_context_window.yml
and prevents these workflows from running unnecessarily on fork repositories.
2026-03-23 21:29:00 -04:00
Krrish Dholakia
26d162ccf4 fix(test): add user_api_key_project_alias to spend logs expected keys
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 18:12:50 -07:00
Krrish Dholakia
742e176611 docs(reasoning_content.md): update guide 2026-03-23 17:23:14 -07:00
Krish Dholakia
8a3aa4d31c
Merge pull request #24434 from BerriAI/krrishdholakia/prometheus-spend-metadata
feat(prometheus): include spend_logs_metadata in custom labels
2026-03-23 16:52:59 -07:00
Josh
8a58281cbf Add org budget metrics initialization at startup 2026-03-23 19:33:57 -04:00
Josh
7fcf99ffaf Add org budget metrics to failure path 2026-03-23 19:07:01 -04:00
Lei Nie
1716956520 test(responses): update expected events and add mock test for content_part.added
- Update test_anthropic_via_responses_api expected_events to include
  CONTENT_PART_ADDED between OUTPUT_ITEM_ADDED and OUTPUT_TEXT_DELTA
- Add TestEnsureOutputItemContentPartAdded with 3 mock tests:
  message item emits content_part.added, reasoning item does not,
  and the event is only emitted once
2026-03-23 22:29:50 +00:00
Lei Nie
d560e4c009 fix(responses): emit content_part.added event for non-OpenAI models
LiteLLMCompletionStreamingIterator defined create_content_part_added_event()
but never called it, so non-OpenAI providers (Claude, Gemini, etc.) skipped
this spec-required event. Downstream parsers that process content_part.added
to initialize the text part structure would fail when output_text.delta
arrived before the text part existed.
2026-03-23 22:25:37 +00:00
Krrish Dholakia
dd0e7dcca8 test(prometheus): add tests for spend_logs_metadata in custom labels
Verify that spend_logs_metadata is correctly merged into combined_metadata
and flows through to Prometheus custom labels. Tests cover: basic extraction,
precedence when keys overlap, all three metadata sources combined, and None
handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 11:02:21 -07:00
Krrish Dholakia
7fa623df91 feat(prometheus): include spend_logs_metadata in custom labels
Add spend_logs_metadata to combined_metadata in Prometheus logger so
custom metadata from x-litellm-spend-logs-metadata header can be used
in Prometheus custom labels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 10:59:18 -07:00
Krrish Dholakia
6809213957 feat(proxy): add project_alias tracking through callback metadata pipeline
Thread project_alias alongside project_id through the metadata pipeline so
callbacks receive the human-readable project name. DRY up duplicate metadata
dict construction in proxy_track_cost_callback and pass_through_endpoints by
reusing get_sanitized_user_information_from_key — future metadata fields only
need adding in one place.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 10:44:17 -07:00
Cesar Garcia
b8189ea1de
Merge pull request #24164 from dongyu-turo/feat/update-bedrock-claude-price-above-200k
fix: update bedrock claude sonnet/opus 4.6 above 200k token pricing and sonnet 4.6 max_input_tokens to 1M
2026-03-23 14:40:26 -03:00
Chesars
da0c6c14bb fix: align claude 4.6 pricing tests 2026-03-23 14:23:29 -03:00
Cesar Garcia
19c8f3d565
Merge pull request #24423 from Chesars/feat/bedrock-glm5-minimax-m25
feat(bedrock): add GLM-5 and Minimax M2.5 with regional aliases
2026-03-23 13:30:07 -03:00
Cesar Garcia
9b7c27c338
Merge pull request #24422 from Chesars/fix/legacy-max-tokens-migration
fix(model-prices): migrate 38 models from legacy max_tokens to max_input_tokens/max_output_tokens
2026-03-23 13:23:43 -03:00
Krish Dholakia
63425b4cb4
Merge pull request #23910 from michelligabriele/fix/guardrail-post-call-logging
fix(proxy): post-call guardrail response not captured for logging
2026-03-23 09:21:28 -07:00
Chesars
7bf311eb97 fix(model-prices): migrate 38 models from legacy max_tokens to max_input_tokens/max_output_tokens
Models using only the legacy max_tokens field now have proper
max_input_tokens and max_output_tokens based on provider documentation.

Providers updated: OpenRouter (13), Gradient AI (13), Heroku (4),
Aleph Alpha (6), Together AI (2).
2026-03-23 13:17:01 -03:00
Chesars
d0f0cf7428 feat(bedrock): add GLM-5 and Minimax M2.5 model entries
Add base and regional Bedrock entries:
- zai.glm-5: $1.00/$3.20 per 1M tokens (us-east-1, us-west-2)
- minimax.minimax-m2.5: $0.30/$1.20 per 1M tokens (us-east-1, us-west-2)

Source: https://aws.amazon.com/bedrock/pricing/

Refs #24411, #24412
2026-03-23 13:09:27 -03:00
Chesars
238cb56077 fix: add supports_system_messages to zai.glm-5 2026-03-23 12:57:53 -03:00
Chesars
44b6f9c15b feat(bedrock): add GLM-5 and Minimax M2.5 with regional aliases
Add Bedrock model entries using the aliases feature:
- zai.glm-5: $1.00/$3.20 per 1M tokens (us-east-1, us-west-2)
- minimax.minimax-m2.5: $0.30/$1.20 per 1M tokens (us-east-1, us-west-2)

Source: https://aws.amazon.com/bedrock/pricing/

Refs #24411, #24412
2026-03-23 12:57:53 -03:00
Cesar Garcia
3f3d275e67
Merge pull request #24417 from Chesars/refactor/shared-format-mapping
refactor(responses): extract shared format mapping between Responses API and Chat Completions bridges
2026-03-23 12:55:18 -03:00
Cesar Garcia
498c113933
Merge pull request #24415 from Chesars/fix/multimodal-embedding-dimensions
fix(vertex_ai): forward dimensions parameter in multimodalembedding requests
2026-03-23 12:52:27 -03:00
Cesar Garcia
e5f5ffbe15
Merge pull request #24420 from Chesars/docs/complete-integrations-landing
docs: add missing observability integrations to View All page
2026-03-23 12:52:08 -03:00
Cesar Garcia
4399b7614d
Merge pull request #24410 from Chesars/fix/gemini-document-modality-cost
fix(gemini): include DOCUMENT modality tokens in cost calculation
2026-03-23 12:51:05 -03:00
Chesars
36df3db036 docs: add missing observability integrations to View All page
The observability "View all" page only listed 9 integrations while
27 more had documentation. Added all missing integration cards so
users can discover the full catalog from the integrations landing page.
2026-03-23 12:21:48 -03:00
Chesars
4c9f866a32 fix: avoid mutating caller's dict and return None for unrecognised provider_specific_fields 2026-03-23 11:48:23 -03:00
michelligabriele
fa7ccf0893 fix(test): add request_data param to test mock + black formatting 2026-03-23 15:43:05 +01:00
michelligabriele
9a231bd758 fix(proxy): use real request_data in Responses API streaming fallback path 2026-03-23 15:39:23 +01:00
michelligabriele
4625ccbaa2 fix(proxy): anchor metadata dict in _process_response/_process_error so pop() mutates the real dict 2026-03-23 15:39:23 +01:00
michelligabriele
d8fd9a20ed fix(proxy): address Greptile review — streaming request_data, OCR backward compat, test coverage
- Pass request_data to end-of-stream process_output_streaming_response call
- Restore inputs.update() in OCR handler for third-party guardrail providers
- Add streaming end-to-end test for guardrail logging passthrough
2026-03-23 15:39:23 +01:00
michelligabriele
ae454fd700 fix(proxy): OpenAI Moderation post-call guardrail response not captured for logging
Two independent bugs prevented post-call OpenAI Moderation guardrail
results from reaching downstream logging callbacks (Langfuse, Datadog).

Bug 1: process_output_response() created a throwaway request_data dict,
so guardrail info written by @log_guardrail_information was discarded.
Fixed by threading the real request_data from the unified guardrail
dispatcher through all 13 BaseTranslation handlers, with litellm_metadata
injection preserved for third-party guardrails (Zscaler, Prompt Security).
Also extended to process_output_streaming_response for consistency.

Bug 2: The @log_guardrail_information decorator collapsed the full
moderation API response (categories, scores, flagged status) to "allow".
Fixed by overriding _process_response/_process_error on
OpenAIModerationGuardrail to stash and log the full response, following
the established Model Armor pattern.
2026-03-23 15:39:22 +01:00
Chesars
a53ef4b574 fix: rename test to match actual API parameter name (dimension) 2026-03-23 11:38:07 -03:00
Chesars
9d8e460a5e fix: move usage mapping imports to top-level for consistency 2026-03-23 11:35:57 -03:00
Chesars
2afa65dd65 refactor(responses): extract shared format mapping between Responses API and Chat Completions bridges
Both bridges (Responses→CC and CC→Responses) independently encoded the
same field mapping knowledge. This extracts 4 shared mappings into a
single module so future changes only need to happen in one place.

Shared mappings:
- status ↔ finish_reason bidirectional dicts and functions
- response_format ↔ text.format paired conversion functions
- provider_specific_fields normalization helper
- usage field name translation (input_tokens ↔ prompt_tokens, etc.)

No behavioral changes — bridge methods now delegate to the shared module.
2026-03-23 11:20:19 -03:00
Chesars
265e096a53 fix: use correct parameter name 'dimension' for Vertex AI multimodalembedding
The Vertex AI multimodalembedding predict endpoint expects 'dimension'
(not 'outputDimensionality') in the parameters field.
2026-03-23 11:06:52 -03:00
Ben Langfeld
847c12e4f5
Update docs/my-website/docs/proxy/config_settings.md
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-23 11:06:09 -03:00
Chesars
7805f38cce fix(vertex_ai): forward dimensions parameter in multimodalembedding requests
The `dimensions` parameter was correctly mapped to `outputDimensionality`
in `optional_params` but never placed in the request body. The Vertex AI
predict endpoint expects it under a `parameters` field.

Add `parameters` dict to `VertexMultimodalEmbeddingRequest` TypedDict and
populate it from `optional_params` in `transform_embedding_request`.

Fixes #24392
2026-03-23 11:01:15 -03:00
Ben Langfeld
5a846c2e64
Correct documentation of completion_model
See https://github.com/BerriAI/litellm/issues/21554
2026-03-23 10:59:18 -03:00
Chesars
446456b855 fix(gemini): include DOCUMENT modality tokens in cost calculation
Gemini API returns a DOCUMENT modality in promptTokensDetails for PDF
inputs, but the token parser only handled TEXT, IMAGE, AUDIO, and VIDEO.
DOCUMENT tokens were silently dropped, causing cost to be undercounted
by up to 99% for PDF-heavy requests.

Map DOCUMENT tokens to text_tokens since Gemini bills documents at the
text token rate. Applied to all four modality parser loops:
promptTokensDetails, cacheTokensDetails, responseTokensDetails, and
candidatesTokensDetails.

Fixes #24375
2026-03-23 10:39:23 -03:00
Cesar Garcia
d233d6694d
Merge pull request #24372 from Chesars/fix/gemini-web-search-cost
fix(gemini): read web search cost from model_info instead of hardcode
2026-03-22 18:48:08 -03:00
Chesars
21b9c68d42 fix: remove web_search_billing_unit from OpenRouter/Perplexity entries
These providers have their own web search systems and pricing,
independent of Google's grounding billing model.
2026-03-22 18:46:39 -03:00