Commit Graph
5648 Commits
Author SHA1 Message Date
Ryan MalloyandGitHub f76938af5e fix(ollama): set finish_reason to tool_calls and remove broken capability check (#18924)
* Update CLAUDE.md with qwen3 tool_calls bug fix instructions (#18922)

* fix(ollama): set finish_reason to "tool_calls" when tool_calls present

When qwen3 models return tool_calls through Ollama, the finish_reason
was incorrectly left as "stop" instead of being set to "tool_calls".
This caused clients to miss the tool_calls in the response.

Added _get_finish_reason helper method following OpenAI provider's
pattern, and fixed both streaming and non-streaming response paths.

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

* fix(ollama): pass tools directly without model capability check

The previous code tried to check model capability via get_model_info()
which made network calls to localhost:11434. When Ollama is remote,
this fails and falls back to JSON format, breaking tool calling.

Ollama 0.4+ supports native tool calling - let Ollama handle
model capability detection instead of LiteLLM.

Fixes #18922

* fix(ollama): transform tool_calls response to OpenAI format

Ollama returns tool_calls with arguments as dict, but OpenAI format
requires arguments to be a JSON string. Also ensures 'type': 'function'
field is present.

Completes the fix for #18922

* fix(ollama): set finish_reason to "tool_calls" when tool_calls present

Fixes #18922

Two issues addressed:

1. Remove broken model capability check
   - get_model_info() fails when Ollama runs on remote server
   - Broken fallback triggered JSON prompt injection
   - Now passes tools directly - Ollama 0.4+ handles detection

2. Set finish_reason correctly
   - Was hardcoded to "stop" even with tool_calls present
   - Clients use this to know how to process the response
   - Now returns "tool_calls" when tool_calls are in response

Both streaming and non-streaming responses are fixed.

Tests:
- All 14 existing Ollama tests pass
- Added 3 focused tests for the fixes
2026-01-14 03:52:26 +05:30
xiaofanandGitHub f8836cb2a7 Fix Swagger UI path with server_root_path in OpenAPI schema (#18947)
Adds 'servers' field to OpenAPI schema when server_root_path is set, ensuring correct Swagger UI execute path for reverse proxies and subpath deployments. Includes tests to verify correct server URL handling for various root path formats.
2026-01-14 03:48:43 +05:30
Mateusz SzewczykandGitHub 72dc65fbb4 chore: allow passing scope id for watsonx inferencing (#18959)
* chore: allow inference with space

* make lint and make format
2026-01-14 03:47:20 +05:30
Matthias HumtandGitHub 9adc19deab Normalize OpenAI SDK BaseModel choices/messages to avoid Pydantic serializer warnings (#18972)
* Normalize BaseModel choices + suppress serializer warnings

* Fix ModelResponse normalization and test deps
2026-01-14 03:40:11 +05:30
cbb72045a3 fix(ui): use non-streaming method for endpoint v1/a2a/message/send in… (#19025)
* Add end to end integration tests for batches

* Add end to end integration tests for batches

* Add end to end integration tests for batches

* Fix linter errors: remove unused imports and variables

* Add end to end integration tests for batches

* Add end to end integration tests for batches

* Add end to end integration tests for batches

* Add end to end integration tests for batches

* chore: document temporary grype ignore for CVE-2019-1010022

* chore: add config option

* chore: add ALLOWED_CVES

* refetch after key create

* test: remove flaky azure oidc embedding test

* fixing build

* bump: version 1.80.15 → 1.80.16

* [Fix] MSFT SSO - allow setting custom MSFT Base URLs (#18977)

* fix TestCustomMicrosoftSSO

* init CustomMicrosoftSSO

* use CustomMicrosoftSSO

* docs fix

* docs fix

* [Feat] UI Feedback Form - why LiteLLM  (#18999)

* init survey prompt

* init survey modal

* init Survey Modal

* POST feedback hook

* survey Modal

* add other

* in product survey fixes

* fix survey prompt

* fix survey

* fix build

* ui new build

* [Feat] MSFT SSO - allow overriding env var attribute names  (#18998)

* add MSFT SSO constants

* fix MSFT SSO env vars

* test_microsoft_sso_handler_openid_from_response_with_custom_attributes

* Add pricing of azure_ai/claude-opus-4-5

* test: temporarily disable flaky responses_id_security tests

* fix(ui): use non-streaming method for endpoint v1/a2a/message/send in A2A playground

'

---------

Co-authored-by: Ephrim Stanley <ephrim.stanley@point72.com>
Co-authored-by: Yuta Saito <uc4w6c@bma.biglobe.ne.jp>
Co-authored-by: yuneng-jiang <yuneng.jiang@gmail.com>
Co-authored-by: YutaSaito <36355491+uc4w6c@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Sameer Kankute <sameer@berri.ai>
2026-01-14 03:29:10 +05:30
Jack Temple 9e08c2207f fix: enable JSON logging via configuration and add regression test 2026-01-13 09:38:19 -07:00
Sameer KankuteandGitHub 93203cda7c Merge pull request #19027 from BerriAI/litellm_add_0_budget_model_bypass
[Feat] Add support for 0 cost models
2026-01-13 18:05:36 +05:30
Sameer KankuteandGitHub e98c2e4425 Merge pull request #19012 from BerriAI/litellm_fix_model_deployment_routing
Fix: Model matching priority in configuration
2026-01-13 17:55:01 +05:30
Sameer KankuteandGitHub bb0ab38636 Merge pull request #19007 from BerriAI/litellm_fix_header_forwarding_passthrough
Fix: Header forwarding in bedrock passthrough
2026-01-13 17:50:14 +05:30
Sameer KankuteandGitHub 54f6f55c98 Merge pull request #18873 from BerriAI/litellm_staging_01_09_2026
staging 01/09/2025
2026-01-13 17:31:44 +05:30
Sameer Kankute de6330b6b6 Fix test_async_otel_callback[False] 2026-01-13 16:59:17 +05:30
Sameer Kankute 762a3ef090 Add support for 0 cost models 2026-01-13 16:39:57 +05:30
Sameer KankuteandGitHub d656f01bc9 Merge pull request #19009 from Dima-Mediator/fix-image-tokens-spend-logging
Fix image tokens spend logging for /images/generations
2026-01-13 15:03:37 +05:30
Igal Boxerman 8cff86ff01 fix(guardrails): use clean error messages for blocked requests (#19022)
- Add `should_wrap_with_default_message` parameter to GuardrailRaisedException
- Update Generic Guardrail API to use clean error messages without wrapper
- When should_wrap_with_default_message=False, exception shows the original
  blocked_reason directly (e.g., "pii detected") instead of verbose format
- Update test to verify GuardrailRaisedException is raised with clean message
2026-01-13 11:02:06 +02:00
Yuta Saito 2c8ac2c3f1 test: temporarily disable flaky responses_id_security tests 2026-01-13 15:51:37 +09:00
Sameer KankuteandGitHub ecb3959c3c Merge pull request #18208 from Chesars/fix/case-insensitive-model-cost-lookup
fix: case-insensitive model cost map lookup
2026-01-13 11:53:43 +05:30
Sameer Kankute dfece51f8c Fix: Model matching priority in configuration 2026-01-13 11:44:48 +05:30
Sameer Kankute 005541075b Fix: Header forwarding in bedrock passthrough 2026-01-13 09:45:14 +05:30
Dima-Mediator 7c61933bc5 Fix image tokens spend logging for /images/generations 2026-01-12 23:07:08 -05:00
Ishaan JaffandGitHub a1bba8c99b [Feat] MSFT SSO - allow overriding env var attribute names (#18998)
* add MSFT SSO constants

* fix MSFT SSO env vars

* test_microsoft_sso_handler_openid_from_response_with_custom_attributes
2026-01-12 18:56:35 -08:00
Sameer KankuteandGitHub a727aa9980 Merge pull request #18340 from Point72/ephrimstanley/fix-batch
Fix batch deletion and retrieve
2026-01-13 08:13:43 +05:30
Ishaan JaffandGitHub 21d611554b [Fix] MSFT SSO - allow setting custom MSFT Base URLs (#18977)
* fix TestCustomMicrosoftSSO

* init CustomMicrosoftSSO

* use CustomMicrosoftSSO

* docs fix

* docs fix
2026-01-12 18:26:53 -08:00
YutaSaitoandGitHub 9114e44b49 Merge pull request #18993 from BerriAI/litellm_fix_remove_flaky_test
[test] remove flaky azure oidc embedding test
2026-01-13 10:37:30 +09:00
Yuta Saito a57f1e2e08 test: remove flaky azure oidc embedding test 2026-01-13 10:34:01 +09:00
yuneng-jiang 567f723214 Merge remote-tracking branch 'origin' into litellm_user_promethus_metrics 2026-01-12 15:59:16 -08:00
yuneng-jiang a0a8412a7c Merge remote-tracking branch 'origin' into litellm_hakhundov_contribution 2026-01-12 15:58:12 -08:00
yuneng-jiangandGitHub c75a370619 Merge pull request #18910 from BerriAI/litellm_org_filtering_search
[Feature] /organization/list Query Params
2026-01-12 15:57:26 -08:00
YutaSaitoandGitHub 9caf685f1e Merge pull request #18940 from BerriAI/litellm_fix_extra_headers
[fix] forward MCP extra headers case-insensitively
2026-01-13 06:03:19 +09:00
Ephrim Stanley 99cb59c2d2 Add end to end integration tests for batches 2026-01-12 13:58:47 -05:00
Sameer KankuteandGitHub c2fcc6aa92 Merge pull request #18945 from BerriAI/litellm_add_anthropic_tool_call_results
Add: missing anthropic tool results in response
2026-01-12 22:11:51 +05:30
Sameer Kankute 01e690307e Fix: litellm/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py 2026-01-12 22:02:18 +05:30
Ephrim Stanley 3256eb21a0 Add end to end integration tests for batches 2026-01-12 10:43:09 -05:00
Ephrim Stanley 935c249c45 Add end to end integration tests for batches 2026-01-12 09:53:54 -05:00
Sameer KankuteandGitHub 5618da6605 Merge pull request #18960 from BerriAI/litellm_fix_embedding_forwardable_headers
Fix: Header forwarding for embeddings endpoint
2026-01-12 18:30:55 +05:30
Sameer KankuteandGitHub 4c0ca53153 Merge pull request #18962 from BerriAI/main
merge main
2026-01-12 18:30:28 +05:30
Sameer KankuteandGitHub 9a27a52424 Merge pull request #18956 from BerriAI/litellm_staging_01_12_2026
Litellm staging 01 12 2026
2026-01-12 18:27:57 +05:30
Sameer KankuteandGitHub 8b5e2bcf25 Merge pull request #18957 from BerriAI/litellm_respones_api_gaurdrails1
Fix: gaurdrail moderation support with responses API
2026-01-12 18:16:22 +05:30
Sameer KankuteandGitHub ebf61998e0 Merge pull request #18954 from BerriAI/litellm_replicate_support
[Feat] Add all chat replicate models support
2026-01-12 18:15:46 +05:30
Sameer KankuteandGitHub f44178c18d Merge pull request #18948 from BerriAI/litellm_gemini_imageConfig
Fix: [Bug]: Gemini Image Generation: imageConfig parameters
2026-01-12 18:14:19 +05:30
Sameer KankuteandGitHub 98f1a0d0c4 Merge pull request #18946 from BerriAI/litellm_add_max_completion_tokens_with_thinking_budget
Fix: respect max_completion_tokens in thinking feat
2026-01-12 18:13:23 +05:30
Sameer KankuteandGitHub ec3e30a221 Merge branch 'main' into litellm_add_anthropic_tool_call_results 2026-01-12 18:13:06 +05:30
Sameer KankuteandGitHub db32ac217a Merge pull request #18944 from BerriAI/litellm_fix_bedrock_passthrough_model_id
Fix : model id encoding for bedrock passthrough
2026-01-12 18:08:53 +05:30
Sameer KankuteandGitHub 27b4c68662 Merge pull request #18942 from BerriAI/litellm_add_ssl_verify_bedrock2
[Bug]: Add Custom CA certificates to boto3 clients
2026-01-12 18:06:32 +05:30
Sameer Kankute dbec9c7084 Fix: Header forwarding for embeddings endpoint 2026-01-12 18:00:48 +05:30
Cesar GarciaandGitHub a8282839e8 fix(text_completion): support token IDs (list of integers) as prompt (#18011)
* fix(text_completion): support token IDs (list of integers) as prompt

Add support for passing token IDs (list of integers) to the text_completion
endpoint for OpenAI-compatible providers (openai, azure, vllm, etc.).

Fixes #17118

* test(text_completion): replace live test with mock test for token IDs

Move token IDs test from local_testing to test_litellm with mocks
per PR review feedback.
2026-01-12 17:33:24 +05:30
Cesar GarciaandGitHub c81cd081e9 feat(bedrock): add OpenAI-compatible service_tier parameter translation (#18091)
* feat(bedrock): add OpenAI-compatible service_tier parameter translation

Translates OpenAI's service_tier parameter (string) to Bedrock's
serviceTier format (object with type field).

* docs(bedrock): add OpenAI-compatible service_tier parameter documentation

Document the automatic translation from OpenAI-style service_tier
parameter to Bedrock's native serviceTier format.

* feat(bedrock): add service_tier to response when present

According to OpenAI's API documentation, when service_tier is sent in the
request, it should be returned in the response. This commit implements
this behavior for Bedrock Converse API to maintain compatibility with
OpenAI's API.

Changes:
- Added serviceTier field to ConverseResponseBlock type definition
- Moved ServiceTierBlock definition before ConverseResponseBlock to fix
  type reference order
- Added response transformation to map Bedrock serviceTier (object) to
  OpenAI service_tier (string format)
- Added 4 new tests for response transformation with service_tier

The service_tier is only added to the response when present in Bedrock's
response, maintaining backward compatibility.
2026-01-12 17:28:49 +05:30
Sameer Kankute ab85eb8f43 Fix: gaurdrail moderation support with responses API 2026-01-12 17:27:13 +05:30
Cesar GarciaandGitHub 9a8e781cb9 fix(anthropic): preserve web_fetch_tool_result in multi-turn conversations (#18142)
Fixes #18137

Similar to the fix for web_search_tool_result (#17746, #17798), this PR
preserves web_fetch_tool_result blocks in multi-turn conversations.

Changes:
- Add handling for web_fetch_tool_result in transformation.py (non-streaming)
- Add capture of web_fetch_tool_result in handler.py (streaming)
- Fix streaming tool arguments bug where empty input {} was prepended to
  actual arguments by using empty string instead of str({})
- Add unit tests for web_fetch_tool_result handling
2026-01-12 17:18:33 +05:30
f7912990b7 fix(gemini): add presence_penalty support for Google AI Studio (#18154)
Fixes #14753

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-01-12 17:12:19 +05:30
Cesar GarciaandGitHub 573df855d3 fix(oci): handle OpenAI-style image_url object in multimodal messages (#18272)
The OCI adapter now accepts both string and object formats for image_url:
- String: "image_url": "https://example.com/image.png"
- Object: "image_url": {"url": "https://example.com/image.png"}

This fixes compatibility with OpenAI Vision API format.
2026-01-12 17:08:32 +05:30