Commit graph

971 commits

Author SHA1 Message Date
Krish Dholakia
12a1d081ee
Merge branch 'main' into litellm_dev_09_11_2025_p1 2025-10-08 19:02:58 -07:00
Javier de la Torre
df232a71f1 feat(snowflake): add function calling support for Snowflake Cortex REST API
Add support for function calling (tools) with Snowflake Cortex models that support it (e.g., Claude 3.5 Sonnet).

Changes:
- Add 'tools' and 'tool_choice' to supported OpenAI parameters
- Implement request transformation: OpenAI function format → Snowflake tool_spec format
- Implement response transformation: Snowflake content_list with tool_use → OpenAI tool_calls
- Add tool_choice transformation: OpenAI nested format → Snowflake array format

Request transformation:
- Transform tools from nested {"type": "function", "function": {...}} to Snowflake's {"tool_spec": {"type": "generic", "name": "...", "input_schema": {...}}}
- Transform tool_choice from {"type": "function", "function": {"name": "..."}} to {"type": "tool", "name": ["..."]}

Response transformation:
- Parse Snowflake's content_list array containing tool_use objects
- Extract tool calls with tool_use_id, name, and input
- Convert to OpenAI's tool_calls format with proper JSON serialization

Testing:
- Add 7 unit tests covering request/response transformations
- Add integration test for Responses API with tool calling
- All tests passing

