Commit graph

36177 commits

Author SHA1 Message Date
ryan-crabbe
1da02b66f6
Merge branch 'main' into litellm_audit_log_s3_export 2026-03-20 16:39:54 -07:00
yuneng-jiang
e6e3085845
Merge pull request #24258 from joereyna/fix/anthropic-file-content-test-mock
fix(test): mock get_auth_header instead of get_api_key in anthropic file content test
2026-03-20 16:14:59 -07:00
yuneng-jiang
e678ddea43 Fix unreachable special MCP server name guard in add_mcp_server
The special name check (all_team_servers, all_proxy_servers) was an elif
after the server_id-is-not-None check, making it unreachable since special
names are non-None strings. Split into separate if blocks so the special
name guard runs before the duplicate-ID check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 16:12:48 -07:00
joereyna
f0e0d98f86 fix(test): mock get_auth_header instead of get_api_key in anthropic file content test 2026-03-20 16:07:09 -07:00
yuneng-jiang
6862930538 Revert test to match reverted team MCP manager feature
The team MCP manager feature was reverted in PR #24255, so the test
needs to go back to the original single auth failure test that expects
a 403 for non-admin users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 15:44:00 -07:00
yuneng-jiang
1fad0d557d
Merge pull request #24255 from BerriAI/revert-24171-litellm_/awesome-dhawan
Revert "[Feature] Team MCP Server Manager Role"
2026-03-20 15:42:10 -07:00
yuneng-jiang
c9683c6f97
Revert "[Feature] Team MCP Server Manager Role" 2026-03-20 15:41:57 -07:00
ryan-crabbe
72c307df0e
Merge pull request #24217 from BerriAI/litellm_ryan_march_18
feat: add control plane for multi-proxy worker management
2026-03-20 14:05:19 -07:00
Ryan Crabbe
541863a566 Merge branch 'litellm_ryan_march_18' of https://github.com/BerriAI/litellm into litellm_ryan_march_18 2026-03-20 13:58:32 -07:00
Ryan Crabbe
6f81eb01fe fix: apply Black formatting to ui_sso.py 2026-03-20 13:57:26 -07:00
ryan-crabbe
59b4a05782
Merge branch 'main' into litellm_ryan_march_18 2026-03-20 13:36:37 -07:00
yuneng-jiang
ba4aae02c7 Fix outdated MCP server auth test for team MCP manager flow
The test_create_mcp_server_auth_failure test expected a 403 for non-admin
users, but the team MCP manager feature changed the auth flow to first
check for team_id (400) before checking permissions. Split into two tests:
one for missing team_id (400) and one for non-manager rejection (403).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 13:10:10 -07:00
yuneng-jiang
5d317c3a5c Merge remote-tracking branch 'origin' into litellm_yj_march_19_2026 2026-03-20 12:59:21 -07:00
yuneng-jiang
50f88c8642
Merge pull request #24243 from BerriAI/litellm_/gifted-spence
[Docs] Add missing team_member_budget_duration param to new_team docstring
2026-03-20 12:51:13 -07:00
yuneng-jiang
4d198558c8
Merge branch 'main' into litellm_/gifted-spence 2026-03-20 12:44:20 -07:00
yuneng-jiang
404c68c74b Add missing team_member_budget_duration param to new_team docstring
Fixes CI failure in test_api_docs.py which validates that all Pydantic
model fields are documented in endpoint docstrings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 12:42:35 -07:00
yuneng-jiang
3ea69c9539 Merge remote-tracking branch 'origin' into litellm_yj_march_19_2026 2026-03-20 12:37:26 -07:00
yuneng-jiang
b36269e2c1
Merge pull request #24171 from BerriAI/litellm_/awesome-dhawan
[Feature] Team MCP Server Manager Role
2026-03-20 12:30:50 -07:00
yuneng-jiang
700fd86de9 Fix importorskip guard and add LiteLLM_TeamTableCachedObj import
- Add pytest.importorskip("mcp") at module level so tests skip cleanly
  in CI environments without the mcp package (instead of ImportError)
- Import LiteLLM_TeamTableCachedObj into MCP_AVAILABLE block so type
  annotations resolve for static analysis and get_type_hints()
