Commit graph

19355 commits

Author SHA1 Message Date
Krish Dholakia
b00bdc7ec2
Merge branch 'main' into litellm_dev_02_05_2025_p1 2025-02-05 19:38:51 -08:00
Ishaan Jaff
515598114c bump: version 1.60.4 → 1.60.5 2025-02-05 19:02:45 -08:00
Ishaan Jaff
03f738eff6 fix test_models_by_provider 2025-02-05 19:01:00 -08:00
Ishaan Jaff
818792228c
(Refactor) - migrate bedrock invoke to BaseLLMHTTPHandler class (#8290)
* initial transform for invoke

* invoke transform_response

* working - able to make request

* working get_complete_url

* working - invoke now runs on llm_http_handler

* fix unused imports

* track litellm overhead ms

* working stream request

* sign_request transform

* sign_request update

* use has_async_custom_stream_wrapper property

* use get_async_custom_stream_wrapper in base llm http handler

* fix make_call in invoke handler

* fix invoke with streaming get_async_custom_stream_wrapper

* working bedrock async streaming with invoke

* fix make call handler for bedrock

* test_all_model_configs

* fix test_bedrock_custom_prompt_template

* sync streaming for bedrock invoke

* fix _add_stream_param_to_request_body

* test_async_text_completion_bedrock

* fix transform_request

* fix get_supported_openai_params

* fix test supports tool choice

* fix test_supports_tool_choice

* add unit test coverage for bedrock invoke transform

* fix location of transformation files

* update import loc

* fix bedrock invoke unit tests

* fix import for max completion tokens
2025-02-05 18:58:55 -08:00
Ishaan Jaff
e41bc5f32b
fixed issues #8126 and #8127 (#8275) (#8299)
Co-authored-by: Jaswanth Karani <karani.jaswanth@gmail.com>
2025-02-05 18:52:58 -08:00
Ishaan Jaff
b76b380bc8 fix add back sambanova/Qwen2.5-72B-Instruct 2025-02-05 18:44:17 -08:00
Ishaan Jaff
ffd890e744
add assembly ai cost tracking (#8298) 2025-02-05 18:43:37 -08:00
Ishaan Jaff
e42fcf4d03
(UI) - Add Assembly AI provider to UI (#8297)
* add assembly ai to ui

* specify api base for assembly ai
2025-02-05 18:42:51 -08:00
Krrish Dholakia
416bdbdd99 test: update test 2025-02-05 17:25:56 -08:00
Ishaan Jaff
6cef115bb0
(Security fix) - remove code block that inserts master key hash into DB (#8268)
* remove code block upserting master key hash to db

* run test to check if key upserted into db

* run ci/cd again

* litellm_proxy_security_tests

* litellm_proxy_security_tests

* run prisma entrypoint

* ci/cd run again

* fix test master key not in db
2025-02-05 17:25:42 -08:00
Krrish Dholakia
09a7ff5668 fix(gpt_transformation.py): remove unused variables 2025-02-05 17:24:02 -08:00
Zhaohan Dong
88e7046165
Added compatibility guidance, etc. for xAI Grok model (#8282)
* Various updates

Signed-off-by: Zhaohan Dong <65422392+zhaohan-dong@users.noreply.github.com>

* Update xAI branding

Signed-off-by: Zhaohan Dong <65422392+zhaohan-dong@users.noreply.github.com>

* Revert changes

Signed-off-by: Zhaohan Dong <65422392+zhaohan-dong@users.noreply.github.com>

---------

Signed-off-by: Zhaohan Dong <65422392+zhaohan-dong@users.noreply.github.com>
2025-02-05 17:21:47 -08:00
Krrish Dholakia
be6c850df9 fix(o_series_transformation.py): support o3 mini native streaming
Fixes https://github.com/BerriAI/litellm/issues/8274
2025-02-05 15:35:32 -08:00
Krrish Dholakia
efc2a886ee refactor(gpt_transformation.py): refactor out json schema converstion to base config
keeps logic consistent across providers
2025-02-05 15:30:23 -08:00
Krrish Dholakia
6f01d22d73 fix(gpt_transformation.py): makes sure response format / tools conversion doesn't remove previous tool calls 2025-02-05 15:19:47 -08:00
Krrish Dholakia
d9d8c06668 fix(convert_dict_to_response.py): only convert if response is the response_format tool call passed in
Fixes https://github.com/BerriAI/litellm/issues/8241
2025-02-05 14:48:32 -08:00
waterstark
fbe3c58372
Added a guide for users who want to use LiteLLM with AI/ML API. (#7058)
* Added a guide for users who want to use LiteLLM with AI/ML.

* Minor changes

* Minor changes

* Fix sidebars.js

---------

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2025-02-05 06:20:35 -08:00
Krish Dholakia
8d3a942fbd
Litellm staging (#8270)
* fix(opik.py): cleanup

* docs(opik_integration.md): cleanup opik integration docs

* fix(redact_messages.py): fix redact messages check header logic

ensures stringified bool value in header is still asserted to true

 allows dynamic message redaction

* feat(redact_messages.py): support `x-litellm-enable-message-redaction` request header

allows dynamic message redaction
2025-02-04 22:35:48 -08:00
Krish Dholakia
3c813b3a87
Fix deepseek calling - refactor to use base_llm_http_handler (#8266)
* refactor(deepseek/): move deepseek to base llm http handler

Fixes https://github.com/BerriAI/litellm/issues/8128#issuecomment-2635430457

* fix(gpt_transformation.py): support stream parsing for gpt-like calls

* test(test_deepseek_completion.py): add async streaming test

* fix(gpt_transformation.py): fix import

* fix(gpt_transformation.py): return full api base and content type
2025-02-04 22:30:00 -08:00
Ishaan Jaff
51b9a02615 run ci/cd again 2025-02-04 22:19:57 -08:00
Ishaan Jaff
e3b0fd7061 bump: version 1.60.3 → 1.60.4 2025-02-04 22:03:18 -08:00
Krish Dholakia
4e34fc3bf8
[BETA] Support OIDC role based access to proxy (#8260)
* feat(proxy/_types.py): add new jwt field params

allows users + services to auth into proxy

* feat(handle_jwt.py): allow team role proxy access

allows proxy admin to set allowed team roles

* fix(proxy/_types.py): add 'routes' to role based permissions

allow proxy admin to restrict what routes a team can access easily

* feat(handle_jwt.py): support more flexible role based route access

v2 on role based 'allowed_routes'

* test(test_jwt.py): add unit test for rbac for proxy routes

* feat(handle_jwt.py): ensure cost tracking always works for any jwt request with `enforce_rbac=True`

* docs(token_auth.md): add documentation on controlling model access via OIDC Roles

* test: increase time delay before retrying

* test: handle model overloaded for test
2025-02-04 21:59:39 -08:00
Krrish Dholakia
7f06b88192 fix(internal_user_endpoints.py): fix try-except for team not in db 2025-02-04 21:57:43 -08:00
Ishaan Jaff
3a6349d871
(Feat) - Add support for structured output on bedrock/nova models + add util litellm.supports_tool_choice (#8264)
* fix supports_tool_choice

* TestBedrockNovaJson

* use supports_tool_choice

* fix supports_tool_choice

* add supports_tool_choice param

* script to add fields to model cost map

* test_supports_tool_choice

* test_supports_tool_choice

* fix supports tool choice check

* test_supports_tool_choice_simple_tests

* fix supports_tool_choice check

* fix supports_tool_choice bedrock

* test_supports_tool_choice

* test_supports_tool_choice

* fix bedrock/eu-west-3/mistral.mistral-large-2402-v1:0

* ci/cd run again

* test_supports_tool_choice_simple_tests

* TestGoogleAIStudioGemini temp - remove to run ci/cd

* test_aaalangfuse_logging_metadata

* TestGoogleAIStudioGemini

* test_check_provider_match

* remove add param to map
2025-02-04 21:47:16 -08:00
Krrish Dholakia
c743475aba build: Squashed commit of the following:
commit 3e4e2cb20a
Author: Krrish Dholakia <krrishdholakia@gmail.com>
Date:   Tue Feb 4 15:10:34 2025 -0800

    fix(proxy_server.py): fix redirect from `/sso/key/callback` to redirect on custom server path

    Fixes https://github.com/BerriAI/litellm/issues/5997
2025-02-04 21:45:33 -08:00
Krrish Dholakia
f70e8adc10 build: update .gitignore 2025-02-04 21:43:09 -08:00
Ishaan Jaff
ab134b8871 ci/cd run again 2025-02-04 21:28:13 -08:00
Ishaan Jaff
06a9829749 all e2e langfuse tests now run on test_langfuse_e2e_test.p 2025-02-04 21:22:51 -08:00
Ishaan Jaff
b965d9bd9a
Fix passing top_k parameter for Bedrock Anthropic models (#8131) (#8269)
* Fix Bedrock Anthropic topK bug

* Remove extra import

* Add unit test + make tests mocked

* Fix camel case

* Fix tests to remove exception handling

Co-authored-by: vibhavbhat <vibhavb00@gmail.com>
2025-02-04 21:16:21 -08:00
Ishaan Jaff
d367f42887 ui new build 2025-02-04 21:12:39 -08:00
Ishaan Jaff
7e1b79d446
(Bug fix) - Langfuse / Callback settings stored in DB (#8251)
* fix _decrypt_and_set_db_env_variables

* fix proxy config

* test callbacks in DB

* test langfuse callbacks in db

* test_e2e_langfuse_callbacks_in_db

* proxy_store_model_in_db_tests

* fix proxy_store_model_in_db_tests

* proxy_store_model_in_db_tests

* fix store_model_db_config.yaml

* fix check_langfuse_request

* fix test langfuse base url

* ci/cd run again
2025-02-04 21:09:37 -08:00
Ishaan Jaff
1d5370b9e6
(feat) - track org_id in SpendLogs (#8253)
* track org id in spend logs

* read org id from team table

* show user_api_key_org_id in spend logs

* test_spend_logs_payload

* test_spend_logs_with_org_id

* test_spend_logs_with_org_id
2025-02-04 21:08:05 -08:00
Ishaan Jaff
b59b26f797
add supports_tool_choice (#8265) 2025-02-04 19:45:53 -08:00
Krish Dholakia
8d4ad47ec3
fix(prometheus.py): fix setting key budget metrics (#8234)
* fix(prometheus.py): fix setting key budget metrics

ensures custom metadata works with key budget metric

this is a patch. root cause pr is written in a separate branch

* test: fix test
2025-02-04 19:15:50 -08:00
Low Jian Sheng
c494b2cb85
Add hyperbolic deepseek v3 model configurations (#8232)
* add hyperbolic deepseek configurations

* add deepseek-v3 support
2025-02-04 19:00:22 -08:00
Ishaan Jaff
f66029470f add supports_response_schema 2025-02-04 16:59:24 -08:00
Ishaan Jaff
ff48e574d5
fix loosen httpx restriction on pip (#8255) 2025-02-04 16:10:48 -08:00
superpoussin22
15b7fa3617
Update model_prices_and_context_window.json (#8256)
codestral id is changing from previous version 
this is now vertex_ai/codestral-2501

previous version are no more proposed in model garden
2025-02-04 14:23:58 -08:00
superpoussin22
27e1e22a0f
Update model_prices_and_context_window.json (#8249)
add vertex_ai/codestral@2501 and remove duplicate vertex_ai/codestral@2405
2025-02-04 10:09:14 -08:00
Ishaan Jaff
0b1eb038e3
Litellm UI fixes 8123 v2 (#8208) (#8245)
* Litellm UI fixes 8123 v2 (#8208)

* [Bug] UI: Newly created key does not display on the View Key Page (#8039)

- Fixed issue where all keys appeared blank for admin users.
- Implemented filtering of data via team settings to ensure all keys are displayed correctly.

* Fix:
- Updated the validator to allow model editing when `keyTeam.team_alias === "Default Team"`.
- Ensured other teams still follow the original validation rules.

* - added some classes in global.css
- added text wrap in output of request,response and metadata in index.tsx
- fixed styles of table in table.tsx

* Enhance Request Viewer UI with Detailed Log Information

- Added a comprehensive "Request Details" card displaying key log.
- Introduced a new "Request Tags" section
- Removed commented-out buttons for expanded/JSON views
- Improved overall layout and readability of log information

* only include Request Details

---------

Co-authored-by: Taha Ali <123803932+tahaali-dev@users.noreply.github.com>
2025-02-04 06:48:32 -08:00
Krish Dholakia
df93debbc7
Internal User Endpoint - vulnerability fix + response type fix (#8228)
* fix(key_management_endpoints.py): fix vulnerability where a user could update another user's keys

Resolves https://github.com/BerriAI/litellm/issues/8031

* test(key_management_endpoints.py): return consistent 403 forbidden error when modifying key that doesn't belong to user

* fix(internal_user_endpoints.py): return model max budget in internal user create response

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

* test: fix test

* test: update test to handle gemini token counter change

* fix(factory.py): fix bedrock http:// handling

* docs: fix typo in lm_studio.md (#8222)

* test: fix testing

* test: fix test

---------

Co-authored-by: foreign-sub <51928805+foreign-sub@users.noreply.github.com>
2025-02-04 06:41:14 -08:00
Krrish Dholakia
f6bd48a1c5 bump: version 1.60.2 → 1.60.3 2025-02-03 22:56:42 -08:00
Krish Dholakia
c17342ac5b
fix(openai/): allows 'reasoning_effort' param to be passed correctly (#8227)
* fix(openai/): allows 'reasoning_effort' param to be passed correctly

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

* test: update test to handle gemini token counter change

* fix(factory.py): fix bedrock http:// handling

* test: fix test

* test: update testing for new openai sdk
2025-02-03 22:39:10 -08:00
Ishaan Jaff
302cc4f583 bump: version 1.60.1 → 1.60.2 2025-02-03 22:11:50 -08:00
Ishaan Jaff
915cc064c5 fix test test_is_assemblyai_route 2025-02-03 21:58:32 -08:00
Ishaan Jaff
8fd60a420d
(Feat) - New pass through add assembly ai passthrough endpoints (#8220)
* add assembly ai pass through request

* fix assembly pass through

* fix test_assemblyai_basic_transcribe

* fix assemblyai auth check

* test_assemblyai_transcribe_with_non_admin_key

* working assembly ai test

* working assembly ai proxy route

* use helper func to pass through logging

* clean up logging assembly ai

* test: update test to handle gemini token counter change

* fix(factory.py): fix bedrock http:// handling

* add unit testing for assembly pt handler

* docs assembly ai pass through endpoint

* fix proxy_pass_through_endpoint_tests

* fix standard_passthrough_logging_object

* fix ASSEMBLYAI_API_KEY

* test test_assemblyai_proxy_route_basic_post

* test_assemblyai_proxy_route_get_transcript

* fix is is_assemblyai_route

* test_is_assemblyai_route

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
2025-02-03 21:54:32 -08:00
foreign-sub
aa6a18ecc2
docs: fix typo in lm_studio.md (#8222) 2025-02-03 18:37:31 -08:00
Krrish Dholakia
5b08289d88 fix(factory.py): fix bedrock http:// handling 2025-02-03 18:15:14 -08:00
Krrish Dholakia
7ddb034b31 test: update test to handle gemini token counter change 2025-02-03 18:12:53 -08:00
Krish Dholakia
c8494abdea
test(base_llm_unit_tests.py): add test to ensure drop params is respe… (#8224)
* test(base_llm_unit_tests.py): add test to ensure drop params is respected

* fix(types/prometheus.py): use typing_extensions for python3.8 compatibility

* build: add cherry picked commits
2025-02-03 16:04:44 -08:00