Commit graph

971 commits

Author SHA1 Message Date
Anthony Ivan
e5e9523958
init commit (#16200) 2025-11-03 18:58:03 -08:00
Sameer Kankute
ad6a0f4d44
Update perplexity cost tracking (#15743)
* Update perplexity cost tracking

* fix lint errors

* fix code

* fix tests in perplexity

* fix test realted to api call

* fix exception test
2025-11-03 08:45:34 -08:00
Sameer Kankute
396ab80f56
Fix index field not populated in streaming mode with n>1 and tool calls (#15962)
* fix index tool calling in streaming

* moved test to llm translation

---------

Co-authored-by: Ishaan Jaffer <ishaanjaffer0324@gmail.com>
2025-11-02 09:52:31 -08:00
Ishaan Jaffer
a45e2049f3 test_tool_call_with_empty_enum_property 2025-11-01 09:27:05 -07:00
Ishaan Jaffer
978c52291f test_rerank_custom_callbacks 2025-11-01 09:25:29 -07:00
Ishaan Jaffer
cd379c1321 test_anthropic_websearch 2025-10-31 20:43:07 -07:00
Ishaan Jaffer
b18cef300a undo test_anthropic_websearch change 2025-10-31 20:39:24 -07:00
Ishaan Jaffer
290e608818 get_computer_tool_beta_header 2025-10-31 20:38:37 -07:00
Ishaan Jaffer
6e46824939 test_streaming_response 2025-10-31 19:10:38 -07:00
Ishaan Jaffer
515ae9680e test_anthropic_tool_use 2025-10-31 19:08:32 -07:00
Ishaan Jaffer
f173cb0f54 test_anthropic_text_editor 2025-10-31 19:07:46 -07:00
Ishaan Jaffer
928fddb3be test_anthropic_structured_output 2025-10-31 19:06:45 -07:00
Ishaan Jaffer
94c2c28f3d claude-sonnet-4-5-20250929 fix 2025-10-31 18:20:52 -07:00
Ishaan Jaffer
159db27d5c fix test claude-sonnet-4-5-20250929 2025-10-31 18:13:29 -07:00
Sameer Kankute
192935120d
Add OpenAI-compatible annotations support for Cohere v2 citations 2025-10-29 19:12:17 -07:00
Ishaan Jaffer
33371d18f4 test fix claude-sonnet-4-5-20250929 2025-10-28 19:05:13 -07:00
Ishaan Jaffer
1b49dba1dd fix claude-sonnet-4-5 2025-10-28 17:37:08 -07:00
Ishaan Jaffer
e67e4b893d test_completion_azure_ai_gpt_4o_with_flexible_api_base 2025-10-25 14:59:11 -07:00
Krish Dholakia
346e036399
fix(opentelemetry.py): fix issue where headers were not being split correctly + feat(bedrock): add titan image generations w/ cost tracking (#15916)
* fix(opentelemetry.py): fix issue where headers were not being split correctly

* feat(bedrock/image): Support bedrock titan image generation

Closes https://github.com/BerriAI/litellm/issues/361

* build(model_prices_and_context_window.json): track titan image gen pricing

enables cost tracking per request

* feat(amazon_titan_transformation.py): support titan image generation cost tracking

* docs: document new model

* docs: update docs to indicate cost tracking + refactor rerank into separate doc

* fix: fix mypy linting error

* fix: fix type ignore
2025-10-25 13:45:13 -07:00
Ishaan Jaffer
818c44bde5 test_databricks_anthropic_function_call_with_no_schema 2025-10-25 13:01:08 -07:00
Ishaan Jaffer
e96c61a3cb test_completion_azure_deployment_id 2025-10-25 13:00:41 -07:00
Ishaan Jaffer
44d0cfc648 TestAzureOpenAIO3Mini 2025-10-25 12:42:01 -07:00
Ishaan Jaffer
964e683c85 test_databricks_anthropic_function_call_with_no_schema 2025-10-25 12:29:15 -07:00
Ishaan Jaffer
e6b61213ca test_completion_azure_deployment_id 2025-10-25 12:26:06 -07:00
Ishaan Jaffer
2b16731273 TestAzureOpenAIO3Mini 2025-10-25 12:13:50 -07:00
Ishaan Jaffer
74106589d0 test_completion_azure_ai_gpt_4o_with_flexible_api_base 2025-10-25 11:30:51 -07:00
Ishaan Jaffer
c06098c351 test_databricks_embeddings 2025-10-25 11:28:21 -07:00
Ishaan Jaffer
a3febef431 test_azure_ai_request_format 2025-10-25 11:23:02 -07:00
Ishaan Jaffer
3dffb6bd40 test fixes 2025-10-25 11:20:09 -07:00
Ishaan Jaffer
0bedf1c0a7 fix tests 2025-10-25 10:19:24 -07:00
Sameer Kankute
0f9996a4d0
Litellm sameer oct staging (#15806)
* Addd v2/chat support for cohere

* fix streaming

* Use v2_transformation for logging passthrough:

* Use v2_transformation for logging passthrough:

* Add test for checking if document and citation_options is getting passed

* Update the cohere model

* Add cost tracking for vertex ai passthrough batch jobs

* Add full passthrough support

* refactor code according to the comments

* Add passthrough handler

* remove invalid params

* Updated documentation

* Updated documentation

* Updated documentation

* Correct the import

* Add openai videos generation and retrieval support

* add retrieval endpoint

* Add docs

* Add imports

* remove orjson

* remove double import

* fix openai videos format

* remove mock code

* remove not required comments

* Add tests

* Add tests

* Add other video endpoints

* Fix cost calculation and transformation

* Fixed mypy tests

* remove not used imports

* fix documentation for get batch req (#15742)

* Add grounding info to responses API (#15737)

* Add grounding info to responses API

* fix lint errors

* Use typed objects for annotations

* Use typed objects for annotations

* fix mypy error

* Litellm fix json serialize alreting 2 (#15741)

* fix json serializable error for alerts

* Add test

* fix mypt errors

* fix mypt errors

* Add Qwen3 imported model support for AWS Bedrock (#15783)

* Add qwen imported model support

* fix mypy errors

* fix empty user message error (#15784)

* fix typed dict for list

* Add azure supported videos endpoint

* fix mapped tests

* add azure sora models to model map

* Add OpenAI video generation and content retrieval support (#15745)

* Add openai videos generation and retrieval support

* add retrieval endpoint

* Add docs

* Add imports

* remove orjson

* remove double import

* fix openai videos format

* remove mock code

* remove not required comments

* Add tests

* Add tests

* Add other video endpoints

* Fix cost calculation and transformation

* Fixed mypy tests

* remove not used imports

* fix typed dict for list

* fix mypy errors

* move directory

* make v2 chat default

* Fix mypy tests

* Fix mypy tests

* Fix mypy tests

* Fix mypy tests

* Revert "Add Azure Video Generation Support with Sora Integration"

* refactor videos repo

* add test

* Add azure openai videos support

* Add azure openai videos support

* Add router endpoint support for videos

* fix mypy error

* add azure models

* fix mapped test

* fix mypy error

* Add proxy router test

* Add proxy router test

* remove deprecated model name from tests

* fix import error

* fix import error

* Add gaurdrail integration in videos endpoint

* Add logging support for videos endpoint

* Add final documentation supporting videos integration

* fix model name and document input

* Update literals to avoid mypy errors

* Remove unused imports and print statements

* revert guardrail support for video generation and video remix

* revert guardrail support for video generation and video remix

* Fix failing mapped and llm translation tests
2025-10-24 12:17:22 -07:00
Anthony Ivan
5f7a6b49eb
Feat: Allow prompt caching to be used for Anthropic Claude on Databricks (#15801) 2025-10-22 09:11:04 -07:00
katsuhiro muto
d5e686b3e8
[Fix] Support service_tier in chat completion (#15693)
* Support service_tier

* fix test
2025-10-18 13:55:54 -07:00
Ishaan Jaff
3852fc96c1
[Oct Staging Branch] (#15460)
* Implement fix for thinking_blocks and converse API calls

This fixes Claude's models via the Converse API, which should also fix
Claude Code.

* Add thinking literal

* Fix mypy issues

* Type fix for redacted thinking

* Add voyage model integration in sagemaker

* Add config file logic

* Use already exiting voyage transformation

* refactor code as per comments

* fix merge error

* refactor code as per comments

* refactor code as per comments

* UI new build

* [Fix] router - regression when adding/removing models  (#15451)

* fix(router): update model_name_to_deployment_indices on deployment removal

When a deployment is deleted, the model_name_to_deployment_indices map
was not being updated, causing stale index references. This could lead
to incorrect routing behavior when deployments with the same model_name
were dynamically removed.

Changes:
- Update _update_deployment_indices_after_removal to maintain
  model_name_to_deployment_indices mapping
- Remove deleted indices and decrement indices greater than removed index
- Clean up empty entries when no deployments remain for a model name
- Update test to verify proper index shifting and cleanup behavior

* fix(router): remove redundant index building during initialization

Remove duplicate index building operations that were causing unnecessary
work during router initialization:

1. Removed redundant `_build_model_id_to_deployment_index_map` call in
   __init__ - `set_model_list` already builds all indices from scratch

2. Removed redundant `_build_model_name_index` call at end of
   `set_model_list` - the index is already built incrementally via
   `_create_deployment` -> `_add_model_to_list_and_index_map`

Both indices (model_id_to_deployment_index_map and
model_name_to_deployment_indices) are properly maintained as lookup
indexes through existing helper methods. This change eliminates O(N)
duplicate work during initialization without any behavioral changes.

The indices continue to be correctly synchronized with model_list on
all operations (add/remove/upsert).

* fix(prometheus): Fix Prometheus metric collection in a multi-workers environment (#14929)

Co-authored-by: sotazhang <sotazhang@tencent.com>

* Add tiered pricing and cost calculation for xai

* Use generic cost calculator

* Resolve conflicts in generated HTML files

* Remove penalty params as supported params for gemini preview model (#15503)

* fix conversion of thinking block

* add application level encryption in SQS (#15512)

* docs: fix doc

* docs(index.md): bump rc

* [Fix] GEMINI - CLI -  add google_routes to llm_api_routes (#15500)

* fix: add google_routes to llm_api_routes

* test: test_virtual_key_llm_api_routes_allows_google_routes

* build: bump version

* bump: version 1.78.0 → 1.78.1

* add application level encryption in SQS

* add application level encryption in SQS

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: deepanshu <deepanshu.lulla@hq.bill.com>

* [Feat] Bedrock Knowledgebase - return search_response when using /chat/completions API with LiteLLM (#15509)

* docs: fix doc

* docs(index.md): bump rc

* [Fix] GEMINI - CLI -  add google_routes to llm_api_routes (#15500)

* fix: add google_routes to llm_api_routes

* test: test_virtual_key_llm_api_routes_allows_google_routes

* add AnthropicCitation

* fix async_post_call_success_deployment_hook

* fix add vector_store_custom_logger to global callbacks

* test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call

* async_post_call_success_deployment_hook

* add async_post_call_streaming_deployment_hook

* async def test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call_streaming(setup_vector_store_registry):

* fix _call_post_streaming_deployment_hook

* fix async_post_call_streaming_deployment_hook

* test update

* docs: Accessing Search Results

* docs KB

* fix chatUI

* fix searchResults

* fix onSearchResults

* fix kb

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>

* [Feat] Add dynamic rate limits on LiteLLM Gateway  (#15518)

* docs: fix doc

* docs(index.md): bump rc

* [Fix] GEMINI - CLI -  add google_routes to llm_api_routes (#15500)

* fix: add google_routes to llm_api_routes

* test: test_virtual_key_llm_api_routes_allows_google_routes

* build: bump version

* bump: version 1.78.0 → 1.78.1

* fix: KeyRequestBase

* fix rpm_limit_type

* fix dynamic rate limits

* fix use dynamic limits here

* fix _should_enforce_rate_limit

* fix _should_enforce_rate_limit

* fix counter

* test_dynamic_rate_limiting_v3

* use _create_rate_limit_descriptors

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>

* Add google rerank endpoint

* Add docs

* fix mypy error

* fix mypy and lint errors

* Add haiku 4.5 integration

* Add haiku 4.5 integration for other regions as well

* Handle citation field correctly

* Fix filtering headers for signature calcs

* Add haiku 4.5 integration (#15650)

---------

Co-authored-by: Leslie Cheng <leslie.cheng5@gmail.com>
Co-authored-by: Sameer Kankute <sameer@berri.ai>
Co-authored-by: Alexsander Hamir <alexsanderhamirgomesbaptista@gmail.com>
Co-authored-by: Lucas <10226902+LoadingZhang@users.noreply.github.com>
Co-authored-by: sotazhang <sotazhang@tencent.com>
Co-authored-by: Deepanshu Lulla <deepanshu.lulla@gmail.com>
Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: deepanshu <deepanshu.lulla@hq.bill.com>
2025-10-17 17:52:25 -07:00
Ishaan Jaffer
f342ef3842 test fix 2025-10-17 11:18:29 -07:00
Ishaan Jaffer
09a2e32663 test_completion_cohere_command_r_plus_function_call 2025-10-17 09:40:14 -07:00
Ishaan Jaffer
39b0e76a33 test_completion_cohere_command_r_plus_function_call 2025-10-16 20:33:41 -07:00
Ishaan Jaffer
13e895b9b0 test fix 2025-10-16 18:00:46 -07:00
Ishaan Jaffer
da72a812c9 test_bedrock_passthrough_router 2025-10-16 14:23:34 -07:00
Krrish Dholakia
090a2c0cfe fix: remove unused uuid import 2025-10-11 15:38:28 -07:00
Krish Dholakia
ff930dc6df
Merge branch 'main' into litellm_dev_10_10_2025_p2 2025-10-11 13:03:16 -07:00
Krish Dholakia
07ba5c1ea9
Merge branch 'main' into litellm_dev_10_10_2025_p3 2025-10-11 12:58:53 -07:00
Ishaan Jaffer
33a4676184 test fix 2025-10-11 10:05:22 -07:00
Ishaan Jaffer
c467986b8b test_gemini_context_caching_with_ttl 2025-10-11 09:20:20 -07:00
Krrish Dholakia
4ad1b9c9e1 fix(litellm_responses_transformation/transformation.py): several fixes for chat completion to responses api bridge
Fix tool calling, prevent passing invalid stream options, prevent passing invalid user string (>64 char)

Allows gpt-5-codex to work on claude code
2025-10-10 19:52:01 -07:00
Krrish Dholakia
fed1ba2891 feat(openai/): convert chat completion tool calls to responses api
enables gpt-5-codex to work on claude code

 Closes LIT-1088
2025-10-10 19:41:11 -07:00
Krrish Dholakia
144ea09549 docs(openai.md): document how to get reasoning content for gpt-5 models 2025-10-10 18:42:19 -07:00
Krrish Dholakia
bff46da060 test(test_openai.py): add gpt-5 streaming with reasoning content test 2025-10-10 18:36:41 -07:00
Krrish Dholakia
0cb9ef5fb3 fix(openai/responses): fallback to model construct, don't use it by default (causes downstream errors for nested values) 2025-10-10 18:07:18 -07:00
Krrish Dholakia
15b5e6f5d9 feat(responses_api/): fix missing streaming events on responses api <-> chat completion bridge
ensure we are passing the required events when streaming non-openai models via responses api
2025-10-10 14:53:15 -07:00