- Remove string quotes from type annotations now that the import exists

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 12:13:09 -07:00
yuneng-jiang
c6ffda9671
Merge pull request #23484 from michelligabriele/fix/team-member-budget-duration-on-create
fix(proxy): add team_member_budget_duration to NewTeamRequest
2026-03-20 11:56:30 -07:00
yuneng-jiang
5927a77a14
Merge branch 'main' into fix/aggregated-activity-entity-breakdown 2026-03-20 11:50:59 -07:00
yuneng-jiang
f884e4ac66
Merge branch 'main' into fix/team-member-budget-duration-on-create 2026-03-20 11:48:08 -07:00
ryan-crabbe
d381b58570
Merge branch 'main' into litellm_ryan_march_18 2026-03-20 11:44:45 -07:00
Sameer Kankute
a05824d9ba Fix code qa 2026-03-21 00:14:33 +05:30
BillionToken
78139472a1
fix(moonshot): preserve reasoning_content on Pydantic Message objects in multi-turn tool calls (#23828)
* fix(moonshot): preserve reasoning_content on Pydantic Message objects in multi-turn tool calls

The condition 'reasoning_content not in msg' doesn't work correctly for
Pydantic Message objects because they don't support the 'in' operator
like dicts do. This caused reasoning_content to be stripped from
assistant messages in multi-turn conversation history.

Changed the condition to use msg.get('reasoning_content') instead,
which works correctly for both dicts and Pydantic models.

Fixes #23765

* added newline eof

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

* Update tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.py

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

* Simplify assertions in test_moonshot_chat_transformation

Removed redundant assertions for non-assistant messages.

---------

Co-authored-by: BillionClaw <267901332+BillionClaw@users.noreply.github.com>
Co-authored-by: Aarish Alam <arishalam121@gmail.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-21 00:09:17 +05:30
Geoffray Viossat
00dd984415
fix(whisper): correct output_cost_per_second pricing and cost calculation (#23842)
- Set output_cost_per_second to 0.0 (was 0.0001) for whisper-1 and
  azure/whisper-1: transcription is billed on input duration only,
  not output duration
- Fix cost_per_second() in openai/cost_calculation.py: change elif to if
  so input_cost_per_second is evaluated independently of output_cost_per_second,
  and remove the erroneous completion_cost = 0.0 assignment that masked
  any previously-set output cost
- Add TestCostPerSecondArithmetic unit tests covering both cost fields,
  the None-guard, and zero-duration edge case

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 00:02:15 +05:30
Sameer Kankute
af7e2e6878 Fix ruff PLR0915 error 2026-03-21 00:01:48 +05:30
Jayachander Reddy kandakatla
714c1b80e1
docs(pricing): add official source links for Azure DeepSeek & Cohere models (#20181)
Added 'source' keys to Azure DeepSeek v3.2(Standard & Speciale) and Cohere Rerank 4.0 (Pro & Fast) entries for pricing verification.
2026-03-20 23:55:53 +05:30
Krish Dholakia
e8ec9eb44a
Merge pull request #24220 from milan-berri/fix/streaming-metadata-hidden-params
fix(logging): merge hidden_params into metadata for streaming requests
2026-03-20 11:25:45 -07:00
Sameer Kankute
45f322caef Fix ruff PLR0915 error 2026-03-20 23:52:54 +05:30
Sameer Kankute
8cb3a0f1d2 Fix ruff PLR0915 error 2026-03-20 23:42:07 +05:30
Sameer Kankute
7c168ab173 Fix gpt-5.4 using remote model cost map for tests 2026-03-20 23:35:00 +05:30
Sameer Kankute
92e98a2fd5 Fix test_aaamodel_prices_and_context_window_json_is_valid 2026-03-20 23:35:00 +05:30
Sameer Kankute
2a69426e2f Fix mypy and code qa issues 2026-03-20 23:34:59 +05:30
Sameer Kankute
0673c57fef
Merge pull request #23939 from Sameerlite/Sameerlite/azure-ai-annotations
fix(azure-ai-agents): preserve annotations in Bing Search grounding responses
2026-03-20 23:33:08 +05:30
Sameer Kankute
8d843fd93b
Merge pull request #23957 from Sameerlite/litellm_vertex-cancel-batch
fix(vertex-ai): support batch cancel via Vertex API
2026-03-20 23:32:50 +05:30
Christopher Baer
589c6cdad0
fix(gemini-embeddings): convert task_type to camelCase taskType for Gemini API (#24191)
The Gemini REST API documents the embedding task type parameter as
camelCase `taskType`. The existing transformation functions convert
`dimensions` to `outputDimensionality` but miss the parallel
`task_type` to `taskType` conversion. This adds that conversion to
both `transform_openai_input_gemini_content` (batchEmbedContents path)
and `transform_openai_input_gemini_embed_content` (embedContent path).

Fixes #24190
2026-03-20 22:32:22 +05:30
Klaus
330ef5e579 docs: add Gemini/Vertex AI to prompt caching docs
Add Google AI Studio (gemini/) and Vertex AI (vertex_ai/) as
supported providers for prompt caching. Same cache_control format
as Anthropic works - LiteLLM translates it to Google's context
caching API under the hood.

Includes SDK + proxy examples for both providers.
2026-03-20 09:48:31 -07:00
milan-berri
5372334233
Merge branch 'main' into fix/streaming-metadata-hidden-params 2026-03-20 16:32:36 +00:00
Milan
f36a59d196 fix(logging): merge hidden_params into metadata for streaming completions
Non-streaming paths call _process_hidden_params_and_response_cost; streaming
assembles the full response later and skipped that, so litellm_params.metadata
 lacked hidden_params (e.g. response_cost for OTEL/OpenSearch).

- Add _merge_hidden_params_from_response_into_metadata and call it from
  success_handler and async_success_handler after cost is set, before
  _build_standard_logging_payload.
- Unit tests for merge helper.

Tests: pytest tests/test_litellm/litellm_core_utils/test_litellm_logging.py
Made-with: Cursor
2026-03-20 16:27:41 +00:00
yuneng-jiang
1cd7a48c33 Add tests for edit and delete MCP server manager paths
Addresses Greptile feedback about missing integration tests for PUT/DELETE
when invoked by mcp_server_manager role. Adds tests for edit success/403,
delete success with team cleanup/403, and the _remove_mcp_server_from_team
helper directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 09:19:53 -07:00
Krish Dholakia
523fbed233
Merge pull request #24199 from stias/fix/bedrock-count-tokens-custom-endpoint
fix(bedrock): respect api_base and aws_bedrock_runtime_endpoint in count_tokens endpoint
2026-03-20 09:10:30 -07:00
yuneng-jiang
b8c9bf7d25 refactor: extract _auto_assign and _remove helpers, use team_endpoints helper
- Replace raw prisma_client.db.litellm_teamtable.update with
  handle_update_object_permission from team_endpoints (follows
  established helper-function pattern)
- Extract _auto_assign_mcp_server_to_team and
  _remove_mcp_server_from_team helpers for reuse and testability
- Update tests to mock at the correct boundaries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 09:05:18 -07:00
Seokjun Yang
d3afaf613d
Update tests/litellm_utils_tests/test_bedrock_token_counter.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-20 22:21:22 +09:00
Seokjun Yang
eb733702fc
Update tests/litellm_utils_tests/test_bedrock_token_counter.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-20 22:21:15 +09:00
Sameer Kankute
9272483f77
Merge pull request #24015 from Sameerlite/litellm_fix_ensure_alternating_roles
Litellm fix ensure alternating roles
2026-03-20 18:37:23 +05:30
Sameer Kankute
8da3efdfbe Fix code qa and mypy lint issues 2026-03-20 18:21:01 +05:30
Sameer Kankute
de217150d1
Merge pull request #24110 from BerriAI/Sameerlite/model-level-affinity
feat(router): add per-model-group deployment affinity
2026-03-20 18:05:46 +05:30
Sameer Kankute
55d815b84c
Merge pull request #23854 from milan-berri/docs/encrypted-content-affinity-min-version
docs: note min version for encrypted_content_affinity
2026-03-20 17:42:02 +05:30
Sameer Kankute
8ad2068711
Merge pull request #24106 from BerriAI/Sameerlite/pre-ratelimit-bg
fix(polling): check rate limits before creating polling ID
2026-03-20 17:41:24 +05:30