Commit graph

1851 commits

Author SHA1 Message Date
Tim Elfrink
afd720a62f Fix CompactifAI provider tests and implementation
- Add missing provider_config parameter in main.py for proper HTTP handler integration
- Update tests to use correct respx mocking pattern with litellm.disable_aiohttp_transport
- Add get_error_class method to CompactifAI transformation for proper error handling
- Fix authentication error test to expect APIConnectionError instead of AuthenticationError
- All 8 CompactifAI tests now pass successfully
2025-09-15 22:03:42 +02:00
Tim Elfrink
9d7942eb35
Fix: Vertex AI Gemini labels field provider-aware filtering (#14563)
* Add comprehensive tests for Vertex AI Gemini labels provider filtering

- Test Google GenAI endpoints exclude labels even when explicitly provided
- Test Vertex AI endpoints include labels when provided
- Cover provider detection logic for different endpoint URLs
- Verify metadata-to-labels conversion only happens for Vertex AI
- Ensure edge cases are handled properly (null/empty api_base)

* Fix Vertex AI Gemini labels field provider-aware filtering

- Add _is_google_genai_endpoint() function to detect Google GenAI vs Vertex AI endpoints
- Update _transform_request_body() to accept api_base parameter
- Only include labels field for Vertex AI endpoints (not Google GenAI)
- Pass api_base through sync/async transform functions
- Maintain backward compatibility with existing usage
- Fixes issue where Google GenAI requests failed with unsupported labels field

* Refactor labels filtering to use custom_llm_provider instead of URL parsing

Replace URL-based endpoint detection with custom_llm_provider parameter
checking for cleaner, more reliable provider identification.

Changes:
- Remove _is_google_genai_endpoint() helper function
- Update labels condition to use custom_llm_provider != "gemini"
- Remove api_base parameter from _transform_request_body()
- Simplify sync/async transform function signatures
- Update tests to reflect new parameter structure
- Remove obsolete test_provider_detection test

This approach aligns with existing codebase patterns where
custom_llm_provider="gemini" identifies Google AI Studio endpoints
that don't support labels, while vertex_ai/vertex_ai_beta identify
Vertex AI endpoints that do support labels.

* Use LlmProviders.GEMINI constant instead of hardcoded string
2025-09-15 12:43:07 -07: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
Tim Elfrink
30c3e7b3d3
Fix: Bedrock cross-region inference profile cost calculation (#14566)
* Add tests for Bedrock cross-region inference profile mapping

- Test model mapping lookup works correctly
- Test proxy cost calculation scenario reproduces original issue
- Verify cost calculation returns expected values
- Ensure compatibility with existing test patterns

* Fix Bedrock cross-region inference profile cost calculation

- Add mapping for bedrock/us.anthropic.claude-3-5-haiku-20241022-v1:0
- Sync backup file for local testing consistency
- Resolve proxy spend tracking failures for cross-region profiles
- Maintain identical configuration with standalone profile

Fixes #14458
2025-09-15 07:10:20 -07:00
Sameer Kankute
110ce543c2
[Feat]Add cancel endpoint support for openai and azure (#14561)
* Add cancel endpoint support for openai
 and azure

* fix lint error

* fix cancel url contruction azure

* readd changes
2025-09-15 07:08:56 -07:00
Anubhav Singh
67276a8151
Merge branch 'main' into wandb-inference 2025-09-15 18:34:16 +05:30
LingXuanYin
c9e1088fda update docs 2025-09-15 16:17:09 +08:00
LingXuanYin
3bbe09ceb9 update test volcengine 2025-09-15 14:03:15 +08:00
LingXuanYin
bf7868bb0e fix volcengine thinking parameters missing if set disable
update test volcengine
2025-09-15 13:15:05 +08:00
Tim Elfrink
9521414efa Resolve merge conflict by including both CompactifAI and OVHCloud providers
- Keep CompactifAI provider detection logic
- Include new OVHCloud provider from main branch
- Both providers now work correctly with model prefix detection
2025-09-14 23:03:18 +02:00
Tim Elfrink
6ac37093e5 Update CompactifAI model references and move tests to unit test directory
- Update all model references from llama-2-7b-compressed to cai-llama-3-1-8b-slim
- Move CompactifAI tests from tests/llm_translation to tests/test_litellm/llms/compactifai/
- Update documentation examples to use the new model name
- Remove integration test inheritance to make tests pure mock tests

This addresses review feedback to use mock tests and updated model naming.
2025-09-14 23:00:27 +02:00
Krish Dholakia
56fd60b140
Merge pull request #14494 from eliasto/feat/ovhcloud-ai-edpoints-provider
feat: Add OVHCloud AI Endpoints as a provider
2025-09-14 00:45:08 -07:00
Krish Dholakia
269515e525
Merge branch 'main' into litellm_dev_09_12_2025_p1 2025-09-13 10:10:30 -07:00
Krish Dholakia
550feffeb9
Merge pull request #14512 from timelfrink/fix/lm-studio-bearer-header-14502
fix(lm_studio): resolve illegal Bearer header value issue
2025-09-13 09:40:30 -07:00
Krish Dholakia
663dbc6080
Merge pull request #14477 from BerriAI/litellm_dev_09_11_2025_p2
`/v1/messages` - don't send content block after message w/ finish reason + usage block + `/key/unblock` - support hashed tokens
2025-09-12 19:51:44 -07:00
Ishaan Jaff
075a089d82
[Feat] Bedrock Batches - Ensure correct transformation applied to incoming requests (#14522)
* use is_batch_jsonl_file

* fix valid_content_type

* fix transform_create_file_request

* fix _transform_openai_jsonl_content_to_bedrock_jsonl_content

* test_transform_openai_jsonl_content_to_bedrock_jsonl_content

* fix mypy linting errors

* fix BEDROCK_BATCH_MODEL

* fix working sample

* fix comment

* fix model list

* fix: use with managed batches

* refactor
2025-09-12 18:32:57 -07:00
Krrish Dholakia
8ec02a5bdc test: add unit tests for ollama chat request transformation 2025-09-12 17:59:59 -07:00
Tim Elfrink
b84785b5b7 fix(lm_studio): resolve illegal Bearer header value issue
- Change default API key from space ' ' to 'fake-api-key'
- Fixes httpcore.LocalProtocolError: Illegal header value b'Bearer  '
- Maintains compatibility with explicit API keys and environment variables
- Add comprehensive tests for provider info retrieval

Fixes #14502
2025-09-12 22:41:30 +02:00
Sameerlite
fa175e8d90
Fix gemini cli error (#14417)
* Fix gemini cli error

* Added better handling

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
2025-09-12 11:56:51 -07:00
Sameer Kankute
1a123b2cd5
Litellm gemini cli bug fix (#14451)
* Fix gemini cli error

* Add reasoning request support

* Added better handling

* remove other PR code

* refactored code for better structure following

---------

Co-authored-by: sameer@berri.ai <sameer@berri.ai>
2025-09-12 11:55:26 -07:00
Elias TOURNEUX
ef9d1ddc40
feat: Add OVHCloud AI Endpoints as a provider 2025-09-12 13:37:03 +02:00
Ishaan Jaff
32d87c242b
[Fixes] Using Qwen API Tiered Pricing (#14479)
* fix: use dashscope cost calc

* add qwen logo
2025-09-11 20:07:41 -07:00
Krrish Dholakia
805069c287 fix(adapters/streaming_iterator.py): Don't send content block after message delta block is sent
Fixes https://github.com/BerriAI/litellm/issues/14315
2025-09-11 18:52:02 -07:00
Ishaan Jaff
dda115cc6d
[Feat] Cost Tracking - Add support for Tiered Cost Tracking for Qwen API (Dashscope) (#14471)
* add dashscope logo

* docs fix

* docs fix

* fix supports_batch_calling

* fix naming

* fix input_cost_per_audio_token

* use output_cost_per_reasoning_token

* add tiered_pricing in get_model_info

* test fixes

* fix cost calc

* ruff fix
2025-09-11 18:14:39 -07:00
Ishaan Jaff
258b674dbb fix deepinfra test 2025-09-10 19:39:23 -07:00
Ishaan Jaff
dc5650eeda
Revert "fix: remove anthropic-beta header for Vertex AI requests with prompt caching" (#14421) 2025-09-10 15:47:18 -07:00
xprilion
667481e75b (feat): Add W&B Inference to LiteLLM 2025-09-11 00:07:30 +05:30
Krish Dholakia
a80cfe5fb5
Merge branch 'main' into feature/databricks-function-call-missing-pass-description 2025-09-09 22:42:32 -07:00
Krish Dholakia
53bf023876
Merge pull request #14092 from gotsysdba/main
OCI Provder: Update OCIPromptTokensDetails
2025-09-09 22:39:16 -07:00
Krish Dholakia
d72081113e
Merge pull request #14111 from dharamendrak/feature/aiohttp-dependency-injection
feat: Add dependency injection support to BaseLLMAIOHTTPHandler
2025-09-09 22:35:30 -07:00
swarnabhasinha
f8ddd123d1
fix: add missing patch import in vertex_ai test 2025-09-09 16:16:59 +05:30
Dharamendra Kumar
5b26e78ad6 Fix linting 2025-09-07 18:04:00 -07:00
Dharamendra Kumar
92596e48fe Merge branch 'main' into feature/aiohttp-dependency-injection 2025-09-07 17:54:55 -07:00
Krish Dholakia
ba10173ec7
Merge branch 'main' into heroku-llms 2025-09-06 22:10:20 -07:00
Krish Dholakia
884cca7da9
Merge pull request #12984 from darashenka/main
honor OLLAMA_API_KEY for ollama_chat
2025-09-06 22:07:28 -07:00
Krish Dholakia
1980960218
Merge branch 'main' into litellm_responses_structured_output 2025-09-06 09:20:00 -07:00
Ishaan Jaff
982800069c
[Bug Fix] x-litellm-tags not routing with Responses API (#14289)
* fix: get_deployments_for_tag

* fix get_deployments_for_tag

* test_router_tag_routing.py

* test_get_metadata_variable_name_from_kwargs

* fix mapped tests

* docs fix
2025-09-05 09:40:37 -07:00
Sameer Kankute
4fefac1bf2 Move test to test_litellm/ folder 2025-09-05 10:24:55 +05:30
Krish Dholakia
f67339a86c
Merge pull request #14028 from onlylhf/volcengine-embedding-support
Add Volcengine embedding module with handler and transformation logic
2025-09-04 21:01:25 -07:00
Krish Dholakia
5d5c19a302
Merge pull request #14077 from TomeHirata/codex/add-support-for-anthropic-citation-api
Add support for anthropic citation api in Databricks
2025-09-04 20:46:11 -07:00
Krish Dholakia
796192dabe
Merge pull request #14130 from moshemorad/bedrock_fix_structure_output
Bedrock fix structure output
2025-09-04 12:22:35 -07:00
Krish Dholakia
e7b4892124
Merge pull request #14156 from byrongrogan/byron--bedrock-passthrough-override
fix: Support AWS_BEDROCK_RUNTIME_ENDPOINT on bedrock passthrough, make work for URLs with a base path
2025-09-04 12:20:17 -07:00
Sameer Kankute
fc9560573b
[BUG] Fix response api for reasoning item in input for litellm proxy (#14200)
* fix response api for litellm proxy

* Add test for checking if status is getting removed

* add test in correct file

* remove hardcoded fields

* Make the handling simpler

* fix lint error:
2025-09-04 10:36:48 -07:00
TomuHirata
bb5127b8a0
Merge branch 'BerriAI:main' into citation-supported-text-3 2025-09-02 20:46:48 -10:00
Ishaan Jaff
63c4a30564 TestVertexAIGPTOSSTransformation 2025-09-02 23:07:52 -07:00
Krish Dholakia
dc0d2a44a5
Merge pull request #14171 from kutsushitaneko/fix/14158_tool_call_id
fix(oci): Handle assistant messages with both content and tool_calls in OCI provider (#14158)
2025-09-02 23:05:04 -07:00
Ishaan Jaff
c821f1ddf1
[Feature]: Support GPT-OSS models on vertex ai (#14184)
* add VertexAIGPTOSSTransformation

* fix: optional_params

* fix: is_vertex_partner_model

* test_partner_models_httpx

* docs GPT oss docs

* test_vertex_ai_gpt_oss_reasoning_effort

* add vertex ai models
2025-09-02 14:15:26 -07:00
John Lathouwers
d02e560d85
Merge branch 'BerriAI:main' into main 2025-09-02 12:46:37 +01:00
Yuji Arakawa
c7109609fd renamed unit test code 2025-09-02 19:11:37 +09:00
Yuji Arakawa
ae3931f5f3 FIx https://github.com/BerriAI/litellm/issues/14158 2025-09-02 18:32:45 +09:00