Commit Graph
691 Commits
Author SHA1 Message Date
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
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 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
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
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
932f06104d fix: include IMAGE token count in cost calculation for Gemini models (#18876)
* fix: include IMAGE token count as separate usage count and pricing

* fix: remove duplicate TypedDict key and variable definitions

- Remove duplicate input_cost_per_image_token in ModelInfoBase TypedDict
- Remove duplicate image_tokens variable declaration in _calculate_usage()

Fixes MyPy errors:
- types/utils.py:146: Duplicate TypedDict key
- vertex_and_google_ai_studio_gemini.py:1541: Name already defined

---------

Co-authored-by: Thomas Rehn <271119+tremlin@users.noreply.github.com>
2026-01-12 17:03:42 +05:30
Igal BoxermanandGitHub 6bb63525db fix(guardrails): fix SerializationIterator error and pass tools to guardrail (#18932)
* fix(generic-guardrail-api): fix SerializationIterator error on multimodal requests

When sending multimodal messages (with images) through the Generic Guardrail API,
the `model_dump()` call fails with "Object of type SerializationIterator is not
JSON serializable" error.

Root cause: The `ChatCompletionAssistantMessage` type defines `content` as an
`Iterable` (not just `List`), and Pydantic's `model_dump()` creates a
`SerializationIterator` for iterables which is not JSON serializable.

Fix: Use `model_dump(mode="json")` which properly converts all iterables to
lists and ensures all complex objects are JSON serializable.

* fix(guardrails): pass tools (function definitions) to guardrail inputs

The unified guardrail handler was not passing the `tools` parameter
(function definitions) from the request to the guardrail inputs.
This meant guardrails could not inspect or validate tool definitions.

Added extraction of `data.get("tools")` and inclusion in the
GenericGuardrailAPIInputs passed to `apply_guardrail()`.

* test(guardrails): add tests for tools passed to guardrail

Added tests verifying that tools (function definitions) are correctly
passed to guardrails in the unified guardrail handler:
- test_tools_passed_to_guardrail
- test_multiple_tools_passed_to_guardrail
- test_no_tools_in_request
- test_tools_and_tool_calls_both_passed
2026-01-12 16:27:54 +05:30
Sameer Kankute 508e4da40e Fix: respect max_completion_tokens in thinking feat 2026-01-12 12:44:46 +05:30
Sameer KankuteandGitHub c96a7e80dd Merge pull request #18898 from yogeshwaran10/litellm_fix_gemini_token_usage_details
fix: missing completion_tokens_details in gemini 3 flash when reasoning_effort is not used (#18896)
2026-01-12 12:33:40 +05:30
Sameer Kankute 3c1ffda117 Add: missing anthropic tool results 2026-01-12 11:44:07 +05:30
yogeshwaran10 0e960df8f4 refactor(tests): move gemini token usage tests to test_vertex_and_google_ai_studio_gemini.py 2026-01-12 11:20:13 +05:30
Sameer Kankute dabb459d2b Fix : model id encoding for bedrock passthrough 2026-01-12 10:57:17 +05:30
Sameer Kankute aa97a34a83 Fix tests/test_litellm/llms/bedrock/test_base_aws_llm.py 2026-01-12 09:05:28 +05:30
Sameer Kankute a9e57cf272 [Bug]: Add Custom CA certificates to boto3 clients 2026-01-12 09:05:09 +05:30
Ishaan Jaffer 6a9041e67d Revert "aws fix base"
This reverts commit 225f411abc.
2026-01-10 14:08:11 -08:00
Ishaan Jaffer ff8e9aeb5c Revert "Add support for Vertex AI API keys"
This reverts commit ad501048f3.
2026-01-10 13:39:49 -08:00
Ishaan JaffandGitHub c0cf8bc27d [Feat] Manus FILES API - Add File upload, get, delete, list (#18904)
* add MANUS get response

* init TwoStepFileUploadRequest

* init TwoStepFileUploadConfig

* add async_create_file to handle 2 step uploads

* init ManusFilesConfig

* add add get_provider_files_config MANUS

* fix validate_environment

* test_manus_files_api_e2e_all_methods

* aws fix base

* init files API MANUS

* test_manus_responses_api_with_file_upload

* mypy lint fixes

* fix BedrockFilesConfig

* manus docs

* docs manus

* mypy lint

* add add fix resposne api utils MANUS
2026-01-10 13:27:54 -08:00
Ishaan Jaffer 3c3ed3bcfb fix resposne api utils 2026-01-10 13:25:31 -08:00
yogeshwaran10 d98c71f07e Fixes #18896 : Handle missing completion_tokens_details when reasoning_effort is not used 2026-01-11 00:45:42 +05:30
Sameer KankuteandGitHub cb03e5a6dd Merge pull request #18852 from BerriAI/litellm_add_ssl_verify_bedrock
[Bug]: Add Custom CA certificates to boto3 clients
2026-01-10 11:41:32 +05:30
Shivam RawatandGitHub 43dd0e6ef5 remove model before casting it in the transformation (#18810) 2026-01-10 00:43:38 +05:30
Sameer KankuteandGitHub 8dac83e093 Merge pull request #18859 from BerriAI/litellm_azure_image_gen_fix
Fix: response_format leaking into extra_body
2026-01-09 23:09:27 +05:30
AndrésandGitHub 9768eca33e fix(azure): add logprobs support for Azure OpenAI GPT-5.2 model (#18856)
* fix(azure): add logprobs support for Azure OpenAI GPT-5 models

Azure OpenAI GPT-5 models (including gpt-5.2) support logprobs
parameters, unlike OpenAI's GPT-5 reasoning models. This fix
overrides the parent class restriction to enable logprobs for Azure.

Changes:
- Override get_supported_openai_params() in AzureOpenAIGPT5Config
- Add "logprobs" and "top_logprobs" to supported params
- Add comprehensive tests for logprobs functionality

Testing:
- Verified with direct Azure API calls to gpt-5.2
- API version: 2025-01-01-preview
- Successfully returns logprobs data

Related: #7974, #4022

* refactor: restrict logprobs support to gpt-5.2 only

Only gpt-5.2 has been verified to support logprobs on Azure.
Other gpt-5 variants (gpt-5, gpt-5.1) have not been tested.

Changes:
- Add conditional check for is_model_gpt_5_2_model()
- Update tests to be specific to gpt-5.2
- Add negative tests for gpt-5 and gpt-5.1
- Update documentation to reflect gpt-5.2 specificity
2026-01-09 22:57:50 +05:30
Sameer KankuteandGitHub 844c766c65 Merge pull request #18763 from BerriAI/litellm_staging_01_07_2026
Staging - 01/07/2026
2026-01-09 17:01:58 +05:30
Sameer Kankute ffa0d6706c Fix: response_format leaking into extra_body 2026-01-09 16:53:35 +05:30
Justas Brazauskas c0ee5da444 Fix: Add thought_signatures to VertexGeminiConfig and test 2026-01-09 10:03:45 +02:00
Sameer Kankute c6101ef977 [Bug]: Add Custom CA certificates to boto3 clients 2026-01-09 12:30:36 +05:30
Sameer KankuteandGitHub d9b275e62a Merge pull request #18806 from BerriAI/litellm_vertex_ai_api_key_support
[FEAT]: Add support for Vertex AI API keys
2026-01-09 09:44:36 +05:30
Cesar GarciaandGitHub 2ef8bbdf6a fix: add xiaomi_mimo to LlmProviders enum to fix router support (#18819)
Added XIAOMI_MIMO to the LlmProviders enum in types/utils.py.
The provider was already configured in providers.json but was
missing from the enum, causing "Unsupported provider" errors
when using it in Router/Proxy configurations.

Also added comprehensive unit tests to prevent regression.
2026-01-08 23:45:57 +05:30
Ishaan JaffGitHubCopilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
b482d336b3 [Feat] New provider - Manus API on /responses, GET /responses (#18804)
* init ManusResponsesAPIConfig

* init MANUS ApI

* init MANUS create responses

* init MANUS

* test_extract_agent_profile

* transform_get_response_api_request

* test fix

* fixes non stream

* fix streaming

* add MANUSConfig

* test_multiturn_responses_api

* code QA check

* add manus

* Potential fix for code scanning alert no. 3961: Clear-text logging of sensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-01-08 18:37:42 +05:30
Sameer KankuteandGitHub c023c69eae Merge pull request #18739 from BerriAI/litellm_fix_deepinfra_tool_call
[Fix]: Tool content should be string for Deepinfra
2026-01-08 15:41:56 +05:30
Sameer KankuteandGitHub 0eb20ad500 Merge pull request #18745 from BerriAI/litellm_fix_gemini_audio_file_upload
Fix: Gemini generate content request with audio file id
2026-01-08 15:30:09 +05:30
Sameer KankuteandGitHub df7337fd38 Merge pull request #18800 from BerriAI/litellm_add_model_id_support_bedrock
Add support for model id in bedrock passthrough
2026-01-08 15:29:47 +05:30
Sameer KankuteandGitHub e0662d53a2 Merge pull request #18799 from BerriAI/litellm_fix_claude_usage_object
Fix: Incomplete usage in response object passed
2026-01-08 15:29:26 +05:30
Sameer KankuteandGitHub c95544959b Merge pull request #18808 from BerriAI/main
merge main
2026-01-08 15:25:50 +05:30
Sameer KankuteandGitHub 6941a29ad3 Merge pull request #18807 from BerriAI/main
merge main
2026-01-08 15:25:13 +05:30
Sameer Kankute ad501048f3 Add support for Vertex AI API keys 2026-01-08 15:22:14 +05:30
Emerson GomesandGitHub 6c00f6f342 Add support to zai glm-4.7 model in Vertex (#18782)
* Add support to zai glm-4.7 model in Vertex

* Avoid failed on missing 'created' streaming chunk key
2026-01-08 13:20:02 +05:30
Sameer Kankute c78bf8cfcd Add support for model id in bedrock passthrough 2026-01-08 13:03:58 +05:30
Sameer Kankute 7e98843d97 Fix: Incomplete usage in response object passed 2026-01-08 10:57:07 +05:30
Elkhan EminovandGitHub bae625bdc6 OpenRouter embeddings API support (#18391)
* support for OpenRouter embeddings

* add bearer

* add content header
2026-01-08 00:57:31 +05:30
Ishaan Jaffer 3530218930 fix aupload_container_file 2026-01-07 14:19:36 +05:30
Sameer Kankute d3e24ab9cd Fix: Gemini generate content request with audio file id 2026-01-07 12:58:54 +05:30
Sameer Kankute bf506378b8 Fix: tool content should be str 2026-01-07 11:01:31 +05:30