Commit Graph

19334 Commits

Author SHA1 Message Date
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 3e4e2cb20aff1baa303f5fba435c86d177e3d64d
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
v1.60.2
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
Zhaohan Dong d60d3ee970 Add xAI and fix some old model config (#8218)
Signed-off-by: Zhaohan Dong <65422392+zhaohan-dong@users.noreply.github.com>
2025-02-03 15:29:19 -08:00
Ishaan Jaff ec614be6c4 ui new build v1.60.0.dev4 2025-02-03 08:23:44 -08:00
Ishaan Jaff b3154be6f5 (UI Fixes for add new model flow) (#8216)
* ui fix add model flow

* fix provider info + add flow

* cleanup add model setup

* use 1 file for ProviderSpecificFields

* use 1 file for ProviderSpecificFields

* use antd select for model / providers

* fix selectedProviderEnum

* fix upload vertex models
2025-02-03 08:21:00 -08:00
மனோஜ்குமார் பழனிச்சாமி 6f11137d6f Fix max output tokens (#8207) 2025-02-03 07:27:37 -08:00
Krish Dholakia e7b81f84de build: ui updates (#8206) 2025-02-03 07:26:58 -08:00
fzowl d1d9c1e95a docs: Updating the available VoyageAI models in the docs (#8215)
* Refresh VoyageAI models and prices and context

* Refresh VoyageAI models and prices and context

* Refresh VoyageAI models and prices and context

* Updating the available VoyageAI models in the docs
2025-02-03 07:26:33 -08:00
Юрій a37bfdb191 Added deprecation date for gemini-1.5 models (#8210) 2025-02-03 07:26:14 -08:00
Krish Dholakia 97b8de17ab LiteLLM Minor Fixes & Improvements (01/16/2025) - p2 (#7828)
* fix(vertex_ai/gemini/transformation.py): handle 'http://' image urls

* test: add base test for `http:` url's

* fix(factory.py/get_image_details): follow redirects

allows http calls to work

* fix(codestral/): fix stream chunk parsing on last chunk of stream

* Azure ad token provider (#6917)

* Update azure.py

Added optional parameter azure ad token provider

* Added parameter to main.py

* Found token provider arg location

* Fixed embeddings

* Fixed ad token provider

---------

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

* fix: fix linting errors

* fix(main.py): leave out o1 route for azure ad token provider, for now

get v0 out for sync azure gpt route to begin with

* test: skip http:// test for fireworks ai

model does not support it

* refactor: cleanup dead code

* fix: revert http:// url passthrough for gemini

google ai studio raises errors

* test: fix test

---------

Co-authored-by: bahtman <anton@baht.dk>
2025-02-02 23:17:50 -08:00
Krrish Dholakia 10d3da7660 build: bump version 2025-02-02 23:05:22 -08:00
Krish Dholakia 6834c5ecaf Easier user onboarding via SSO (#8187)
* fix(ui_sso.py): use common `get_user_object` logic across jwt + ui sso auth

Allows finding users by their email, and attaching the sso user id to the user if found

* Improve Team Management flow on UI  (#8204)

* build(teams.tsx): refactor teams page to make it easier to add members to a team

make a row in table clickable -> allows user to add users to team they intended

* build(teams.tsx): make it clear user should click on team id to view team details

simplifies team management by putting team details on separate page

* build(team_info.tsx): separately show user id and user email

make it easy for user to understand the information they're seeing

* build(team_info.tsx): add back in 'add member' button

* build(team_info.tsx): working team member update on team_info.tsx

* build(team_info.tsx): enable team member delete on ui

allow user to delete accidental adds

* build(internal_user_endpoints.py): expose new endpoint for ui to allow filtering on user table

allows proxy admin to quickly find user they're looking for

* feat(team_endpoints.py): expose new team filter endpoint for ui

allows proxy admin to easily find team they're looking for

* feat(user_search_modal.tsx): allow admin to filter on users when adding new user to teams

* test: mark flaky test

* test: mark flaky test

* fix(exception_mapping_utils.py): fix anthropic text route error

* fix(ui_sso.py): handle situation when user not in db
2025-02-02 23:02:33 -08:00
Krish Dholakia 1105e35538 Complete o3 model support (#8183)
* fix(o_series_transformation.py): add 'reasoning_effort' as o series model param

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

* fix(main.py): ensure `reasoning_effort` is a mapped openai param

* refactor(azure/): rename o1_[x] files to o_series_[x]

* refactor(base_llm_unit_tests.py): refactor testing for o series reasoning effort

* test(test_azure_o_series.py): have azure o series tests correctly inherit from base o series model tests

* feat(base_utils.py): support translating 'developer' role to 'system' role for non-openai providers

Makes it easy to switch from openai to anthropic

* fix: fix linting errors

* fix(base_llm_unit_tests.py): fix test

* fix(main.py): add missing param
2025-02-02 22:36:37 -08:00
Krish Dholakia e4566d7b1c fix(main.py): fix passing openrouter specific params (#8184)
* fix(main.py): fix passing openrouter specific params

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

* test(test_get_model_info.py): add check for region name w/ cris model

Resolves https://github.com/BerriAI/litellm/issues/8115
2025-02-02 22:23:14 -08:00
Wanis Elabbar 3b9ba0251d Azure AI Foundry - Deepseek R1 (#8188)
Fixed Deepseek R1 on Azure AI Foundry
2025-02-02 21:54:53 -08:00
Ishaan Jaff 8ba60bf13c (UI + SpendLogs) - Store SpendLogs in UTC Timezone, Fix filtering logs by start/end time (#8190)
* fix request_id field

* spend logs store time in UTC

* fix ui_view_spend_logs

* UI make time filter queries in UTC

* fix time filters

* fix TimeCellProps

* ui use UTC for filtering time
v1.60.0.dev2
2025-02-01 17:26:18 -08:00
Ishaan Jaff c0f3100934 [Bug Fix] - /vertex_ai/ was not detected as llm_api_route on pass through but vertex-ai was (#8186)
* fix mapped_pass_through_routes

* fix route checks

* update test_is_llm_api_route
2025-02-01 17:26:08 -08:00
Ishaan Jaff 4e9c2d5b21 docs update log stream event 2025-02-01 16:33:28 -08:00
Ishaan Jaff a713d7dfeb ui new build 2025-02-01 11:41:30 -08:00
Tomas Klohna 08e40352e9 Add azure/deepseek-r1 to model_prices_and_content_window.json (#8177) 2025-02-01 11:28:21 -08:00
Krish Dholakia 9e65f867ab test: add more unit testing for team member endpoints (#8170)
* test: add more unit testing for team member add

* fix(team_endpoints.py): add validation check to prevent same user from being added to team again

prevents duplicates

* fix(team_endpoints.py): raise error if `/team/member_delete` called on member that's not in team

prevent being able to call delete on same member multiple times

* test: update initial tests

* test: fix test

* test: update test to handle no member duplication
2025-02-01 11:23:00 -08:00
Krish Dholakia 23f458d2da Improved O3 + Azure O3 support (#8181)
* fix: support azure o3 model family for fake streaming workaround (#8162)

* fix: support azure o3 model family for fake streaming workaround

* refactor: rename helper to is_o_series_model for clarity

* update function calling parameters for o3 models (#8178)

* refactor(o1_transformation.py): refactor o1 config to be o series config, expand o series model check to o3

ensures max_tokens is correctly translated for o3

* feat(openai/): refactor o1 files to be 'o_series' files

expands naming to cover o3

* fix(azure/chat/o1_handler.py): azure openai is an instance of openai - was causing resets

* test(test_azure_o_series.py): assert stream faked for azure o3 mini

Resolves https://github.com/BerriAI/litellm/pull/8162

* fix(o1_transformation.py): fix o1 transformation logic to handle explicit o1_series routing

* docs(azure.md): update doc with `o_series/` model name

---------

Co-authored-by: byrongrogan <47910641+byrongrogan@users.noreply.github.com>
Co-authored-by: Low Jian Sheng <15527690+lowjiansheng@users.noreply.github.com>
2025-02-01 09:52:28 -08:00
Krish Dholakia 91ed05df29 Litellm dev contributor prs 01 31 2025 (#8168)
* Add O3-Mini for Azure and Remove Vision Support (#8161)

* Azure Released O3-mini at the same time as OAI, so i've added support here. Confirmed to work with Sweden Central.

* [FIX] replace cgi for python 3.13 with email.Message as suggested in PEP 594 (#8160)

* Update model_prices_and_context_window.json (#8120)

codestral2501 pricing on vertex_ai

* Fix/db view names (#8119)

* Fix to case sensitive DB Views name

* Fix to case sensitive DB View names

* Added quotes to check query as well

* Added quotes to create view query

* test: handle server error  for flaky test

vertex ai has unstable endpoints

---------

Co-authored-by: Wanis Elabbar <70503629+elabbarw@users.noreply.github.com>
Co-authored-by: Honghua Dong <dhh1995@163.com>
Co-authored-by: superpoussin22 <vincent.nadal@orange.fr>
Co-authored-by: Miguel Armenta <37154380+ma-armenta@users.noreply.github.com>
2025-02-01 09:05:20 -08:00