Commit graph

33821 commits

Author SHA1 Message Date
Yuneng Jiang
4cc879a223
chore: fixes 2026-04-04 22:57:35 -07:00
Cursor Agent
bba150cb70 chore: remove dev_config.yaml from tracked files
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-02-28 03:21:01 +00:00
Cursor Agent
90c75b2876 fix: set created_by=None on mock keys in existing expand_user test
The new created_by resolution logic collects created_by IDs from keys.
MagicMock objects return truthy values for unset attributes, so the
existing test needed explicit created_by=None on its mock keys.

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-02-28 02:59:09 +00:00
Cursor Agent
dbf8abed8c feat: resolve Created By UUIDs to user emails in Virtual Keys table
- Backend: extend expand=user in /key/list to also resolve created_by
  user IDs and return created_by_user objects with user_id and user_email
- Frontend: update VirtualKeysTable and DeletedKeysTable to show user
  email instead of raw UUID in the Created By column
- Frontend: pass expand=user by default in useKeys and useDeletedKeys hooks
- Add backend and frontend tests for the new behavior

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-02-28 02:57:24 +00:00
Ishaan Jaff
8ce358e303
[Feat] Agent RBAC Permission Fix - Ensure Internal Users cannot create agents (#22329)
* fix: enforce RBAC on agent endpoints — block non-admin create/update/delete

- Add /v1/agents/{agent_id} to agent_routes so internal users can
  access GET-by-ID (previously returned 403 due to missing route pattern)
- Add _check_agent_management_permission() guard to POST, PUT, PATCH,
  DELETE agent endpoints — only PROXY_ADMIN may mutate agents
- Add user_api_key_dict param to delete_agent so the role check works
- Add comprehensive unit tests for RBAC enforcement across all roles

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* fix: mock prisma_client in internal user get-agent-by-id test

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* feat(ui): hide agent create/delete controls for non-admin users

Match MCP servers pattern: wrap '+ Add New Agent' button in
isAdmin conditional so internal users see a read-only agents view.
Delete buttons in card and table were already gated.
Update empty-state copy for non-admin users.
Add 7 Vitest tests covering role-based visibility.

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-02-27 18:32:39 -08:00
Julio Quinteros Pro
9278a311ca
Merge pull request #22333 from BerriAI/fix/bedrock-parallel-tool-calls-map-params
fix(bedrock): restore parallel_tool_calls mapping in map_openai_params
2026-02-27 23:17:05 -03:00
Julio Quinteros Pro
b192ba797e
Merge pull request #22335 from BerriAI/fix/claude-code-plugin-migration
fix(db): add missing migration for LiteLLM_ClaudeCodePluginTable
2026-02-27 23:14:20 -03:00
Julio Quinteros Pro
332dc32299
Merge pull request #22334 from BerriAI/fix/anthropic-passthrough-azure-test
fix(test): update Azure pass-through test after Responses API routing change
2026-02-27 23:09:04 -03:00
Julio Quinteros Pro
9b20a050ec
Merge pull request #22332 from BerriAI/fix/realtime-guardrail-test-assertions
fix(test): update realtime guardrail test assertions for voice violation behavior
2026-02-27 23:08:04 -03:00
Julio Quinteros Pro
2ac5365e06 fix: update stale docstring to match guardrail voicing behavior
Addresses Greptile review feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 23:04:43 -03:00
Julio Quinteros Pro
d292ed7702 fix(db): add missing migration for LiteLLM_ClaudeCodePluginTable
PR #22271 added the LiteLLM_ClaudeCodePluginTable model to
schema.prisma but did not include a corresponding migration file,
causing test_aaaasschema_migration_check to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 23:02:17 -03:00
Ishaan Jaff
15fcd90b9c
feat: add in_flight_requests metric to /health/backlog + prometheus (#22319)
* feat: add in_flight_requests metric to /health/backlog + prometheus

* refactor: clean class with static methods, add tests, fix sentinel pattern

* docs: add in_flight_requests to prometheus metrics and latency troubleshooting
2026-02-27 18:00:50 -08:00
Julio Quinteros Pro
273994b996 fix(test): update Azure pass-through test to mock litellm.completion
Commit 99c62ca40e removed "azure" from _RESPONSES_API_PROVIDERS,
routing Azure models through litellm.completion instead of
litellm.responses. The test was not updated to match, causing it
to assert against the wrong mock.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 22:59:38 -03:00
Julio Quinteros Pro
aa899b504f fix(bedrock): restore parallel_tool_calls mapping in map_openai_params
The revert in 8565c70e53 removed the parallel_tool_calls handling from
map_openai_params, and the subsequent fix d0445e1e33 only re-added the
transform_request consumption but forgot to re-add the map_openai_params
producer that sets _parallel_tool_use_config. This meant parallel_tool_calls
was silently ignored for all Bedrock models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 22:56:38 -03:00
Julio Quinteros Pro
9a48c8e36a fix(test): update realtime guardrail test assertions for voice violation behavior
Tests were asserting no response.create/conversation.item.create sent to
backend when guardrail blocks, but the implementation intentionally sends
these to have the LLM voice the guardrail violation message to the user.

Updated assertions to verify the correct guardrail flow:
- response.cancel is sent to stop any in-progress response
- conversation.item.create with violation message is injected
- response.create is sent to voice the violation
- original blocked content is NOT forwarded

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 22:53:09 -03:00
Dylan Duan
af6fe184fb
docs: update AssemblyAI docs with Universal-3 Pro, Speech Understanding, and LLM Gateway (#21130)
* docs: update AssemblyAI docs with Universal-3 Pro, Speech Understanding, and LLM Gateway provider config

* feat: add AssemblyAI LLM Gateway as OpenAI-compatible provider
2026-02-27 17:24:48 -08:00
ryan-crabbe
e445a32c4c
Merge pull request #22324 from BerriAI/litellm_prometheus_child_exit_cleanup
Add Prometheus child_exit cleanup for gunicorn workers
2026-02-27 16:51:19 -08:00
Ryan Crabbe
4fa6742b01 Add Prometheus child_exit cleanup for gunicorn workers
When a gunicorn worker exits (e.g. from max_requests recycling), its
per-process prometheus .db files remain on disk. For gauges using
livesum/liveall mode, this means the dead worker's last-known values
persist as if the process were still alive. Wire gunicorn's child_exit
hook to call mark_process_dead() so live-tracking gauges accurately
reflect only running workers.
2026-02-27 16:11:15 -08:00
Rahul Dhanawade
64c85dbc9f
Fix/claude code plugin schema (#22271)
* fix: add missing LiteLLM_ClaudeCodePluginTable to schema.prisma

- Claude Code Plugin Marketplace endpoints (/claude-code/marketplace.json,
  /claude-code/plugins) were returning 500 errors because
  LiteLLM_ClaudeCodePluginTable model was missing from both schema.prisma files
- Prisma client was generated without this table causing AttributeError:
  'Prisma' object has no attribute 'litellm_claudecodeplugintable'
- Added missing model definition to root schema.prisma and
  litellm/proxy/schema.prisma

Fixes #21310

* test: add regression test for LiteLLM_ClaudeCodePluginTable schema

* fix: address greptile review - add @updatedAt, clean up test imports
2026-02-27 15:59:37 -08:00
yuneng-jiang
03720ec08c
Merge pull request #22315 from BerriAI/litellm_projects_page
[Feature] UI - Projects: Add Projects page with list and create flows
2026-02-27 15:45:01 -08:00
yuneng-jiang
7cffd77d68
Merge pull request #22323 from BerriAI/litellm_project_list_timestamps
[Fix] Include timestamps in /project/list response
2026-02-27 15:44:02 -08:00
yuneng-jiang
8bb6457471 [Fix] Include created_at and updated_at in /project/list response
The /project/list endpoint was not returning created_at and updated_at timestamps because these fields were not defined in LiteLLM_ProjectTable. Added these fields to the model so FastAPI includes them in the response (values come from the database). This allows the UI to display project creation and last-updated times.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-27 15:41:03 -08:00
Cesar Garcia
7d084dfb9d
Merge pull request #20525 from Chesars/docs/opus-4-6-openrouter-and-1m-context
docs: add OpenRouter Opus 4.6 to model map and update Claude Opus 4.6 docs
2026-02-27 19:07:31 -03:00
Chesars
5628ba0831 docs: remove openrouter/anthropic/claude-opus-4.6 from backup JSON
Model should only be in the main cost map, not the backup.
2026-02-27 19:05:33 -03:00
Chesars
c47d219806 docs: add openrouter/anthropic/claude-opus-4.6 to main model cost map 2026-02-27 19:04:49 -03:00
Cesar Garcia
e05865fc1f
Merge pull request #20520 from Chesars/feat/add-openrouter-native-models
feat(model_prices): add OpenRouter native models to model cost map
2026-02-27 18:54:24 -03:00
Chesars
b5cd2820b1 Merge upstream/main into feat/add-openrouter-native-models
Resolve conflict in model_prices_and_context_window.json by keeping both
the new minimax-m2.5 model from upstream and the OpenRouter native models
from this branch.
2026-02-27 18:40:56 -03:00
yuneng-jiang
2613277ede [Feature] UI - Projects: Add Projects page with list and create flows
Add a new Projects page under ACCESS CONTROL in the left nav, positioned
between Teams and Internal Users. Projects sit between teams and keys in
the hierarchy for use-case management.

- ProjectsPage with Ant Design table (list, search, pagination)
- CreateProjectModal with team-scoped model selection
- React-query hooks for /project/list and /project/new
- New badge on Projects, removed from Access Groups
- Page metadata entry for test compliance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-27 13:31:17 -08:00
Cesar Garcia
88c465b5ef
Merge pull request #20102 from Chesars/xai-deprecation-dates
Add deprecation dates for xAI grok-2-vision-1212 and grok-3-mini models
2026-02-27 18:11:53 -03:00
ryan-crabbe
d9cfae9092
Merge pull request #22313 from BerriAI/tests/add_llmclientcache_regression_tests
Tests: add llmclientcache regression tests
2026-02-27 13:04:02 -08:00
Ryan Crabbe
dce597b806 Close httpx clients after assertions to prevent resource leaks 2026-02-27 12:58:33 -08:00
Ryan Crabbe
0b7e9a1971 Add e2e tests: httpx clients survive LLMClientCache eviction
Tests go through the real get_async_httpx_client() code path to verify
clients remain usable after both capacity eviction and TTL expiry.
Regression tests for PR #22247.
2026-02-27 12:43:08 -08:00
Ryan Crabbe
6490ad1d48 Revert "Add LLMClientCache regression tests for httpx client eviction safety"
This reverts commit ad9c70ec5d.
2026-02-27 12:43:03 -08:00
Cesar Garcia
1943e02cc7
Merge pull request #21582 from Chesars/fix/publicai-apertus-function-calling
fix(models): function calling for PublicAI Apertus models
2026-02-27 17:38:03 -03:00
Cesar Garcia
ea5d551525
Merge pull request #22304 from Chesars/feat/add-gpt-realtime-1.5-model
feat(models): add gpt-realtime-1.5 to model cost map
2026-02-27 16:38:16 -03:00
Cesar Garcia
d8fa43a0cc
Merge pull request #22303 from Chesars/feat/add-gpt-audio-1.5-model
feat(models): add gpt-audio-1.5 to model cost map
2026-02-27 16:37:31 -03:00
ryan-crabbe
dc97e2f714
Merge pull request #22306 from BerriAI/tests/add_llmclientcache_regression_tests
Add LLMClientCache regression tests for httpx client eviction safety
2026-02-27 11:21:38 -08:00
yuneng-jiang
98e944c0cf
Merge pull request #22253 from BerriAI/litellm_access_group_sync
[Feature] Access group CRUD: Bidirectional team/key sync
2026-02-27 11:14:46 -08:00
Ryan Crabbe
ad9c70ec5d Add LLMClientCache regression tests for httpx client eviction safety
Regression tests for PR #22247 — ensures cache eviction (capacity and TTL)
does not close httpx clients that are still in use.
2026-02-27 11:14:13 -08:00
Chesars
1ca4dd8542 fix: gpt-audio-1.5 only supports /v1/chat/completions endpoint 2026-02-27 16:11:15 -03:00
Chesars
da73e54b1b fix: gpt-realtime-1.5 only supports /v1/realtime endpoint
Remove /v1/chat/completions and /v1/responses from supported_endpoints
and revert the audio model detection change since gpt-realtime-1.5 does
not go through Chat Completions.
2026-02-27 16:10:01 -03:00
Chesars
c7ab631bb0 fix(audio): detect gpt-realtime models as audio-capable for Chat Completions
gpt-realtime-1.5 supports Chat Completions with audio params but
is_model_gpt_audio_model only checked for "audio" in the model name.
Add "realtime" check so the audio parameter is passed through correctly.
2026-02-27 16:06:10 -03:00
Chesars
1f887547f6 feat(models): add gpt-realtime-1.5 to model cost map
New OpenAI realtime model released 2026-02-23. Adds pricing and capability
metadata for gpt-realtime-1.5 (32K context, 4K output, audio/image/text I/O).
Unlike gpt-realtime, this model also supports Chat Completions and Responses
endpoints (not just WebSocket).

Closes #22266
2026-02-27 16:01:09 -03:00
Gaurav Singh
29bb73ffca
fix(mcp): strip stale mcp-session-id header to prevent 400 in multi-worker deployments (#20992) (#21417)
In a multi-worker Uvicorn setup, a client that reconnects to a different
worker sends an mcp-session-id that the new worker has never seen.  The
MCP SDK returns 400 because the session is unknown.

Fix: add _handle_stale_mcp_session() which inspects the inbound
mcp-session-id header before the request reaches the SDK.  If the
session is not in this worker's _server_instances:
  - Non-DELETE: strip the header so the SDK creates a fresh session
  - DELETE: return 200 immediately (idempotent, session already gone)

No new dependencies, no Redis, no latency added to the hot path.

Fixes https://github.com/BerriAI/litellm/issues/20992
2026-02-27 10:59:08 -08:00
Chesars
1144d05cba feat(models): add gpt-audio-1.5 to model cost map
New OpenAI audio model released 2026-02-23. Adds pricing and capability
metadata for gpt-audio-1.5 (128K context, 16K output, audio I/O).

Closes #22269
2026-02-27 15:57:56 -03:00
Noah Nistler
d13508c1c5
Enable local file support for OCR (#22133)
* [Docs] Enable local file support

Implemented internal handling for converting file-type documents to the required format for OCR processing, ensuring seamless integration with various providers.

* Refactor OCR file handling and improve security checks

Removed deprecated MIME type mapping and file conversion functions, replacing them with updated implementations. Enhanced security by rejecting 'file' document types in JSON requests, ensuring file uploads are handled via multipart/form-data. Updated tests to reflect these changes and ensure proper functionality.

* Enhance MIME type validation in OCR processing

Added a regular expression check to validate MIME types in the convert_file_document_to_url_document function, raising a ValueError for invalid types. Updated tests to ensure proper error handling for unsupported MIME types.

* Enhance type safety in OCR file handling

Added type casting for the uploaded file in the _parse_multipart_form function to ensure proper handling of UploadFile instances. This change improves type safety and reduces potential runtime errors during file processing.

* Refactor MIME type handling in document uploads

Updated the MIME type extraction logic to strip parameters from the Content-Type header, ensuring only the base type is used. Added tests to verify that MIME parameters are correctly handled and stripped in various scenarios.

* Update OCR documentation for MIME type recommendations and remove unnecessary tips

Clarified the recommended usage of MIME types for raw bytes in document uploads. Simplified the documentation by removing the tip about multipart file uploads from tools like Postman, ensuring a more concise and focused guide.

* Enhance multipart form handling in OCR endpoints

Updated the _parse_multipart_form function to ignore both 'file' and 'document' fields during form parsing, ensuring that the document built from the uploaded file is not overridden. Added a new test to verify that injected document fields do not affect the constructed document, improving security and robustness of the file upload process.
2026-02-27 10:50:02 -08:00
Sameer Kankute
adb9d94833
Merge pull request #22293 from BerriAI/litellm_27_02_lock2
Fix: poetry lock
2026-02-27 21:40:18 +05:30
Sameer Kankute
3bec6f5a9a Fix: poetry lock 2026-02-27 21:39:32 +05:30
Sameer Kankute
ec8aaa9d2f
Merge pull request #22155 from BerriAI/litellm_fix_image
[Bug]Add ChatCompletionImageObject in OpenAIChatCompletionAssistantMessage
2026-02-27 21:18:55 +05:30
Sameer Kankute
63c9b3a137
Merge pull request #22087 from BerriAI/litellm_fix_anthropic_responses
Add v1 for anthropic responses transformation
2026-02-27 21:18:04 +05:30