Fixes issue #15218

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 13:08:33 +02:00
Ishaan Jaffer
be7ab0b3e3 test_gemini_url_context 2025-10-04 12:23:43 -07:00
Ishaan Jaffer
7a41c09529 test bedrock embedding tests marengo 2025-10-04 11:27:29 -07:00
Ishaan Jaffer
44db58c8df test_e2e_bedrock_async_invoke_embedding_async_twelvelabs_marengo 2025-10-04 11:13:39 -07:00
Ishaan Jaff
efa782d6d2
[Feat] Add Nvidia NIM Rerank Support (#15152)
* feat: add NvidiaNimRerankConfig

* fix: NvidiaNimRerankConfig

* fix: NvidiaNimRerankConfig

* fix routing to nvidia nim

* docs nvidia nim rerank

* TestNvidiaNim

* nvidia nim rerank fixes

* fix rerank

* transform_rerank_response

* Usage with LiteLLM Proxy

* fixes linting

* NvidiaNimRerankConfig.DEFAULT_NIM_RERANK_API_BASE

* fix Custom API Base URL

* fix rerank base

* fix main.py

* fix transform

* fix linting

* map_cohere_rerank_params

* ruff fix

* linting fixes

* ruff fix
2025-10-02 18:58:52 -07:00
Sameer Kankute
544db8d140
(feat)Litellm x twelvelabs bedrock[Async Invoke Support] (#14871)
* Add async invoke support

* Add docs and correct embedding response

* fix cicd erros

* fix cicd erros

* fix mypy error

* Add litellm param input_type

* Update the docs
2025-10-02 18:52:33 -07:00
Ishaan Jaff
7052108d19 test_completion_azure 2025-09-27 22:44:46 -07:00
Ishaan Jaff
32ed5ae2b9 test_completion_cost 2025-09-27 22:43:51 -07:00
Ishaan Jaffer
5077e36f1b test_completion_azure 2025-09-27 15:01:25 -07:00
Ishaan Jaffer
c27beb74b9 test fix 2025-09-27 12:40:34 -07:00
Ishaan Jaffer
97f0f3fe32 test_gemini_finish_reason 2025-09-27 10:57:22 -07:00
Ishaan Jaffer
68da131728 TestAzureEmbedding 2025-09-27 10:55:46 -07:00
Ishaan Jaffer
abe250dcd8 test_azure_embedding_max_retries_0 2025-09-27 10:32:47 -07:00
Ishaan Jaffer
f2f8391384 test azure openai fix 2025-09-27 10:17:16 -07:00
Ishaan Jaffer
c9c52b3ccc test_azure_ai_request_format 2025-09-27 10:05:57 -07:00
Ishaan Jaffer
a86e78f13a test_azure_ai_request_format 2025-09-27 09:58:00 -07:00
Ishaan Jaff
d04c6d4eea
[Feat] Add new anthropic web fetch tool support (#14951)
* add web_fetch tool for ANTHROPIC_HOSTED_TOOLS

* add ANTHROPIC_BETA_HEADER_VALUES, ANTHROPIC_HOSTED_TOOLS

* feat: add web fetch tool anthropic

* test_anthropic_tool_use

* docs web fetch

* docs fix

* docs fix
2025-09-26 11:04:11 -07:00
Alexsander Hamir
eaa04cd8ce
fix: use fastuuid helper (#14903)
* fix: use fastuuid helper across the codebase

First batch of changes, simple drop in replacement.

* second batch of changes

* fixed: script mistake on helper file
2025-09-25 15:47:01 -07:00
Mubashir Osmani
0cd91a82d2
Added vertex_ai/qwen models and azure/gpt-5-codex (#14844)
* added qwen models and gpt-5-codex

* fix flaky test

* fix failing test
2025-09-24 10:40:00 -07:00
Sameer Kankute
e132ad63f1
Merge pull request #14164 from TomeHirata/citation-supported-text-3
Add supported text field to anthropic citation response
2025-09-24 10:30:44 +05:30
Ishaan Jaffer
d0dcf8c81c test_rerank_custom_callbacks 2025-09-20 16:27:58 -07:00
Ishaan Jaffer
aa992fb86f test e2e bedrock embedding 2025-09-20 11:35:31 -07:00
Ishaan Jaffer
39cf690d50 test_e2e_bedrock_embedding_image_twelvelabs_marengodocs fix 2025-09-20 09:34:08 -07:00
Ishaan Jaffer
7236202e41 test fix 2025-09-20 09:28:15 -07:00
Krish Dholakia
0f0f4327a3
Merge pull request #14589 from timelfrink/fix/issue-14586-gemini-exception-messages
Fix: Updated error message for Gemini API
2025-09-19 23:29:21 -07:00
Ishaan Jaffer
eabc9cd415 test test_e2e_bedrock_embedding 2025-09-19 18:03:20 -07:00
Ishaan Jaffer
15898c89e1 test: test_azure_openai_gpt_5_responses_api 2025-09-19 17:45:34 -07:00
Tim Elfrink
5323ca8346 Fix Gemini 2.5 Flash Image Preview response parsing
- Add response_modalities configuration to request format
- Fix response parsing to use camelCase 'inlineData' instead of snake_case 'inline_data'
- Update test to validate proper request format and response parsing
- All existing Gemini image generation tests pass
2025-09-19 11:20:03 +02:00
Tim Elfrink
3a98fd6096 Remove hardcoded model name and fix breaking change
- Reverted GEMINI_2_5_FLASH_IMAGE_PREVIEW_MODEL constant usage
- Made endpoint selection conditional for gemini-2.5-flash-image-preview only
- Preserved existing Imagen models functionality with :predict endpoint
- Fixed potential breaking change that would affect 6 other Gemini image models
2025-09-19 09:29:14 +02:00
Tim Elfrink
f5e6246143 Add test for gemini-2.5-flash-image-preview fix
- Test validates correct endpoint routing to :generateContent
- Mock HTTP responses to avoid API limits
- Verify request format uses Gemini contents structure
- Ensure image generation functionality works correctly
2025-09-19 08:06:01 +02:00
Ishaan Jaff
80bd8e007f
fix contributor PR linting failing (#14710)
* validate fix

* fix linting error
2025-09-18 20:03:27 -07:00
Ishaan Jaff
4c983f985a
[Feat] Add Bedrock Twelve Labs embedding provider support (#14697)
* fix: add 12 labs to bedrock embedding

* fix: get_bedrock_embedding_provider

* test: test_text_embedding

* fix: 12 labs embedding transform

* fix: refactor 12 labs transform logic

* fix: test_e2e_bedrock_embedding

* fix: test_e2e_bedrock_embedding

* feat: add bedrock twelvelabs pricing

* DOCS: docs bedrock embedding

* DOCS: 12 labs bedrock overview

* fix: bedrock embeddings 12 labs
2025-09-18 17:16:45 -07:00
Ishaan Jaffer
e0bbc3f46b fix: test_cohere_request_body_with_allowed_params 2025-09-18 10:56:45 -07:00
Krish Dholakia
895c41efa3
Merge pull request #14619 from BerriAI/litellm_dev_09_16_2025_p1
UI - allow team member to view service account keys they create + Anthropic - include cache creation tokens in prompt token total (separate out during cost tracking)
2025-09-17 15:43:04 -07:00
Krrish Dholakia
e488312873 fix(utils.py): log cache_creation_tokens in prompt token details
Closes LIT-907
2025-09-16 18:24:10 -07:00
Krrish Dholakia
1162c52692 fix(anthropic/chat/transformation.py): include cache creation token count in final prompt token value
Closes LIT-907
2025-09-16 17:52:12 -07:00
Ishaan Jaffer
7de8811c4c test 2025-09-16 16:33:10 -07:00
Tim Elfrink
4d80a4a0fb Fix Gemini exception messages to show GeminiException
- Update exception mapping to show 'GeminiException' instead of 'VertexAIException'
- Add comprehensive HTTP status code mapping for Gemini provider (401, 403, 404, 408, 429, 500+)
- Maintain OpenAI-compatible error handling patterns
- Use LlmProviders enum constants for consistent provider identification
- Add comprehensive test coverage for Gemini exception mapping
2025-09-15 21:48:14 +02:00
Tim Elfrink
f6ff7042ba Add comprehensive tests for AWS external ID support
- Test external ID parameter propagation through authentication chain
- Cover both standard Bedrock and Converse API authentication flows
- Verify assume_role STS calls include ExternalId when provided
- Ensure backward compatibility when external ID not specified
- Add specific test for BedrockConverseLLM parameter extraction
- Extend existing dynamic parameter tests to include aws_external_id
2025-09-15 19:56:31 +02:00
Ishaan Jaff
ec32a0a7d7 fix: get_base_completion_call_args 2025-09-13 09:59:08 -07:00
Krrish Dholakia
3f3efea301 test(test_gemini.py): add additional testing for additionalproperties case 2025-09-11 15:12:21 -07:00
Krrish Dholakia
f0de7d1dfd fix: remove EOL model name 2025-09-09 21:15:12 -07:00
Krrish Dholakia
d05f58721e test: remove end of life model from tests 2025-09-09 21:01:45 -07:00
Krrish Dholakia
bff76715a5 test: skip test with invalid arn 2025-09-09 20:35:44 -07:00
Krrish Dholakia
07a83056a6 test: update test 2025-09-09 20:30:50 -07:00
Krrish Dholakia
44566977f1 test: update test 2025-09-09 20:18:03 -07:00
Krrish Dholakia
0854c35d3e test: remove eol bedrock model from tests 2025-09-09 19:48:35 -07:00
Krish Dholakia
351896cd1d
Merge pull request #12414 from dotmobo/feature/fix-timestamp-granularities
The parameter timestamp_granularities is broken for openai-like transcription
2025-09-08 23:13:13 -07:00
Krish Dholakia
8c5dd753cf
Merge pull request #12651 from ocraviotto/fix-gemini-400-when-no-user-msg
fix: ensure Gemini calls include a user message (fixes #9733)
2025-09-08 23:08:32 -07:00