Commit Graph

377 Commits

Author SHA1 Message Date
Ishaan Jaff e7374e3909 test_gemini_url_context 2025-07-03 16:13:44 -07:00
Ishaan Jaff 274baac9df test_mcp_tools_with_responses_api 2025-07-03 14:53:30 -07:00
Ishaan Jaff 03a589d323 fix - MCP deepwiki mcp is unstable, move to stable mcp 2025-07-03 14:24:32 -07:00
Ishaan Jaff 5630147e80 Revert "Revert "fix tests (#12286)""
This reverts commit 12f157513b.
2025-07-03 12:08:27 -07:00
Ishaan Jaff 12f157513b Revert "fix tests (#12286)"
This reverts commit 99ce3a24cc.
2025-07-03 12:04:23 -07:00
célina 99ce3a24cc fix tests (#12286) 2025-07-03 10:57:19 -07:00
Krrish Dholakia 82a0a443c6 feat(stream_chunk_builder_utils.py): correctly return web_search_requests on stream chunk builder 2025-07-03 10:56:26 -07:00
Ishaan Jaff 1aa55e6a74 test_url_context 2025-07-02 21:10:12 -07:00
Krish Dholakia bba75aa12b Add 'audio_url' message type support for VLLM (#12270)
* fix(openai.py): add audio_url content type for vllm

Fixes https://github.com/BerriAI/litellm/issues/12196

* test: fix test
2025-07-02 20:37:45 -07:00
Krish Dholakia 6717d67f3b fix(streaming_handler.py): store finish reason, even if is_finished is false - allows storing early gemini finish reasons (#12250)
Fixes https://github.com/BerriAI/litellm/issues/12249
2025-07-02 12:09:41 -07:00
Krish Dholakia 22d28f5853 Batches - support batch retrieve with target model Query Param + Anthropic - completion bridge, yield content_block_stop chunk (#12228)
* fix(batches_endpoints/endpoints.py): support passing target model names for batch list as a query param

Fixes issue where cloud run fails calls because GET can't contain request body

* test(test_openai_batches_endpoints.py): add unit test

* docs(managed_batches.md): update docs

* feat(spend_tracking_utils.py): support STORE_PROMPTS_IN_SPEND_LOGS env var

ensures prompt is stored in spend logs

* fix(streaming_iterator.py): fix anthropic - completion streaming iterator to yield content block stop

ensures claude code renders messages

* test: skip local test
2025-07-01 22:13:48 -07:00
Krish Dholakia 9582c88eab Non-anthropic (gemini/openai/etc.) models token usage returned when calling /v1/messages (#12184)
* fix(proxy_server.py): handle empty config yaml

Fixes https://github.com/BerriAI/litellm/issues/12163

* fix(gemini/common_utils.py): replace models/ as expected, instead of using 'strip'

Fixes https://github.com/BerriAI/litellm/issues/12160

* fix(anthropic/experimental_pass_through/messages/transformation.py): check for env var when selecting api key

* fix(anthropic/transformation.py): return tool_use content block start on anthropic bridge

Closes https://github.com/BerriAI/litellm/issues/12158

* fix(anthropic/streaming_iterator.py): fix setting index in block

ensure index is set just once and increments correctly when a new block is created

* fix(anthropic/adapters/handler.py): update logging obj with stream options value if set

* feat(anthropic/streaming_iterator.py): return usage from chat completion to messages bridge

enables usage tracking for non-anthropic models

Closes https://github.com/BerriAI/litellm/issues/12132

* fix(streaming_iterator.py): safely access usage chunk

* fix: suppress linting error

* test: update tests

* fix: fix streaming errors
2025-07-01 17:41:48 -07:00
Krish Dholakia ee9dd158dd Fix - handle empty config.yaml + Fix gemini /models - replace models/ as expected, instead of using 'strip' (#12189)
* fix(proxy_server.py): handle empty config yaml

Fixes https://github.com/BerriAI/litellm/issues/12163

* fix(gemini/common_utils.py): replace models/ as expected, instead of using 'strip'

Fixes https://github.com/BerriAI/litellm/issues/12160

* fix(anthropic/experimental_pass_through/messages/transformation.py): check for env var when selecting api key

* docs(config_settings.md): add api key to docs
2025-06-30 21:56:03 -07:00
Krish Dholakia ee6e76e1f9 Bedrock Passthrough cost tracking (/invoke + /converse routes - streaming + non-streaming) (#12123)
* refactor(passthrough_endpoints-success-handler): refactor llm passthrough logging logic

isolate the llm translation work to enable cost tracking on sdk

* feat: initial implementation of passthrough SDK cost calculation

enables bedrock passthrough cost tracking to work

* feat(cost_calculator.py): working cost calculation for bedrock passthrough

* feat(litellm_logging.py): consider allm_passthrough in cost tracking

allows async calls (e.g. via proxy) to work

* feat(bedrock/passthrough): working event stream decoding for bedrock passthrough calls + logging instrumentation for passthrough sdk calls (log on stream completion)

Enables bedrock streaming cost calculation

* feat(litellm_logging.py): support streaming passthrough cost tracking

* feat(passthrough/main.py): working async streaming cost calculation

Closes https://github.com/BerriAI/litellm/issues/11359

* feat(proxy_server.py): fix passthrough routing when llm router enabled

* feat: further fixes

* feat(bedrock/): working bedrock passthrough cost tracking (non-streaming)

* feat(litellm_logging.py): working usage tracking for bedrock passthrough calls

ensures tokens are logged

* feat(bedrock/passthrough): add converse passthrough cost tracking support

* feat(base_llm/passthrough): remove redundant function

* refactor(litellm_logging.py): refactor function to be below 50 LOC

* test: update test

* test: remove redundant test
2025-06-27 20:01:12 -07:00
Ishaan Jaff ebf6395bc1 [Feat] Add Eleven Labs - Speech To Text Support on LiteLLM (#12119)
* add ELEVENLABS as a provider

* add deepgram to main.py

* add ElevenLabsException

* add ElevenLabsAudioTranscriptionConfig

* add transform_audio_transcription_response

* TestElevenLabsAudioTranscription

* add elevenlabs/scribe_v1 to model cost map

* add ElevenLabsAudioTranscriptionConfig

* add AudioTranscriptionRequestData

* add ElevenLabs transform

* use AudioTranscriptionRequestData

* refactoring fixes

* add ProcessedAudioFile util for reading audio files

* test_elevenlabs_diarize_parameter_passthrough

* docs eleven labs

* docs fixes

* fix code qa checks

* fixes - audio transcription

* ui - add ElevenLabs logo

* add elevenlabs logo

* docs - ElevenLabs

* test fix elevenlabs
2025-06-27 17:50:49 -07:00
Krish Dholakia dd92b1a0ac Refactor: bedrock passthrough fixes - migrate to Passthrough SDK (#12089)
* feat: initial commit adding bedrock support via the new sdk passthrough logic

ensures correct sequencing of tasks (pre call checks etc. can run before signing request)

* fix(route_llm_requests.py): passthrough to allm_passthrough_route if no model found

* feat(bedrock/passthrough): working bedrock passthrough via sdk support

* fix(passthrough/main.py): re-add data and json

* feat(passthrough/main): support async passthrough calls to bedrock

* feat(passthrough/main.py): async streaming + completion support

* feat(llm_passthrough_endpoints.py): migrate bedrock passthrough calls to to new bedrock passthrough sdk

Enables calls to work correctly

* fix: fix linting errors

* test: update test
2025-06-26 22:51:35 -07:00
Krish Dholakia 24c2cd1bd9 Anthropic /v1/messages - Custom LLM Server support (#12016)
* fix(handler.py): support routing custom llm's to chat completion handler

Adds custom llm support for anthropic

* test(test_anthropic_experimental_pass_through_messages_handler.py): add unit test confirming custom llm respected

* docs(custom_llm_server.md): document anthropic custom llm translation

* test(volcengine.py): map thinking in extra body

Fixes https://github.com/BerriAI/litellm/issues/11879

* feat(main.py): support `azure/responses/<deployment-name>` model string

this allows us to route the model correctly

Closes https://github.com/BerriAI/litellm/issues/11879

* docs(azure_responses.md): document calling azure responses api models via chat completions bridge

Closes https://github.com/BerriAI/litellm/issues/11917

* fix: fix custom provider check

* test: update tests
2025-06-24 22:00:44 -07:00
Nathan Brake 1c4fdb4a8f Enhance Mistral API: Add support for parallel tool calls (#11770)
* Enhance Mistral API: Add support for parallel tool calls and refine name handling in tool messages. Plus, introduce a new test for parallel tool calls in the Mistral model.

* tests

* make mypy happy

* Refine name handling in Mistral chat transformation: clarify conditions for removing the 'name' field based on message role and content.
2025-06-19 20:12:39 -07:00
Krish Dholakia 0d09c8ec96 Litellm dev 06 18 2025 p1 (#11872)
* fix(spend_tracking_utils.py): add user agent tags from standard logging payload, in spend logs payload

* feat(litellm_logging.py): identify user agent tags as `User-Agent: ..` and allow admin to disable storing user agent as tag

* fix(azure_ai/): pass content type header in azure ai request

Fixes https://github.com/BerriAI/litellm/issues/11227

* test: add unit test

* fix(router.py): fix passing dynamic credentials to retrieve batch

Fixes batch retrieval when using router

* test: add more unit tests
2025-06-18 21:24:36 -07:00
Ishaan Jaff 363d6b6858 test_xai_check_for_stop_in_supported_params 2025-06-14 16:33:38 -07:00
nevin b7cb66ee8f Fixed grok-3-mini to not use stop tokens (#11563)
* fixed grok-3-mini to not use stop tokens

* added xai config test
2025-06-14 14:26:43 -07:00
Ishaan Jaff e3094c2249 set flaky tests as flaky 2025-06-14 13:51:52 -07:00
Krrish Dholakia f5aa24c3eb test: update unit testing 2025-06-14 08:41:34 -07:00
Krish Dholakia 8579332f44 Add model access groups on UI (#11719)
* fix(anthropic/chat/transformation.py): append prefix to start of assistant response, if set

ensures assistant response contains complete response

* fix(anthropic/chat/transformation.py): add flag to allow user to opt out of enabling prefix in prompt

* fix(anthropic/chat/transformation.py): working e2e support for prefix prompt in assistant response

* feat(networking.tsx): always include model access groups on UI

show admin created access groups when giving key/user/team model permissions

* feat(add_model_tab.tsx): initial ui component for adding to an existing model access group

allows user to add model to an access group (simplify giving users/keys/teams model access)

* feat(proxy_server.py): add 'only_model_access_groups' flag support to `/v1/models`

simplifies listing available access groups on UI

* test: add e2e test for new only_model_access_groups param

* feat(add_model_tab.tsx): allow adding+viewing model access groups on models tab

make feature functional on UI

* feat(view_users.tsx): route edit user to user info page

more detailed user edit

* feat(columns.tsx): route edit user to user info page

more detailed user edit

* fix(columns.tsx): fix linting error

* build(ui/): fix linting errors
2025-06-13 21:20:25 -07:00
Krish Dholakia 369922ef90 Convert scientific notation str to int + Bubble up azure content filter results (#11655)
* fix(utils.py): convert stringified numbers to numbers

Closes https://github.com/BerriAI/litellm/issues/11266

* fix(convert_dict_to_model_response_object/): bubble up azure content_filter_results

* fix: fix linting error

* fix: fix linting errors

* fix(types/utils.py): ensure choices is correctly set

* fix: delete field if not set

* fix: expand scope of choicelogprobs value
2025-06-11 23:07:22 -07:00
Krish Dholakia 7f2e188ee2 Add bridge for /chat/completion -> /responses API (#11632)
* refactor(responses/): refactor to move responses_to_completion in separate folder

future work to support completion_to_responses bridge

allow calling codex mini via chat completions (and other endpoints)

* Revert "refactor(responses/): refactor to move responses_to_completion in separate folder"

This reverts commit ff87cb895812283d107f47e8e528bcebe93d8015.

* feat: initial responses api bridge

write it like a custom llm - requires lesser 'new' components

* style: add __init__'s and bubble up the responses api bridge

* feat(responses/transformation): working sync completion -> responses and back bridge (non-streaming)

* feat(responses/): working async (non-streaming) completion <-> responses bridge

Allows calling codex mini via proxy

* feat(responses/): working sync + async streaming for base model response iterator

* fix: reduce function size

maintain <50 LOC

* fix(main.py): safely handle responses api model check

* fix: fix linting errors
2025-06-11 22:20:18 -07:00
Ishaan Jaff 688e65b2b2 [Feat] Perf fix - ensure deepgram provider uses async httpx calls (#11641)
* Checkpoint before follow-up message

* Add comprehensive tests for Deepgram transcription functionality

* clean up transform

* just use 1 test

* test cleanup

* test fix get_complete_url

* test rename file

* refactor deepgram URL construction

* add logging_obj.pre_call

* fix unused imports

* feat - add async deepgram support

* test_audio_transcription_async

* fix python 3.8 test

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-06-11 18:32:01 -07:00
Ishaan Jaff aeaf2d185a fix inference endpoints (#11630) (#11631)
Co-authored-by: célina <hanouticelina@gmail.com>
2025-06-11 10:45:54 -07:00
Krish Dholakia 39de3610be fix(internal_user_endpoints.py): support user with + in email on us… (#11601)
* fix(internal_user_endpoints.py): support user with `+` in email on user info

ensures user is correctly parsed from input

* fix(factory.py): support vertex function call args as None

handles empty string in args for vertex gemini calls

* docs(langfuse_integration.md): pin langfuse sdk version on docs

* fix(vertex_ai/): return empty dict, instead of none when empty string given

* refactor: reduce function size

* fix: fix linting errors

* fix: revert check

* fix(internal_user_endpoints.py): fix check

* test: update tests

* test: update tests
2025-06-10 22:13:10 -07:00
Ishaan Jaff cd8ec4556f [Feat] Add reasoning_effort support for perplexity models (#11562)
* fix: add reasoning_effort for pplx

* docs pplx reasoning

* [tests] add mock tests for pplx reasoning (#11564)

* Add tests for Perplexity reasoning models and effort parameter

* tests perplexity reasoning effort

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* test pplx reasoning effort

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-06-09 17:07:31 -07:00
Krish Dholakia 8dd8615a54 Ensure consistent 'created' across all chunks + set tool call id for ollama streaming calls (#11528)
* fix(streaming_handler.py): maintain same 'created' across all chunks

Fixes https://github.com/BerriAI/litellm/issues/11437

* test: add unit test to ensure created is always the same across all chunks

* fix(types/utils.py): set a tool call id, if missing in delta tool call

Ensures stream chunk builder can reconstruct tool calls correctly

Fixes https://github.com/BerriAI/litellm/issues/11262

* fix(responses/transformation.py): support passing mcp server tool call to anthropic

allows switching between openai and anthropic for mcp tool calling

* fix(ollama/chat/transformation.py): set tool call id's when missing
2025-06-07 20:50:07 -07:00
Krish Dholakia 2654d3b0b1 Support env var vertex credentials for passthrough + ignore space id on watsonx deployment (throws Json validation errors) (#11527)
* fix(router.py): support vertex credentials set in env var for passthrough

Closes https://github.com/BerriAI/litellm/issues/11245

* fix(watsonx/common_utils.py): do not pass space_id on watsonx deployment requests - raises Json validation error

Fixes https://github.com/BerriAI/litellm/issues/10941

* test: update unit test
2025-06-07 20:31:05 -07:00
Krish Dholakia e3c66418b8 Litellm anthropic mcp support (#11474)
* feat(anthropic/): initial commit adding working mcp tool call support

pass in mcp tool via `tools` and litellm will handle translating it to the right anthropic param

* feat(anthropic/): map openai mcp tool to anthropic mcp tool

allows usage within responses api

* fix(databricks/transformation.py): fix databricks linting error

* test(test_anthropic_chat_transformation.py): fix test

* test: update test

* fix(anthropic/chat/transformation.py): add dummy tool call
2025-06-07 15:11:55 -07:00
Krrish Dholakia e2da29c54d test: update test 2025-06-06 09:15:08 -07:00
Krrish Dholakia 398fef8391 fix(bedrock/): add generic support for tool calling on bedrock models
Closes https://github.com/BerriAI/litellm/issues/11430
2025-06-05 23:37:02 -07:00
Krish Dholakia 603bd73a17 Gemini - web search cost tracking + Update max output tokens for nova models
* fix(vertex_and_google_ai_studio_gemini.py): add web search request tracking

Enables cost calculation for google web search

* fix(vertex_and_gemini): use common processing logic across stream / non-stream calls

* fix(vertex_And_google_ai_studio_Gemini.py): fix initial choice

* fix: fix linting error

* fix: add initial support for google search cost tracking

* fix(tool_call_cost_tracking.py): working tool cost tracking for gemini

* fix(vertex_ai/gemini/cost_calculator.py): add google web search tool cost tracking for vertex ai

Closes LIT-210

* fix: fix check

* build(model_prices_and_context_window.json): fix amazon nova max output tokens

Closes https://github.com/BerriAI/litellm/issues/11441

* fix: fix ruff check
2025-06-05 23:25:18 -07:00
Cole McIntosh 7c513856dc Fix None values in usage field for gpt-image-1 model responses (#11448)
* fix(convert_dict_to_response.py): handle None values in usage field for gpt-image-1

* test: add tests for handling None and partial values in usage fields for gpt-image-1 responses
2025-06-05 13:19:18 -07:00
Sha a301ef873e added gemini url context support (#11351)
* added gemini url context support

* lint issue fix
2025-06-04 23:56:21 -07:00
Krish Dholakia 3bd128630d Anthropic - pass file url's as Document content type + Gemini - cache token tracking on streaming calls (#11387)
* fix(anthropic/): fix regression when passing file url's to the 'file_id' parameter

add test and ensure anthropic file url's are correctly sent as 'document' blocks

* fix(vertex_and_google_ai_studio.py): Use same usage calculation function as non-streaming

Closes https://github.com/BerriAI/litellm/issues/10667

* test(test_vertex_and_google_ai_studio_gemini.py): update test
2025-06-03 21:36:49 -07:00
Krish Dholakia 4611b821ec Support returning virtual key in custom auth + Handle provider-specific optional params for embedding calls (#11346)
* feat(custom_auth_auto.py): support returning a litellm virtual key from custom auth

allows admin to remap old keys to litellm virtual keys

* fix(utils.py): correctly handle optional params for openai sdk calls

Fixes https://github.com/BerriAI/litellm/issues/11126

* test: update test

* fix(utils.py): handle edge cases
2025-06-03 07:24:13 -07:00
Cole McIntosh 94650c10fe feat: Add support for Cohere Embed v4.0 model (#11329)
- Updated model_prices_and_context_window.json to include embed-v4.0 with relevant pricing and metadata.
- Added embed-v4.0 to cohere_embedding_models in constants.py.
- Implemented comprehensive tests for Cohere Embed v4.0 in test_cohere.py, covering basic functionality, input types, error handling, and optional parameters.
2025-06-02 11:25:29 -07:00
Krish Dholakia 06484f6e5a Xai, VertexAI, Google AI Studio - live web search support in OpenAI format (#11251)
* build(model_prices_and_context_window.json): fix 'supports_web_search' flag - openai only supports it on 2 models - gpt-4o-search-preview and gpt-4o-mini-search-preview

* feat(xai/chat): add xai web search options param support

* test: add max tokens to test

xai output very verbose

* build(xai/): add web search support for all xai models

* build(model_prices_and_cost.json): add gemini-2.0 supports web search

* feat(gemini/): map openai 'web_search_options' to google's 'googlesearch' tool

* build(model_prices_and_context_window.json): add supports_web_search for vertex_ai/gemini-2 models

* fix: fix circular reference error

* fix(convert_dict_to_response.py): handle scenario where xai returns finish reason as 'stop' for tool calls

* fix: reduce function size

* fix: import session handling

* Revert "fix: import session handling"

This reverts commit deb257dc10.

* fix: linting pin mypy

* [Feat]: Guardrails - Add streaming for bedrock post guard (#11247)

* feat: add streaming for bedrock post guard

* fix: bedrock guardrails

* fix: add clear comments

* Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: clean up bedrock guardrails

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* [Fix] Responses API - Session management  (#11254)

* fix: import session handling

* fix: imports for session handler

* tests: tests for session handler

* Update enterprise/litellm_enterprise/enterprise_callbacks/session_handler.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* bump: bump litellm enterprise

* fixes: test_create_user_default_budget

* fix(xai/): filter 'strict' on tool call

* test: update test for new error string

* fix(utils.py): default to None if not set in  model cost map

ensures consistent usage of 'supports_[x]' flags

* fix(fireworks_ai/): support fireworks ai document inlining on pdf's sent via openai 'file' message type

* test: update test

* test: name filter_value_from_dict

* fix(fireworks_ai/): handle cache control flag in messages

* fix(xai/chat): fix check

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-31 14:26:16 -07:00
Ishaan Jaff 7d47417906 test: fixes 2025-05-31 12:42:56 -07:00
Krish Dholakia 39849627f7 feat(parallel_request_limiter_v2.py): add sliding window logic (#11283)
* feat(parallel_request_limiter_v2.py): add sliding window logic

allows rate limiting to work across minutes

* fix(parallel_request_limiter_v2.py): decrement usage on rate limit error

* fix(base_routing_strategy.py): fix merge from redis - preserve values in in-memory cache during gap b/w push to redis and read from redis

* fix(base_routing_strategy.py): catch the delta change during redis sync

ensures values are kept in sync

* fix(parallel_request_limiter_v2.py): update tpm tracking to use slot key logic

* fix: fix linting error

* test: update testing

* test: update tests

* test: skip on rate limit or internal server errors

* test: use pytest fixture instead

* test: bump mistral model
2025-05-31 10:06:42 -07:00
Krish Dholakia 5d4ae9aa4d Support dropping non-openai params when specified in additional_drop_params + Add VertexAI Anthropic support on /v1/messages (#11246)
* feat(utils.py): support dropping non-openai params when specified via additional drop params

Closes https://github.com/BerriAI/litellm/issues/11205

* fix(utils.py): fix linting error

* refactor(handler.py): add custom llm provider to anthropic messages provider config exception

* feat: initial commit adding vertex ai anthropic support on `/v1/messages`

* test: add working unit test

* test(vertex_ai_partner_models/anthropic): add /v1/messages support for anthropic api

Adds vertex ai auth

* feat(vertex_ai/anthropic): return correct url when calling via `/v1/messages`

* fix: more alignment to expected anthropic request format

* fix: fix ruff linting check

* Removed syntax error from docs (#11242)

* [Feat]: Add Bedrock InvokeAgents as a /chat/completions route on LiteLLM (#11239)

* feat: init structure for bedrock AGENTs

* feat: add basic  routing for bedrock AGENTs

* feat: add basic transforms for bedrock AGENTs

* fix: url for bedrock agent runtime

* fix: working agents request

* feat: working agents non-streaming request

* feat: bedrock agents

* feat: add streaming for bedrock agents

* feat: add cost tracking for bedrock agents

* docs litellm with bedrock agents

* fix: linting errors

* test: invoke agents tests

* fix: import session handling

* Revert "fix: import session handling"

This reverts commit deb257dc10.

* fix: linting pin mypy

* [Feat]: Guardrails - Add streaming for bedrock post guard (#11247)

* feat: add streaming for bedrock post guard

* fix: bedrock guardrails

* fix: add clear comments

* Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: clean up bedrock guardrails

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* [Fix] Responses API - Session management  (#11254)

* fix: import session handling

* fix: imports for session handler

* tests: tests for session handler

* Update enterprise/litellm_enterprise/enterprise_callbacks/session_handler.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* bump: bump litellm enterprise

* fixes: test_create_user_default_budget

* fix: fix linting error

* fix: fix linting error

---------

Co-authored-by: Fadil Rahman <87557055+fadil4u@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-29 23:42:48 -07:00
Ishaan Jaff 5e6f6ddc52 [Feat]: Add Bedrock InvokeAgents as a /chat/completions route on LiteLLM (#11239)
* feat: init structure for bedrock AGENTs

* feat: add basic  routing for bedrock AGENTs

* feat: add basic transforms for bedrock AGENTs

* fix: url for bedrock agent runtime

* fix: working agents request

* feat: working agents non-streaming request

* feat: bedrock agents

* feat: add streaming for bedrock agents

* feat: add cost tracking for bedrock agents

* docs litellm with bedrock agents

* fix: linting errors

* test: invoke agents tests
2025-05-29 16:48:55 -07:00
Ishaan Jaff 215fa133d6 [Fix] - Duplicate maxTokens parameter being sent to Bedrock/Claude model with thinking (#11181)
* fix: using thinking with bedrock models

* fix: using thinking with bedrock models
2025-05-27 08:16:39 -07:00
Adam Holmberg c93a78cd6c feat: Make gemini accept the openai parameter parallel_tool_calls (#11125)
* feat: Make gemini accept the openai parameter parallel_tool_calls

When mapping, allow the parameter: True because that is the
intrinsic behavior of Gemini. Allow False, but reject if there
are multiple tools because there's no actual equivalent in Gemini.

fixes #9686

ref: issues/9686

* chore: cleanup and move test_vertex.py down to tests/litellm

as suggested in https://github.com/BerriAI/litellm/pull/11125#discussion_r2105905871
2025-05-26 07:51:27 -07:00
Krish Dholakia 010a4d44af Fix passing standard optional params (#11124)
* fix(main.py): use processed non-default-params as standard input params for langfuse

Fixes https://github.com/BerriAI/litellm/issues/11072

 Fixes https://github.com/BerriAI/litellm/issues/11096

* fix(main.py): rename variable to be more accurate

* test(test_langfuse_e2e_test.py): add router unit test for langfuse e2e testing

Prevent https://github.com/BerriAI/litellm/issues/11072 from happening again

* build: update lock

* fix(utils.py): refactor optional params function

make it easier to get the standardized non default params

* fix(utils.py): improve process non default params function

* fix(main.py): include provider specific params in processed non default params used in logging

ensures user can see any provider specific params on langfuse

 ensures user can see any provider specific params on langfus e
2025-05-24 12:12:31 -07:00
Ishaan Jaff 7548e87cf8 test fix xai 2025-05-24 07:25:47 -07:00