Commit Graph

23901 Commits

Author SHA1 Message Date
Ishaan Jaff 825ea65b96 [Bug Fix] Responses API - Responses API failed if input containing ResponseReasoningItem (#13465)
* add test_responses_api_multi_turn_with_reasoning_and_structured_output

* fix transform_responses_api_request
2025-08-09 11:20:34 -07:00
Ishaan Jaff ee40db7b31 docs native litellm prompts 2025-08-09 09:46:31 -07:00
Ishaan Jaff 94c33200a4 docs - native prompt mgmt (#13463) 2025-08-09 09:39:16 -07:00
Ishaan Jaff 3999e65a97 docs update 2025-08-09 09:24:41 -07:00
Cole McIntosh d874bec480 feat(models): add OpenRouter and Cerebras GPT-OSS models (20b, 120b) with pricing and context windows; update backup; refs #13428 (#13442) 2025-08-08 22:47:51 -07:00
Jugal D. Bhatt 035e5497e0 added mcp guardrails doc in mcp.md (#13452) v1.75.4-nightly 2025-08-08 22:47:31 -07:00
Ishaan Jaff 3905cee579 test fixes 2025-08-08 18:50:09 -07:00
Ishaan Jaff 05b48eba62 fix security issue 2025-08-08 18:32:50 -07:00
Ishaan Jaff 32db7f1508 bump: version 1.75.3 → 1.75.4 2025-08-08 18:30:27 -07:00
Ishaan Jaff edc38b73f9 UI new build 2025-08-08 18:30:15 -07:00
Ishaan Jaff a843e876a8 [Feat] Working e2e flow for Responses API session management with media (#13456)
* add MultimodalContent on chat UI

* add multi modal img on chat ui

* utils for responses API imgs

* add code snippet with imgs

* chat UI add imgs

* add imge upload

* chat ui allow adding images

* fix chat send button

* fix button styles

* fix clear chat

* fixes session management

* fixes for session management

* QA fix _should_check_cold_storage_for_full_payload

* test_should_check_cold_storage_for_full_payload
2025-08-08 18:28:10 -07:00
Cole McIntosh 1d514cc68b feat(reasoning): support 'minimal' effort type for OpenAI (#13447)
* feat(reasoning): support 'minimal' effort type for OpenAI

* fix(reasoning): correctly map 'minimal' effort to Reasoning object

* chore(dependencies): update OpenAI package version to 1.99.5 in pyproject.toml and requirements.txt

* chore(dependencies): update poetry.lock for OpenAI package version 1.99.5 and Poetry version 2.1.3
2025-08-08 17:56:23 -07:00
tanjiro 4571002e19 disable logging settings for non-enterprise users (#13431) 2025-08-08 17:35:29 -07:00
Ishaan Jaff 840db3fe48 LiteLLM UI - Test Key Page - allow uploading images for /chat/completions and /responses (#13445)
* add MultimodalContent on chat UI

* add multi modal img on chat ui

* utils for responses API imgs

* add code snippet with imgs

* chat UI add imgs

* add imge upload

* chat ui allow adding images

* fix chat send button

* fix button styles

* fix clear chat
2025-08-08 16:57:08 -07:00
Ishaan Jaff 7e2a00c848 [Docs] Add docs on how router / cooldowns work (#13444)
* add theme-mermaid

* docs cool down

* docs cooldown
2025-08-08 15:13:37 -07:00
Ishaan Jaff d0aa12f3bf Enhance team member permission error message with guidance for key creation (#13443)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ishaan <ishaan@berri.ai>
2025-08-08 14:35:06 -07:00
Low Jian Sheng 7f55bbc296 add support for reasoning_effort minimal (#13401) 2025-08-08 14:34:46 -07:00
Jugal D. Bhatt f55666bf5f fix prices for oai gpt 5 (#13441) 2025-08-08 14:33:21 -07:00
Ishaan Jaff 3b65733af8 [Bug fix] - Error creating standard logging object - can't register atexit after shutdownLitellm fixes standard logging payload (#13436)
* fix: _generate_cold_storage_object_key

* _get_configured_cold_storage_custom_logger

* test_e2e_generate_cold_storage_object_key_runtime_error_handled
2025-08-08 12:38:26 -07:00
tanjiro 4fdc866fcb Display Error from Backend on the UI - Notification (#13427)
* fix sso logout

- add a new login page with sso button

* lint fix

* lint fix

* lint fix

* fix tests

* fix test

* Revert "fix test"

This reverts commit 74eb7345710892d5a9d02baec0ef389b98d0dde3.

* Reapply "fix test"

This reverts commit 72d0b2d4c62f6bb9351a7656ff88efc2ba91aef7.

* add host to add modal

* close modal after save is clicked. and auto-refresh

* show old values in edit modal

* send the whole payload on edit

* Update settings.tsx

* resolve conflict

* fix conflict

* merge main

* first draft of notifications added to settings

* add error compatibility by taking errors from the backend

- db errors
- auth errors

* add support for different types of errors

* minor

* name change

* email alerts page notifications modified

* remove unused code
2025-08-08 12:34:16 -07:00
Jugal D. Bhatt 51c2ff7c15 fix user membership issue (#13433) 2025-08-08 12:00:58 -07:00
Ishaan Jaff 3a35c82884 [Feat] Add reasoning_effort to OpenAIGPT5Config (#13434)
* add reasoning_effort toi OpenAIGPT5Config

* test_gpt5_supports_reasoning_effort
2025-08-08 11:57:12 -07:00
Edward D'Amato 793e1aa7c7 fix(proxy): add missing braintrust api base to env vars (#13412) 2025-08-08 08:59:33 -07:00
Thiago Salvatore c2ad858c83 fix(access group): allow access group on mcp tool retrieval (#13425)
* fix(access group): allow access group on mcp tool retrieval

* fix(test): fix broken tests and add test case for access group

* fix(mypy): fix typing issues
2025-08-08 08:55:46 -07:00
Emerson Gomes aea5af2165 Correct GPT-5 token limits and price (#13423) 2025-08-08 08:55:33 -07:00
Ishaan Jaff aefa71a300 bump: version 1.75.2 → 1.75.3 v1.75.3-nightly 2025-08-07 21:32:44 -07:00
Ishaan Jaff 6b2ad4dc0f ui new build 2025-08-07 21:20:19 -07:00
Ishaan Jaff 9bfc4f89c9 fix ui 2025-08-07 21:13:46 -07:00
Ishaan Jaff a5cf880acc feat(usage): aggregated user daily activity endpoint and UI integration (#13395) (#13400)
* feat(usage): add aggregated user daily activity endpoint and UI integration; fallback to paginated flow if unavailable

* refactor(usage): deduplicate daily activity logic; add wrapper to user paginated endpoint; share date formatting in UI

* chore(lint): remove unused imports from internal_user_endpoints

Co-authored-by: Cole McIntosh <82463175+colesmcintosh@users.noreply.github.com>
2025-08-07 21:10:40 -07:00
tanjiro 43af255b45 Add Custom Tooltips to Model Mapping Table (#13294)
* descriptive tooltips

* atomic folder structure

* undo changes

* import fix

* reorder
2025-08-07 20:19:30 -07:00
Ishaan Jaff 9761ba7c7a [Bug Fix] Responses api session management for streaming responses (#13396)
* fix proxy config

* fix(responses api): fix streaming ID consistency and tool format handling (#12640)

* fix(responses): ensure streaming chunk IDs use consistent encoding format

Fixes streaming ID inconsistency where streaming responses used raw provider IDs
while non-streaming responses used properly encoded IDs with provider context.

Changes:
- Updated LiteLLMCompletionStreamingIterator to accept provider context
- Added _encode_chunk_id() method using same logic as non-streaming responses
- Modified chunk transformation to encode all streaming item_ids with resp_ prefix
- Updated handlers to pass custom_llm_provider and litellm_metadata to streaming iterator

Impact:
- Streaming chunk IDs now format: resp_<base64_encoded_provider_context>
- Enables session continuity when using streaming response IDs as previous_response_id
- Allows provider detection and load balancing with streaming responses
- Maintains backward compatibility with existing streaming functionality

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(types): add explicit Optional[str] type annotation for model_id

This resolves MyPy type checking error where model_id could be None
but wasn't explicitly typed as Optional[str].

* fix(types): handle None case for litellm_metadata access

Prevents 'Item None has no attribute get' error by checking for None
before accessing litellm_metadata dictionary.

* test: add comprehensive tests for streaming ID consistency

Adds unit and E2E tests to verify streaming chunk IDs are properly encoded
with consistent format across streaming responses.

## Tests Added

### Unit Test (test_reasoning_content_transformation.py)
- `test_streaming_chunk_id_encoding()`: Validates the `_encode_chunk_id()` method
  correctly encodes chunk IDs with `resp_` prefix and provider context

### E2E Tests (test_e2e_openai_responses_api.py)
- `test_streaming_id_consistency_across_chunks()`: Tests that all streaming chunk IDs
  are properly encoded across multiple chunks in a real streaming response
- `test_streaming_response_id_as_previous_response_id()`: Tests the core use case -
  using streaming response IDs for session continuity with `previous_response_id`

## Key Testing Approach
- Uses **Gemini** (non-OpenAI model) to test the transformation logic rather than
  OpenAI passthrough, since the streaming ID consistency issue occurs when LiteLLM
  transforms responses rather than just passing through to native OpenAI responses API
- Tests validate that streaming chunk IDs now use same encoding as non-streaming responses
- Verifies session continuity works with streaming responses

Addresses @ishaan-jaff's request for unit tests covering the streaming ID consistency fix.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(lint): remove unused imports in transformation.py

Removes unused imports to fix CI linting errors:
- GenericResponseOutputItem
- OutputFunctionToolCall

* test: remove E2E tests from openai_endpoints_tests

Remove streaming ID consistency E2E tests as requested by @ishaan-jaff.
Keep only the mock/unit test in test_reasoning_content_transformation.py

* revert: remove streaming chunk ID encoding to original behavior

This reverts the streaming chunk ID encoding changes to understand the original issue better.
Original behavior was:
- Streaming chunks: raw provider IDs
- Streaming final response: raw IDs (PROBLEM!)
- Non-streaming final response: encoded IDs (correct)

The real issue: streaming final response IDs were not encoded, breaking session continuity.

* fix(responses): encode streaming final response IDs to match OpenAI behavior

Fixes streaming ID inconsistency to match OpenAI's Responses API behavior:
- Streaming chunks: raw message IDs (like OpenAI's msg_xxx)
- Final response: encoded IDs (like OpenAI's resp_xxx)

This enables session continuity by ensuring streaming final response IDs
have the same encoded format as non-streaming responses, allowing them
to be used as previous_response_id in follow-up requests.

Changes:
- Add custom_llm_provider and litellm_metadata to LiteLLMCompletionStreamingIterator
- Update handlers to pass provider context to streaming iterator
- Apply _update_responses_api_response_id_with_model_id to final streaming response
- Keep streaming chunks as raw IDs to match OpenAI format

Impact:
- Session continuity works with streaming responses
- Load balancing can detect provider from streaming final response IDs
- Format matches OpenAI's Responses API exactly

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

Co-Authored-By: Claude <noreply@anthropic.com>

* test: update unit test to match correct OpenAI-compatible behavior

Updates the unit test to verify streaming chunk IDs are raw (not encoded)
to match OpenAI's responses API format:
- Streaming chunks: raw message IDs (like msg_xxx)
- Final response: encoded IDs (like resp_xxx)

This reflects the correct behavior implemented in the fix.

---------

Co-authored-by: Claude <noreply@anthropic.com>

* cleanup

* TestBaseResponsesAPIStreamingIterator

---------

Co-authored-by: Javier de la Torre <jatorre@carto.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-07 20:13:24 -07:00
Ishaan Jaff 698655cd24 ci/cd new release v1.75.2-nightly 2025-08-07 16:59:44 -07:00
Ishaan Jaff 7695882d8a test_supports_tool_choice 2025-08-07 16:56:45 -07:00
Jugal D. Bhatt 3410b293d7 Add presidio docs (#13392) 2025-08-07 16:40:07 -07:00
Ishaan Jaff 2037037258 [Bug Fix] OpenAI gpt-5 series does not support "max_tokens" parameter and temperature values that are not = 1 (#13390)
* add OpenAIGPT5Config

* add map_openai_params for gpt5

* add OpenAIGPT5Config

* add OpenAI gpt 5 transform

* docs gpt 5 openai
2025-08-07 16:35:00 -07:00
Ishaan Jaff 9b86d721d5 test fix oci supports tool choice 2025-08-07 15:26:25 -07:00
Ishaan Jaff e8c081b8ff test_stream_chunk_builder_litellm_usage_chunks 2025-08-07 15:22:52 -07:00
Ishaan Jaff dbb651ea95 remove old mapped test 2025-08-07 13:51:50 -07:00
Ishaan Jaff 621b3dca7b [Bug Fix] Mistral Tool Calling - Grammar error: at 3(11): failed to compile JSON schema (#13389)
* test_claude_tool_use_with_gemini

* add _remove_json_schema_refs

* add _clean_tool_schema_for_mistral

* fixes mistral tool calls

* _remove_json_schema_refs

* fix - vertex, remove hardcoded test
2025-08-07 13:50:22 -07:00
Parham Alvani 849c262a02 fix: we need to have project files for running migration using this image (#13379) 2025-08-07 13:31:10 -07:00
Ishaan Jaff 984f91f4f5 test_completion_gemini_stream 2025-08-07 13:24:00 -07:00
Ishaan Jaff 70ddde2215 fix - remove dup model entries 2025-08-07 13:22:00 -07:00
Ishaan Jaff d9f9465bc2 fix models by provider 2025-08-07 13:20:28 -07:00
Ishaan Jaff b7ced315dd fix - publish new PIP / prisma migrations 2025-08-07 13:18:45 -07:00
Ishaan Jaff 08ac2aeb6d Revert "Fix SSO Logout | Create Unified Login Page with SSO and Username/Password Options (#12703)" (#13387)
This reverts commit a752d7acc9.
2025-08-07 13:13:05 -07:00
Ishaan Jaff 2e767c8faf [Feat] add azure/gpt-5 model family (#13385)
* add azure/gpt-5 model family

* add azure gpt-5 model family

* fixes for gpt-5

* add azure/gpt-5 model family
2025-08-07 12:50:37 -07:00
Ishaan Jaff 087a1a622c feat: Add GPT-5 model family with official OpenAI specifications (#13… (#13386)
* feat: Add GPT-5 model family with official OpenAI specifications (#13378)

* Add GPT-5 model family support

Added four new GPT-5 models:
- gpt-5: Flagship model for logic and multi-step tasks
- gpt-5-mini: Cost-sensitive version for budget use cases
- gpt-5-nano: Speed-optimized version for low latency
- gpt-5-chat: Enterprise-focused version for advanced conversations

* Update GPT-5 models with official OpenAI specifications

- Add gpt-5-chat-latest with 400k context, 128k output tokens
- Add gpt-5-2025-08-07 with enhanced reasoning capabilities
- Add gpt-5-mini-2025-08-07 with cost-optimized pricing
- Add gpt-5-nano-2025-08-07 with ultra-fast performance
- Update existing gpt-5, gpt-5-mini, gpt-5-nano to match dated versions
- All models now support reasoning tokens and 400k context window
- Pricing updated per official OpenAI documentation

* fix conflicts

---------

Co-authored-by: Cole McIntosh <82463175+colesmcintosh@users.noreply.github.com>
2025-08-07 11:58:37 -07:00
Ishaan Jaff 729e1f530a feat - add claude-opus-4-1 on cost map (#13384) 2025-08-07 11:52:44 -07:00
Low Jian Sheng 9e0ba10f23 Add GPT 5 models (#13377)
* add gpt 5 modesl

* update max tokens
2025-08-07 11:36:16 -07:00
Ishaan Jaff 4d941c914e [Feat] Responses API Session Handling - Multi media support (#13347)
* rename ResponsesSessionHandler

* use ResponsesSessionHandler

* test session handler

* refactor ResponsesSessionHandler

* fix get_proxy_server_request_from_spend_log

* use constant for LITELLM_TRUNCATED_PAYLOAD_FIELD

* add _should_check_cold_storage_for_full_payload

* add get_class_type_for_custom_logger_name

* get_active_custom_logger_for_callback_name

* add get_proxy_server_request_from_cold_storage to CustomLogger

* add ColdStorageHandler

* start using cold storage integration

* add get_proxy_server_request_from_cold_storage

* fixes from manual testing

* s3 v2 fix getting region name

* ChatCompletionImageUrlObject

* use _get_configured_cold_storage_custom_logger

* fixes for _should_check_cold_storage_for_full_payload

* fix _download_object_from_s3

* test_s3_v2_with_cold_storage

* add cold_storage_object_key to StandardLoggingMetadata

* use get_proxy_server_request_from_cold_storage_with_object_key

* add cold_storage_object_key to SpendLogsMetadata

* add cold_storage_object_key

* get_proxy_server_request_from_cold_storage_with_object_key

* use get_proxy_server_request_from_cold_storage_with_object_key

* test responses API

* add get_proxy_server_request_from_cold_storage_with_object_key

* session handler fixes

* test session handler

* fix ruff checks

* _download_object_from_s3

* cleanup

* test

* lint fix

* test_e2e_cold_storage_successful_retrieval

* test_e2e_generate_cold_storage_object_key_successful

* test_async_gcs_pub_sub_v1

* test fix

* test fix

* test fix

* test_standard_logging_metadata_has_cold_storage_object_key_field

* test_sanitize_request_body_for_spend_logs_payload_basic

* test_transform_input_image_item_to_image_item_with_image_data
2025-08-07 10:59:53 -07:00