Commit graph

6027 commits

Author SHA1 Message Date
Sameer Kankute
3d6b7f0d3d Add background health checks to db 2025-12-05 14:27:37 +05:30
yuneng-jiang
b9b5d638c8
Merge pull request #17524 from BerriAI/litellm_team_user_settings_fix
[Fix] Select in Edit Membership Modal
2025-12-04 23:13:13 -08:00
yuneng-jiang
37bfe65bdd Adding screenshot to debug 2025-12-04 23:05:00 -08:00
yuneng-jiang
50283a00a3 e2e fix 2025-12-04 22:51:52 -08:00
Sameer Kankute
acc0b5fe27
Merge pull request #17362 from BerriAI/litellm_vertex-bge-cherrypick
[Feat] VertexAI - Add BGE Embeddings support
2025-12-05 11:53:42 +05:30
Sameer Kankute
99fd96687f Fix vector store configuration synchronization failure 2025-12-05 11:46:14 +05:30
Krish Dholakia
51cc102c30
fix(unified_guardrail.py): support during_call event type for unified guardrails (#17514)
* fix(unified_guardrail.py): support during_call event type for unified guardrails

allows guardrails overriding apply_guardrails to work 'during_call'

* feat(generic_guardrail_api.py): support new 'tool_calls' field for generic guardrail api

returns the tool calls emitted by the LLM API to the user

* fix(generic_guardrail_api.py): working anthropic /v1/messages tool call response

send llm tool calls to guardrail api when called via `/v1/messages` API

* fix(responses/): run generic_guardrail_api on responses api tool call responses

* fix: fix tests

* test: fix tests

* fix: fix tests
2025-12-04 22:06:13 -08:00
Cesar Garcia
316f7671a9
fix(gemini): handle partial JSON chunks after first valid chunk (#17496)
* fix(gemini): allow JSON accumulation on any chunk, not just first

* test(gemini): add tests for partial JSON chunk handling
2025-12-04 22:01:59 -08:00
Kristian Brünn
63fae79493
fix(sql): Optimize SpendLogs queries to use timestamp filtering for index usage (#17504)
* fix: optimize SpendLogs queries to use timestamp filtering (#17487)

* use timestamptz & enhance test
2025-12-04 21:52:57 -08:00
Devaj Mody
48b5100c18
fix(guardrails): mask all matching keywords in content filter (#17521)
Fixes #17517

  - Fixed bug where only the first matching blocked keyword was masked
  - Now iterates through ALL blocked keywords and masks each one
  - Added 3 regression tests for multiple keyword masking
2025-12-04 21:50:15 -08:00
yuneng-jiang
a96677c299 Fix /get/config/callbacks callback variables 2025-12-04 21:48:49 -08:00
Sameer Kankute
a6006e698c Add support for cursor BYOK with its own configuration 2025-12-05 09:34:49 +05:30
Dominic Feliton
6af693de36
(fix): empty response + vllm streaming (#17516)
* Fix empty response + vllm streaming

* Add unit test
2025-12-04 19:24:28 -08:00
Xianzong Xie
52d784b763 fix: correct mock setup for delete_polling test
- Use Mock instead of AsyncMock for init_async_client (sync method)

Committed-By-Agent: cursor
2025-12-04 18:00:28 -08:00
Ishaan Jaff
b2e8d3fd42
[Feat] Allow adding OpenAI compatible chat providers using .json + add public ai provider (#17448)
* feat: Add JSON config for OpenAI-compatible providers

Co-authored-by: ishaan <ishaan@berri.ai>

* feat: Add simple JSON config for OpenAI-compatible providers

Co-authored-by: ishaan <ishaan@berri.ai>

* feat: Implement JSON-based provider config and migrate PublicAI

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* Checkpoint before follow-up message

Co-authored-by: ishaan <ishaan@berri.ai>

* docs fix

* undo change

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ishaan <ishaan@berri.ai>
2025-12-04 17:59:25 -08:00
Xianzong Xie
03ee5c4489 test: add comprehensive tests for polling via cache feature
- Add TestPollingConditionChecks: tests for all condition combinations
- Add TestStreamingEventParsing: tests for OpenAI streaming event handling
- Add TestEdgeCases: tests for empty model, multiple slashes, edge cases

Total test count increased significantly for better coverage.

Committed-By-Agent: cursor
2025-12-04 17:55:38 -08:00
Xianzong Xie
a8a38778a3 fix: resolve provider from router for polling_via_cache
- Fix bug where model names without slash (e.g., 'gpt-5') couldn't
  match providers in polling_via_cache list
- Look up model in llm_router.model_name_to_deployment_indices
- Check ALL deployments for matching provider (supports load balancing)
- Check custom_llm_provider first, then extract from model string
- Add comprehensive tests for provider resolution logic

Committed-By-Agent: cursor
2025-12-04 17:47:30 -08:00
yuneng-jiang
de8f0a3409 Ensure fresh data to prevent race condition in scim v2 2025-12-04 17:04:59 -08:00
Ishaan Jaff
8f592088ed
[Feat] Agent Access Control - Enforce Allowed agents by key, team + add agent access groups on backend (#17502)
* init schema.prisma

* init LiteLLM_ObjectPermissionTable with agents and agent_access_groups

* TestAgentRequestHandler

* refatctor agent list

* add AgentRequestHandler

* fix agent access controls by key/team

* feat - new migration for LiteLLM_AgentsTable

* fix add LiteLLM_ObjectPermissionBase with agent and agent groups

* add agent routes to llm api routes

* add agent routes as llm route
2025-12-04 16:31:00 -08:00
Ishaan Jaff
e3116da653
feat: Add /global/spend/tags to admin viewer routes (#17501)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ishaan <ishaan@berri.ai>
2025-12-04 14:43:33 -08:00
Raghav Jhavar
72eb4c3a1c
🆕 feat: support routing to only websearch supported deployments (#17500)
* support routing to only websearch supported deployments

* add docs
2025-12-04 14:18:20 -08:00
Xianzong Xie
748bb6d5f5 test: add tests for all ResponsesAPIResponse fields
- Add test_update_state_with_all_responses_api_fields to verify all fields
- Add test_update_state_preserves_existing_fields to verify partial updates

Committed-By-Agent: cursor
2025-12-04 14:15:06 -08:00
Yannay Hammer
2627f0d519
Fix aim security guardrail tests (#17499) 2025-12-04 13:29:20 -08:00
yuneng-jiang
2e65c464ad Adding tests 2025-12-04 12:36:15 -08:00
Sameer Kankute
31f1bf0539
Merge pull request #17485 from BerriAI/litellm_ragflow_test_fix
fix: test_default_api_base for ragfow
2025-12-04 21:57:18 +05:30
Sameer Kankute
f2c0029939
Merge pull request #17470 from BerriAI/litellm_batches_bedrock_content
Add support for file content download for bedrock batches
2025-12-04 21:57:04 +05:30
Sameer Kankute
5b4542304d
Merge pull request #17461 from BerriAI/litellm_qwen2_imported_model_support
Add support for bedrock qwen 2 imported model
2025-12-04 21:56:22 +05:30
Sameer Kankute
6751badf3a fix: test_default_api_base for ragfow 2025-12-04 21:49:33 +05:30
Sameer Kankute
edd392b50d Add support for file content download for bedrock batches 2025-12-04 13:27:53 +05:30
yuneng-jiang
ad86dfbf7d
Merge pull request #17451 from BerriAI/litellm_new_login_page_sso_changes
[Feature] Add Auto Redirect to SSO to New Login Page
2025-12-03 23:53:21 -08:00
yuneng-jiang
59b32c28a8 Change selector in test 2025-12-03 23:37:15 -08:00
yuneng-jiang
0483336c53 change test to follow other logins 2025-12-03 23:21:09 -08:00
yuneng-jiang
19dc5d750c Adding waits 2025-12-03 23:10:32 -08:00
Xianzong Xie
1c3c12bb1b refactor: move background_streaming_task to separate module
- Create new background_streaming.py in response_polling/
- Update endpoints.py to import from new location
- Update __init__.py to export background_streaming_task
- Add tests for module imports and structure

Committed-By-Agent: cursor
2025-12-03 22:50:26 -08:00
yuneng-jiang
45a9723467 view_user_info debugging 2025-12-03 22:20:04 -08:00
yuneng-jiang
c634c08818 Find inputs by placeholder 2025-12-03 21:51:45 -08:00
Sameer Kankute
4710e772be Add support for bedrock qwen 2 imported model 2025-12-04 11:08:57 +05:30
Cesar Garcia
b05f6d3cfd
fix(groq): check supports_response_schema before using json_tool_call workaround (#17438)
Fixes issue where LiteLLM used the json_tool_call workaround for all Groq
models, even those that support native json_schema (e.g., gpt-oss-120b,
llama-4, kimi-k2). This caused errors when users passed their own tools
alongside structured outputs.

Changes:
- Check `supports_response_schema()` before using the workaround
- Only use json_tool_call workaround for models without native support
- Add clear error message when using workaround with user-provided tools
- Update model config to set `supports_response_schema: false` for models
  that don't support native json_schema
- Add unit tests for structured output handling
2025-12-03 21:31:13 -08:00
Cesar Garcia
6d831ffff4
fix(ocr): add missing ocr and aocr to CallTypes enum (#17435)
Add `ocr` and `aocr` entries to the CallTypes enum to fix the
ValueError that occurs when using the /v1/ocr endpoint with
guardrails enabled.

The OCR endpoint uses route_type="aocr", but the CallTypes enum
was missing these values, causing guardrail hooks to fail when
trying to instantiate CallTypes("aocr").

Fixes #17381
2025-12-03 21:28:13 -08:00
Andrew Truong
1879623502
feat: Basic Weave OTEL integration (#17439)
* test

* testfix
2025-12-03 21:26:22 -08:00
Haiyi
06d42fbd30
Fix: Skip empty text blocks in Anthropic system messages (#17442)
When translating system messages for the Anthropic API, empty text
content blocks cause the error "messages: text content blocks must be
non-empty". This fix skips empty string content and empty text blocks
in list content to prevent this error.

Fixes issue with Vertex AI Anthropic API calls.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-03 21:25:06 -08:00
Devaj Mody
a6ce118989
fix(openai): add clear error message for empty LLM endpoint responses (#17445)
Fixes #17209

  - Add validation after response.parse() to detect empty/invalid responses
  - Raise clear OpenAIError with actionable message
  - Add 3 unit tests
2025-12-03 21:23:09 -08:00
yuneng-jiang
636f26d8a1 e2e changes 2025-12-03 21:21:27 -08:00
Krish Dholakia
32013f63a0
Guardrail API - support tool call checks on OpenAI /chat/completions, OpenAI /responses, Anthropic /v1/messages (#17459)
* fix(unified_guardrail.py): correctly map a v1/messages call to the anthropic unified guardrail

* fix: add more rigorous call type checks

* fix(anthropic_endpoints/endpoints.py): initialize logging object at the beginning of endpoint

ensures call id + trace id are emitted to guardrail api

* feat(anthropic/chat/guardrail_translation): support streaming guardrails

sample on every 5 chunks

* fix(openai/chat/guardrail_translation): support openai streaming guardrails

* fix: initial commit fixing output guardrails for responses api

* feat(openai/responses/guardrail_translation): handler.py - fix output checks on responses api

* fix(openai/responses/guardrail_translation/handler.py): ensure responses api guardrails work on streaming

* test: update tests

* test: update tests

* fix: support multiple kinds of input to the guardrail api

* feat(guardrail_translation/handler.py): support extracting tool calls from openai chat completions for guardrail api's

* feat(generic_guardrail_api.py): support extracting + returning modified tool calls on generic_guardrails_api

allows guardrail api to analyze tool call being sent to provider - to run any analysis on it

* fix(guardrails.py): support anthropic /v1/messages tool calls

* feat(responses_api/): extract tool calls for guardrail processing

* docs(generic_guardrail_api.md): document tools param support

* docs: generic_guardrail_api.md

improve documentation
2025-12-03 21:20:39 -08:00
yuneng-jiang
a4341ccf83 ci/cd changes for debugging 2025-12-03 21:00:49 -08:00
Krish Dholakia
be0530a6b3
fix(unified_guardrail.py): correctly map a v1/messages call to the anthropic unified guardrail (#17424)
* fix(unified_guardrail.py): correctly map a v1/messages call to the anthropic unified guardrail

* fix: add more rigorous call type checks

* fix(anthropic_endpoints/endpoints.py): initialize logging object at the beginning of endpoint

ensures call id + trace id are emitted to guardrail api

* feat(anthropic/chat/guardrail_translation): support streaming guardrails

sample on every 5 chunks

* fix(openai/chat/guardrail_translation): support openai streaming guardrails

* fix: initial commit fixing output guardrails for responses api

* feat(openai/responses/guardrail_translation): handler.py - fix output checks on responses api

* fix(openai/responses/guardrail_translation/handler.py): ensure responses api guardrails work on streaming

* test: update tests

* test: update tests

* test: update tests

* fix(bedrock_guardrails.py): fix post call streaming iterator logic

* fix: fix return

* fix(bedrock_guardrails.py): fix
2025-12-03 20:54:56 -08:00
yuneng-jiang
3de84b3f8b e2e tests 2025-12-03 20:34:41 -08:00
Ishaan Jaffer
8a824b7c17 fix mypy linting 2025-12-03 19:43:29 -08:00
Ishaan Jaffer
92cca5d515 test_cyberark_write_and_read_secret 2025-12-03 19:43:29 -08:00
Ishaan Jaffer
e7f066ea7d test_hosted_vllm_full_workflow 2025-12-03 19:43:29 -08:00