Commit Graph

2890 Commits

Author SHA1 Message Date
Krrish Dholakia
0fbcc01173 feat(types/utils.py): support 'images' field in output
Compatible with Openrouter response format

 Closes https://github.com/BerriAI/litellm/pull/14151
2025-09-01 18:05:16 -07:00
Ishaan Jaff
4c7b3e10ed
[Bug Fix] Gemini Tool Calling - fix gemini empty enum property (#14155)
* fix: _convert_schema_types

* fix recursive detector

* test_convert_schema_types_type_array_conversion

* fix: DEFAULT_NUM_WORKERS_LITELLM_PROXY

* add _fix_enum_empty_strings

* test_tool_call_with_empty_enum_property

* test_fix_enum_empty_strings

* fix _fix_enum_empty_strings
2025-09-01 17:05:01 -07:00
Ishaan Jaff
7656cb3d6e test fix 2025-09-01 17:04:47 -07:00
Ishaan Jaff
2331fb45d5
[Bug]: Gemini 2.5 Pro – schema validation fails with OpenAI-style type arrays in tools (#14154)
* fix: _convert_schema_types

* fix recursive detector

* test_convert_schema_types_type_array_conversion

* fix: DEFAULT_NUM_WORKERS_LITELLM_PROXY
2025-09-01 16:53:20 -07:00
Ishaan Jaff
98d57b5d27
[Feat] Allow using x-litellm-stream-timeout header for stream timeout in requests (#14147)
* fix: allow passing stream_timeout header

* fix: _get_stream_timeout_from_request

* test_add_litellm_data_to_request_with_stream_timeout_header

* docs: LiteLLM Headers

* test_add_litellm_data_to_request_with_stream_timeout_header
2025-09-01 15:59:14 -07:00
Ishaan Jaff
58b713d19d
[Bug fix] Misclassified 500 error on invalid image_url in /chat/completions request (#14149)
* add ImageFetchError

* docs ImageFetchError

* fix ImageFetchError

* test_completion_with_invalid_image_url
2025-09-01 15:26:27 -07:00
Sameer Kankute
c51665ec9c
fix xai cost calculation (#14127) 2025-09-01 11:31:56 -07:00
Ishaan Jaff
34275ab273 Revert "Merge pull request #14005 from moshemorad/bedrock_fix_structure_output"
This reverts commit 75c327cb9e, reversing
changes made to afa687182a.
2025-08-30 13:37:10 -07:00
Ishaan Jaff
48d3aad68f test_caching_with_models_v2 2025-08-30 13:21:14 -07:00
Ishaan Jaff
c9b86775a7 test_system_message_with_no_user_message 2025-08-30 13:09:25 -07:00
Ishaan Jaff
7ff93cd1b1 Revert "Merge pull request #12865 from aholmberg/holmberg/default-reasoning"
This reverts commit 68f4847659, reversing
changes made to df39320889.
2025-08-30 13:07:33 -07:00
Ishaan Jaff
3cb8e23dfe Revert "Merge pull request #14026 from TomeHirata/citation-supported-text"
This reverts commit afa687182a, reversing
changes made to 55186dad4c.
2025-08-30 11:23:18 -07:00
Ishaan Jaff
dc6161535a fix for supports_reasoning check added in 68f4847659 2025-08-30 11:06:02 -07:00
Ishaan Jaff
de6b08e76e test_supports_tool_choice 2025-08-30 10:35:16 -07:00
Ishaan Jaff
3fc2198d27 fix: test_gemini_image_generation_async_stream 2025-08-30 10:33:23 -07:00
Ishaan Jaff
efebf7ec7b test_gemini_image_generation_async 2025-08-30 10:29:24 -07:00
Ishaan Jaff
fd39f22e3e test_completion_openrouter_reasoning_content 2025-08-30 09:27:37 -07:00
Krish Dholakia
8b11452d9e
Merge branch 'main' into add-vercel-ai-gateway-provider 2025-08-29 22:27:08 -07:00
Krish Dholakia
ead7e7259b
Merge pull request #13152 from betterthanbreakfast/bug-openmeter-user-id-from-token
[Bug]: Set user from token user_id for OpenMeter integration
2025-08-29 22:21:26 -07:00
Krish Dholakia
75c327cb9e
Merge pull request #14005 from moshemorad/bedrock_fix_structure_output
Bedrock fix structure output
2025-08-29 22:04:51 -07:00
Krish Dholakia
afa687182a
Merge pull request #14026 from TomeHirata/citation-supported-text
Add supported text field to anthropic citation response
2025-08-29 22:02:18 -07:00
Ishaan Jaff
562790cb31 fix: /v1/realtime check 2025-08-29 18:38:14 -07:00
Ishaan Jaff
37d885e46a
[Fix] LiteLLM does not support new web_search tool (Responses API) (#14083)
* test_basic_openai_responses_with_websearch

* fix: ResponsesAPIResponse

* fix: StandardBuiltInToolCostTracking
2025-08-29 18:33:52 -07:00
Ishaan Jaff
5ee7a675f2
[Bug]: grok-4 does not support frequency_penalty, litellm should drop this param for grok-4 (#14078)
* fix: _supports_frequency_penalty

* _supports_frequency_penalty

* test_xai_grok_4_frequency_penalty_not_supported
2025-08-29 17:31:48 -07:00
Ishaan Jaff
607f425cc6
[Bug]: Fix Can't set reasoning_effort for DeepSeek-V3.1 on DeepInfra by default (#14053)
* fix DeepInfraConfig

* track supports reasoning

* fix: get_supported_openai_params

* test_deepseek_supported_openai_params
2025-08-29 13:15:43 -07:00
Krish Dholakia
bcd38dde2e
Merge pull request #14036 from gotsysdba/main
OCI Provider: add oci_key_file as an optional_parameter
2025-08-29 06:27:09 -07:00
Krish Dholakia
fffccc0675
Merge pull request #14042 from WilsonSunBritten/10988-set-truncation-threshold
Allow configuration to set threshold before request entry in spend log gets truncated
2025-08-29 06:24:28 -07:00
Krish Dholakia
dd33e3f928
Merge pull request #14050 from lmwang9527/fix/logging-worker-graceful-shutdown
Fix LoggingWorker graceful shutdown to prevent CancelledError warnings
2025-08-29 06:23:53 -07:00
WilsonSunBritten
b3edff02e8 fix mock tests 2025-08-28 17:40:16 -06:00
WilsonSunBritten
0721345703 Switch to string constant based truncation 2025-08-28 16:28:36 -06:00
Ishaan Jaff
37a599932d
[Bug Fix] Virtual keys with llm_api type cause Internal Server Error when using /anthropic/* and other llm passthrough routes (#14046)
* fix route checks passthrough_routes_wildcard

* refactor check_route_access

* test_virtual_key_llm_api_route_includes_passthrough_prefix
2025-08-28 15:14:09 -07:00
WilsonSunBritten
026480358b Revert "Allow configuration to on what threshold to try truncating request content in db"
This reverts commit 771052d67d.
2025-08-28 16:12:42 -06:00
lmwang
6760a6aaa1 Fix LoggingWorker graceful shutdown to prevent CancelledError warnings
- Change exception logging to debug level during shutdown cancellation
- Add clear_queue() call to process remaining coroutines during shutdown
- Prevents 'RuntimeWarning: coroutine was never awaited' messages
- Add comprehensive tests for graceful shutdown behavior

Fixes #13970
2025-08-28 14:15:17 -07:00
Wilson Britten
771052d67d Allow configuration to on what threshold to try truncating request content in db 2025-08-28 09:48:50 -06:00
gotsysdba
15f1d82536
Fix tests 2025-08-28 14:54:38 +01:00
gotsysdba
87abfc3c11
Adding oci_key_file support for oci provider 2025-08-28 14:37:53 +01:00
Mohse Morad
8cce5e6307 Added tests 2025-08-28 12:21:35 +03:00
Tomu Hirata
11228e946b add supported text field to anthropic citation response 2025-08-28 14:39:00 +09:00
Krish Dholakia
e638c5490d
Merge pull request #13945 from NoWall57/feature/force-anthropic-custom-api-base
feat: Add support for custom Anthropic-compatible API endpoints
2025-08-27 22:28:55 -07:00
Krish Dholakia
74c9663189
Merge pull request #12797 from ericgtkb/fix-vertex-ai-anyof
Fix additional anyOf corner cases for Vertex AI Gemini tool calls - issue #11164
2025-08-27 22:26:13 -07:00
Krish Dholakia
fc738c5822
Merge branch 'main' into holmberg/default-reasoning 2025-08-27 22:25:22 -07:00
Krish Dholakia
67d432a6d7
Merge pull request #13243 from nagyv-team/main
Ensure that `function_call_prompt` extends system messages following its current schema
2025-08-27 22:16:53 -07:00
Krish Dholakia
10816a44d4
Merge pull request #13160 from pangeacyber/aidr-update
Update Pangea Guardrail to support new AIDR endpoint
2025-08-27 22:15:32 -07:00
Krish Dholakia
a913ecf60b
Merge branch 'main' into feat/github-copilot-thinking-reasoning-support 2025-08-27 22:09:15 -07:00
Krish Dholakia
f01c7d13e7
Merge pull request #13991 from ikaadil/fix/gemini-imagen-model-name-validation
[Bug Fix] Resolve invalid model name error for Gemini Imagen models
2025-08-27 21:56:19 -07:00
Ishaan Jaff
04dc1a5351
[Feat] Add support for returning images with gemini/gemini-2.5-flash-image-preview with /chat/completions (#13983)
* add gemini-2.5-flash-image-preview

* add gemini-2.5-flash-image-preview

* add image in ChatCompletionResponseMessage

* test_gemini_image_generation_async

* Revert "Merge pull request #13394 from Deviad/feature/enhance_logging_for_containers"

This reverts commit 539b94ad4e, reversing
changes made to 71af7bcf9c.

* include `image` in Delta

* fix _process_candidates should show the image response

* fix: _handle_special_delta_attributes

* test_gemini_image_generation_async_stream

* image_generation_chat

* UI - allow looking at generated images from /chat/completions

* _create_streaming_choice

* fix import StreamingChoices

* fix ChatCompletionResponseMessage

* test_gemini_image_generation

* add gemini img migration

* fix _extract_candidate_metadata

* ui fix

* fix batch endpoint test
2025-08-27 16:16:19 -07:00
Xingyao Wang
9acf80b8ad
Fix issue #13995: Handle None metadata in batch requests (#13996)
* Fix issue #13995: Handle None metadata in batch requests

- Added null check in add_key_level_controls method to prevent NoneType error
- Updated type hint to Optional[dict] for better type safety
- Added comprehensive test suite to verify the fix works correctly
- All existing tests pass, confirming no regression

Fixes #13995

Co-authored-by: openhands <openhands@all-hands.dev>

* Move test file to tests/test_litellm/proxy/ directory

- Moved test_batch_metadata_none_fix.py from tests/ to tests/test_litellm/proxy/
- Updated import structure to match existing test patterns
- This ensures the test runs in GitHub Actions as requested by @krrishdholakia

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2025-08-27 14:51:09 -07:00
Ishaan Jaff
165242e31f
[Feat] langfuse_otel logger - allow using LANGFUSE_OTEL_HOST for configuring host (#14013)
* feat - add _get_langfuse_otel_host

* test_get_langfuse_otel_config_with_otel_host_priority

* docs: LANGFUSE_OTEL_HOST
2025-08-27 14:43:47 -07:00
Ifta Khairul Alam Adil
75aeca14b2 Merge branch 'main' into fix/gemini-imagen-model-name-validation 2025-08-27 21:52:47 +02:00
Sam Xie
ee13c65701
[Bug]: /responses endpoint proxy ignores extra_headers in GitHub Copilot (#13775)
* fix: pass extra_headers parameter through responses API transformation chain

Ensure extra_headers parameter is properly forwarded from the responses() function
through the transformation handler and config to maintain header propagation in
litellm_completion_request dict.

* Add tests
2025-08-27 12:35:09 -07:00