Commit graph

34771 commits

Author SHA1 Message Date
Yuneng Jiang
7f4651513b
chore: fixes 2026-04-04 23:32:07 -07:00
shivam
24584e5c5a pyproject to .25 2026-03-21 19:45:00 -07:00
shivam
e88e1aff15 fix: PR review - meta truthiness, BlobResourceContents mimeType, add Blob+empty meta tests
Made-with: Cursor
2026-03-21 19:44:49 -07:00
shivam
ba20699312 added support for metadata 2026-03-21 19:44:39 -07:00
joereyna
f0efa5777d fix: upgrade mcp to 1.26.0 2026-03-21 19:43:03 -07:00
Sameer Kankute
94b002066e
Merge pull request #23244 from BerriAI/litellm_skills_api_folder_name_match
fix(skills): match zip folder name to skill name in SKILL.md for Anthropic API
2026-03-10 14:11:49 +05:30
Sameer Kankute
88c4079b16 fix(skills): match zip folder name to skill name in SKILL.md for Anthropic API
Made-with: Cursor
2026-03-10 14:11:11 +05:30
Sameer Kankute
3e1f343d1a
Merge pull request #23242 from BerriAI/litellm_fix_redaction_and_charity_engine_provider
fix(tests): update cache hit redaction assertion to expect choices fo…
2026-03-10 12:27:59 +05:30
yuneng-jiang
d39a3a90b4
Merge pull request #23241 from BerriAI/litellm_/elastic-gagarin
[Feature] UI - Virtual Keys: Add refetch button, keep stale data during refetch
2026-03-09 23:52:11 -07:00
yuneng-jiang
129ed1014b [Fix] UI - Virtual Keys: Reset refetch button on error so user can retry
When a fetch fails, the button now exits the loading state instead of
staying stuck on "Fetching" indefinitely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 23:46:45 -07:00
Sameer Kankute
f33f446476
Merge pull request #23240 from BerriAI/litellm_bedrock-nova-output-config-spend-tracking
fix(bedrock): strip output_config from Converse requests; fix spend tracking redaction test
2026-03-10 12:15:06 +05:30
Sameer Kankute
30fde1de7f fix(tests): update cache hit redaction assertion to expect choices format
Made-with: Cursor
2026-03-10 12:14:24 +05:30
yuneng-jiang
9ee489863d [Feature] UI - Virtual Keys: Add refetch button and keep stale data during refetch
Show a Fetch/Fetching button next to "Showing X of Y results" that acts as
both a manual refetch trigger and a loading indicator. The "Loading keys..."
message now only appears on initial load; subsequent refetches keep the table
visible with stale data (via React Query's keepPreviousData).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 23:30:55 -07:00
yuneng-jiang
b8886568f0
Merge pull request #23236 from BerriAI/litellm_/flamboyant-leakey
[Fix] All Proxy Models Not Including Model Access Groups in Key Creation
2026-03-09 23:27:38 -07:00
Sameer Kankute
200b001633 fix(bedrock): strip output_config from Converse requests; fix spend tracking redaction test
Made-with: Cursor
2026-03-10 11:53:36 +05:30
Sameer Kankute
d9d81175b6
Merge pull request #23238 from BerriAI/litellm_mcp_openapi_tool_fixes
fix(mcp): OpenAPI tool listing and execution for relative URLs and camelCase
2026-03-10 11:48:33 +05:30
Sameer Kankute
db99fdeff3 fix(mcp): OpenAPI tool listing and execution for relative URLs and camelCase
- Fix case-insensitive tool name matching in _tool_name_matches() so that
  OpenAPI operationIds (camelCase) match lowercase registered tool names
  when filtering by allowed_tools
- Fix get_base_url() to resolve relative server URLs (e.g. /api/v3) by
  deriving full base URL from spec_path when OpenAPI spec has relative URLs
- Add tests for case-insensitive matching and filter_tools_by_allowed_tools

Made-with: Cursor
2026-03-10 11:34:23 +05:30
yuneng-jiang
1755a281bd Fix mutation bug: copy lists in get_key_models to prevent corrupting cached UserAPIKeyAuth
`all_models = user_api_key_dict.models` was creating an alias, so
`_get_models_from_access_groups` (which uses `.pop()`/`.extend()`) would
mutate the cached object in-place. Now both `.models` and `.team_models`
assignments create copies via `list()`.

Added test to verify the input is not mutated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:55:53 -07:00
yuneng-jiang
1cf191d9ad [Fix] Deduplicate model lists and remove dead assignment
Adds dedup to get_key_models and get_team_models to prevent duplicate
entries when access group member models overlap with proxy_model_list.
Removes dead assignment of all_models in get_team_models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:44:45 -07:00
Sameer Kankute
cf84072662
Merge pull request #23235 from BerriAI/litellm_fix_redaction_and_charity_engine_provider
fix(logging): preserve ModelResponse choices format in redacted standard_logging_object + add Charity Engine provider endpoint
2026-03-10 11:00:24 +05:30
yuneng-jiang
c829733200 [Fix] Include model access groups when expanding All Proxy Models
When a team has "all-proxy-models", the model list expansion now includes
model access group names so they appear in the UI key creation form.
Also fixes get_key_models not forwarding include_model_access_groups to
_get_models_from_access_groups, and removes unused _unfurl_all_proxy_models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 22:30:07 -07:00
Sameer Kankute
b08445837b fix(logging): preserve ModelResponse choices format in redacted standard_logging_object + add Charity Engine provider endpoint
- Fix perform_redaction to handle dict representation of ModelResponse (from model_dump())
- Preserve full choices structure when redacting, redact content/audio in place
- Add _redact_standard_logging_object helper for standard_logging_object field
- Update test_logging_redaction_e2e_test assertions to expect choices format
- Add charity_engine to provider_endpoints_support.json

Fixes: test_standard_logging_payload, test_standard_logging_payload_audio
Made-with: Cursor
2026-03-10 10:22:57 +05:30
Sameer Kankute
09919a81b2
Merge pull request #23234 from BerriAI/revert-23224-cursor/get-optional-params-behavior-ed4a
Revert "Get optional params behavior"
2026-03-10 10:22:10 +05:30
Sameer Kankute
504e66ccd4
Revert "fix: forward recognized OpenAI params from kwargs in completion() (#2…"
This reverts commit dd6f0d6c55.
2026-03-10 10:22:00 +05:30
Sameer Kankute
32e7b22f05
Merge pull request #23233 from BerriAI/revert-23231-litellm_cicd_100326
Revert "Fix logging tests"
2026-03-10 10:00:04 +05:30
Sameer Kankute
3f30f6a49c
Revert "Fix logging tests" 2026-03-10 09:59:53 +05:30
Sameer Kankute
9402a8b57e
Merge pull request #23231 from BerriAI/litellm_cicd_100326
Fix logging tests
2026-03-10 09:59:00 +05:30
Sameer Kankute
7542845e8d Revert "fix: strip empty text content blocks in /v1/messages endpoint (#23097)"
This reverts commit 2c738cc939.
2026-03-10 09:56:39 +05:30
Krish Dholakia
2cb47727b6 fix: forward recognized OpenAI params from kwargs in completion() (#23224)
Any param in DEFAULT_CHAT_COMPLETION_PARAM_VALUES that arrives via
completion(**kwargs) is now automatically forwarded to
get_optional_params(), even if it's not a named parameter of
completion().

Previously, get_non_default_completion_params() excluded params in
OPENAI_CHAT_COMPLETION_PARAMS (assuming they'd be forwarded via the
named-param path), while optional_param_args only contained explicitly
named params. Params like 'store' that were in the known-params list
but not named params fell through both paths and were silently dropped.

The fix adds a 7-line loop after building optional_param_args that
forwards any kwargs present in DEFAULT_CHAT_COMPLETION_PARAM_VALUES.
This means new OpenAI params only need to be added to the constants
dict — no boilerplate changes to 3+ function signatures required.

Fixes #23087

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-03-10 09:56:39 +05:30
Sameer Kankute
1ec9d984a0
Merge pull request #23232 from BerriAI/revert-23097-fix/sanitize-empty-text-blocks-v1-messages
Revert "fix: strip empty text content blocks in /v1/messages endpoint"
2026-03-10 09:53:49 +05:30
Sameer Kankute
c1b860b3c1
Revert "fix: strip empty text content blocks in /v1/messages endpoint (#23097)"
This reverts commit 2c738cc939.
2026-03-10 09:53:19 +05:30
Sameer Kankute
56be0a651f fix: add charity_engine to provider_endpoints_support.json
Made-with: Cursor
2026-03-10 09:50:37 +05:30
Sameer Kankute
325df8d62a Fix logging tests 2026-03-10 09:45:28 +05:30
Krish Dholakia
dd6f0d6c55
fix: forward recognized OpenAI params from kwargs in completion() (#23224)
Any param in DEFAULT_CHAT_COMPLETION_PARAM_VALUES that arrives via
completion(**kwargs) is now automatically forwarded to
get_optional_params(), even if it's not a named parameter of
completion().

Previously, get_non_default_completion_params() excluded params in
OPENAI_CHAT_COMPLETION_PARAMS (assuming they'd be forwarded via the
named-param path), while optional_param_args only contained explicitly
named params. Params like 'store' that were in the known-params list
but not named params fell through both paths and were silently dropped.

The fix adds a 7-line loop after building optional_param_args that
forwards any kwargs present in DEFAULT_CHAT_COMPLETION_PARAM_VALUES.
This means new OpenAI params only need to be added to the constants
dict — no boilerplate changes to 3+ function signatures required.

Fixes #23087

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-03-09 20:56:27 -07:00
tristanolive
30b82c3a0c
feat(charity_engine): add Charity Engine provider (#23223)
* feat(charity_engine): add Charity Engine provider

Charity Engine is a crowdsourced distributed computing platform that
donates processing power to charitable causes. Its inference API
provides OpenAI-compatible chat, completions, and embeddings endpoints.

* test(charity_engine): add provider config and resolution tests

Verify JSONProviderRegistry config, provider list membership,
model routing for charity_engine/<model>, and Router compatibility.

* feat(charity_engine): add Charity Engine to LlmProviders enum

Enables provider_list membership and LlmProviders.CHARITY_ENGINE
resolution required by the provider and test suite.

* fix(charity_engine): remove api_base_env to fix non-deterministic test

The CHARITY_ENGINE_API_BASE env var could override the base_url in CI,
causing test_charity_engine_provider_resolution to fail intermittently.

* fix(charity_engine): remove trailing slash from base_url
2026-03-09 20:46:43 -07:00
Maxwell Calkin
2c738cc939
fix: strip empty text content blocks in /v1/messages endpoint (#23097)
Claude's API returns assistant messages with empty text blocks
({"type": "text", "text": ""}) alongside tool_use blocks during
multi-turn tool-use conversations. These blocks are rejected when
sent back to the API with "text content blocks must be non-empty".

Sanitization already exists for other code paths (/v1/chat/completions
for both Anthropic and Bedrock), but NOT for the /v1/messages native
path. This adds the same treatment by stripping empty text blocks
from messages in async_anthropic_messages_handler before they are
forwarded to the provider.

Fixes #22930
2026-03-09 19:51:25 -07:00
Marty Sullivan
f44e67b0f1
2026-03-09-azure-updates (#23159)
* add new azure gpt models

* add versionless azure/gpt-5.4 models

* Undated azure/gpt-5.4 alias missing supports_service_tier

* indicate service tier support for azure/gpt-5.3-chat

* fix priority tier pricing for new azure/gpt models
2026-03-09 19:43:53 -07:00
Krish Dholakia
9500fc18d1
Fix TypeError: LiteLLM_Params.__init__() got multiple values for argument 'self' (#23220)
The bug occurred when user data inadvertently contained reserved Python
keywords like 'self', 'params', or '__class__' as keys. When such a dict
was unpacked via **kwargs to LiteLLM_Params() or GenericLiteLLMParams(),
Python raised TypeError because 'self' was passed both implicitly and
as a keyword argument.

The fix:
- Add a Pydantic model_validator(mode='before') to GenericLiteLLMParams
  that filters out reserved keys ('self', 'params', '__class__') before
  validation
- Move the max_retries str-to-int conversion into the same validator
- Remove the custom __init__ methods from both GenericLiteLLMParams and
  LiteLLM_Params, since the validator now handles the preprocessing
- Clean up unused VERTEX_CREDENTIALS_TYPES import

This fix applies to all classes that inherit from GenericLiteLLMParams,
including LiteLLM_Params and updateLiteLLMParams.

Added comprehensive tests in tests/test_litellm/test_litellm_params_reserved_keys.py

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-03-09 19:33:52 -07:00
yuneng-jiang
0e2aa7a5b2
Merge pull request #23213 from BerriAI/litellm_fix_flaky_audio_stream_test
[Fix] Flaky test_stream_chunk_builder_openai_audio_output_usage
2026-03-09 17:32:17 -07:00
yuneng-jiang
c1d042c2a3 Fix flaky test_stream_chunk_builder_openai_audio_output_usage
The test calls OpenAI's gpt-4o-audio-preview model which sometimes
doesn't return usage data in the streaming response. Fixed by:
- Adding @pytest.mark.flaky(retries=5, delay=2) for retry handling
- Fixing usage_obj loop to check chunk.usage is not None
- Skipping gracefully when OpenAI doesn't return usage data

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:18:00 -07:00
yuneng-jiang
6fe82d3886
Merge pull request #23211 from BerriAI/litellm_/sharp-keller
[Fix] Skills API test failing with duplicate skill name 500
2026-03-09 17:13:29 -07:00
yuneng-jiang
af8f91ef66 [Fix] Use unique skill names in Skills API test to avoid duplicate-name 500s
The test_create_skill test was consistently failing in CI with a 500 from
Anthropic because the SKILL.md frontmatter always used the same hardcoded
name (test-skill-litellm). Since test_delete_skill is permanently skipped,
skills accumulate in the CI account, and re-creating with a duplicate name
triggers an Internal Server Error on Anthropic's side.

Fix: pass a timestamp-based unique_suffix to create_skill_zip so each run
produces a distinct skill name in the zip's SKILL.md frontmatter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 17:09:15 -07:00
yuneng-jiang
4c3f873bde
Merge pull request #23198 from BerriAI/litellm_fix_nova_pro_max_tokens
[Fix] Claude Agent SDK E2E Test Nova Pro max_tokens Limit
2026-03-09 15:54:00 -07:00
yuneng-jiang
4c5659ff30
Merge pull request #23199 from BerriAI/doc_per_model_input_tokenc_check
[doc improvement] input token check
2026-03-09 15:53:15 -07:00
yuneng-jiang
dda0146a66
Merge pull request #23197 from BerriAI/litellm_fix_flaky_watsonx_prompt_test
[Fix] Flaky test_watsonx_gpt_oss_prompt_transformation
2026-03-09 15:52:02 -07:00
yuneng-jiang
d719c8a53c
Merge branch 'main' into litellm_fix_nova_pro_max_tokens 2026-03-09 15:47:53 -07:00
yuneng-jiang
2a836c7103 Fix Claude Agent SDK E2E test for Nova Pro max_tokens limit
The Claude Agent SDK sends max_tokens=32000 for unrecognized model names
(like "bedrock-nova-pro"), which exceeds Nova Pro's 10,000 limit. Enable
modify_params in the test proxy config so LiteLLM clamps max_tokens to the
model's actual limit. Also swap nova-premier to nova-pro since premier
requires provisioned throughput unavailable in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:45:24 -07:00
shivam
5534f77314 doc improvement 2026-03-09 15:39:27 -07:00
yuneng-jiang
ffd1eb18e0 Merge remote main and resolve conflicts
Kept our sync test fix, accepted upstream's xdist_group marker on
the async handler test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:34:50 -07:00
yuneng-jiang
74ed6a16ac Fix flaky test_watsonx_gpt_oss_prompt_transformation
The test was flaky under pytest-xdist parallel execution because it used
async acompletion (which runs completion() in a thread pool via
run_in_executor) and relied on shared global state (known_tokenizer_config,
iam_token_cache, module_level_client) that could be modified by other tests
running in parallel. Failures were silently swallowed by a broad try/except,
causing mock_post.call_count to remain 0.

Fix:
- Convert from async acompletion to sync completion, matching every other
  test in the file. The test's intent is verifying prompt transformation,
  not async behavior.
- Use monkeypatch.setitem for known_tokenizer_config to ensure proper
  teardown isolation.
- Remove unnecessary mock layers (async template fetchers, iam_token_cache
  pre-population, mock completion response) that were only needed for the
  async code path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 15:32:30 -07:00