Commit Graph
19225 Commits
Author SHA1 Message Date
Krish DholakiaandGitHub 2eaa0079f2 feat(handle_jwt.py): initial commit adding custom RBAC support on jwt… (#8037)
* feat(handle_jwt.py): initial commit adding custom RBAC support on jwt auth

allows admin to define user role field and allowed roles which map to 'internal_user' on litellm

* fix(auth_checks.py): ensure user allowed to access model, when calling via personal keys

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

* feat(handle_jwt.py): support role based access with model permission control on proxy

Allows admin to just grant users roles on IDP (e.g. Azure AD/Keycloak) and user can immediately start calling models

* docs(rbac): add docs on rbac for model access control

make it clear how admin can use roles to control model access on proxy

* fix: fix linting errors

* test(test_user_api_key_auth.py): add unit testing to ensure rbac role is correctly enforced

* test(test_user_api_key_auth.py): add more testing

* test(test_users.py): add unit testing to ensure user model access is always checked for new keys

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

* test: fix unit test

* fix(dot_notation_indexing.py): fix typing to work with python 3.8
2025-01-28 16:27:06 -08:00
Ishaan Jaff 9644e197f7 deepseek api testing - deepseek is currently hanging 2025-01-27 22:04:36 -08:00
Ishaan Jaff 46469c6087 set timeout for deepseek testing 2025-01-27 21:25:28 -08:00
Rashmi PawarandGitHub 986c463983 (doc) Add nvidia as provider (#8023)
* add nvidia as provider in docs

* fixes for closing tag

* review changes
2025-01-27 21:18:34 -08:00
Ishaan Jaff 022917b7b5 fix stale issue mgmt 2025-01-27 18:56:02 -08:00
Ishaan Jaff c1a1c052f0 fix stale issue mgmt 2025-01-27 18:53:59 -08:00
Ishaan JaffandGitHub 02edf191a3 action for stale (#8045) 2025-01-27 18:50:58 -08:00
Ishaan Jaff deb0f63c11 bump: version 1.59.8 → 1.59.9 2025-01-27 18:36:01 -08:00
Ishaan Jaff bd69226165 ui new build 2025-01-27 18:35:04 -08:00
Ishaan JaffandGitHub a626cd01e5 fix add model flow (#8043) 2025-01-27 18:34:12 -08:00
Ishaan Jaff 1255772547 docs smol agents 2025-01-27 18:12:23 -08:00
Ishaan Jaff e845675773 fix smol agents doc 2025-01-27 18:10:09 -08:00
Aymeric RoucherandGitHub 7caa05505c Add smolagents (#8026)
* Add smolagents

* Try removing emoji from url

* Revert "Try removing emoji from url"

This reverts commit 7fdc1e88e498309edc81e7147492e4549e5195a3.
2025-01-27 18:09:37 -08:00
Ishaan JaffandGitHub 7f2742334c (UI) - allow assigning wildcard models to a team / key (#8041)
* fix message.error

* fix add return_wildcard_routes

* ui edit modelAvailableCall

* fetchAvailableModelsForTeamOrKey

* ui set all models for a team

* ui define common helpers

* edit create key button

* fix viewing model display names

* fix editing team models

* update gitignore

* add jest testing for ui

* Revert "add jest testing for ui"

This reverts commit 98f9a3ebfd3d0dca5c201165024925e43893af43.
2025-01-27 18:06:22 -08:00
paul-gauthierandGitHub 3a4f5b23b5 add openrouter/deepseek/deepseek-r1 (#8038) 2025-01-27 16:37:26 -08:00
Ishaan JaffandGitHub 37aa9ea2e9 (UI enhancement) - allow onboarding wildcard models on UI (#8034)
* ui allow wildcard models

* ui show model dashboard

* add advanced settings in card

* fix button
2025-01-27 13:15:51 -08:00
Ishaan JaffandGitHub c0cc2ea4bb (UI) - Adding new models enhancement - show provider logo (#8033)
* ui allow wildcard models

* ui show model dashboard

* add advanced settings in card

* fix button

* ui - add provider logos on admin ui
2025-01-27 13:15:42 -08:00
Krrish Dholakia 395e903346 docs(bedrock.md): cleanup doc 2025-01-27 07:39:15 -08:00
Krish DholakiaandGitHub 6bafdbc546 Litellm dev 01 25 2025 p4 (#8006)
* feat(main.py): use asyncio.sleep for mock_Timeout=true on async request

adds unit testing to ensure proxy does not fail if specific Openai requests hang (e.g. recent o1 outage)

* fix(streaming_handler.py): fix deepseek r1 return reasoning content on streaming

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

* Revert "fix(streaming_handler.py): fix deepseek r1 return reasoning content on streaming"

This reverts commit 7a052a64e3642616405e71350627e2e4f66615b4.

* fix(deepseek-r-1): return reasoning_content as a top-level param

ensures compatibility with existing tools that use it

* fix: fix linting error
2025-01-26 08:01:05 -08:00
Krish DholakiaandGitHub 03eef5a2a0 Fix custom pricing - separate provider info from model info (#7990)
* fix(utils.py): initial commit fixing custom cost tracking

refactors out provider specific model info from `get_model_info` - this was causing custom costs to be registered incorrectly

* fix(utils.py): cleanup `_supports_factory` to check provider info, if model info is None

some providers support features like vision across all models

* fix(utils.py): refactor to use _supports_factory

* test: update testing

* fix: fix linting errors

* test: fix testing
2025-01-25 21:49:28 -08:00
Ishaan Jaff d9b8100cca bump: version 1.59.7 → 1.59.8 v1.59.8 2025-01-25 17:21:31 -08:00
Ishaan JaffandGitHub dcc3bbc264 (Fix) langfuse - setting LANGFUSE_FLUSH_INTERVAL (#8007)
* fix langfuse flush interval

* test_get_langfuse_flush_interval

* test_get_langfuse_flush_interval
2025-01-25 17:17:32 -08:00
Ishaan JaffandGitHub d19614b8c0 (QA / testing) - Add e2e tests for key model access auth checks (#8000)
* fix _model_matches_any_wildcard_pattern_in_list

* test key model access checks

* add key_model_access_denied to ProxyErrorTypes

* update auth checks

* test_model_access_update

* test_team_model_access_patterns

* fix _team_model_access_check

* fix config used for otel testing

* test fix test_call_with_invalid_model

* fix model acces check tests

* test_team_access_groups

* test _model_matches_any_wildcard_pattern_in_list
2025-01-25 17:15:11 -08:00
Ishaan JaffandGitHub 833a268f4b fix check on guardrails (#8008) 2025-01-25 17:14:35 -08:00
Krish DholakiaandGitHub 08b124aeb6 Litellm dev 01 25 2025 p2 (#8003)
* fix(base_utils.py): supported nested json schema passed in for anthropic calls

* refactor(base_utils.py): refactor ref parsing to prevent infinite loop

* test(test_openai_endpoints.py): refactor anthropic test to use bedrock

* fix(langfuse_prompt_management.py): add unit test for sync langfuse calls

Resolves https://github.com/BerriAI/litellm/issues/7938#issuecomment-2613293757
2025-01-25 16:50:57 -08:00
Ishaan JaffandGitHub a7b3c664d1 (Feat) set guardrails per team (#7993)
* _add_guardrails_from_key_or_team_metadata

* e2e test test_guardrails_with_team_controls

* add try/except on team new

* test_guardrails_with_team_controls

* test_guardrails_with_api_key_controls
2025-01-25 10:41:11 -08:00
Ishaan JaffandGitHub 669b4fc955 (Prometheus) - emit key budget metrics on startup (#8002)
* add UI_SESSION_TOKEN_TEAM_ID

* add type KeyListResponseObject

* add _list_key_helper

* _initialize_api_key_budget_metrics

* key / budget metrics

* init key budget metrics on startup

* test_initialize_api_key_budget_metrics

* fix linting

* test_list_key_helper

* test_initialize_remaining_budget_metrics_exception_handling
2025-01-25 10:37:52 -08:00
Ishaan JaffandGitHub d9dcfccdf6 (QA / testing) - Add unit testing for key model access checks (#7999)
* fix _model_matches_any_wildcard_pattern_in_list

* fix docstring
2025-01-25 10:01:35 -08:00
c2fa213ae2 add type annotation for litellm.api_base (#7980) (#7994)
Co-authored-by: Frederick Robinson <frederick.robinson@frrad.com>
2025-01-25 07:31:19 -08:00
Krrish Dholakia cb5da90a1a docs(bedrock.md): add doc on calling bedrock via internal gateway 2025-01-24 22:00:59 -08:00
Krish DholakiaandGitHub 4857a1e9ba refactor: cleanup dead codeblock (#7936)
* refactor: cleanup dead codeblock

* fix(main.py): add extra headers to headers

* fix: remove dead codeblock
2025-01-24 21:48:23 -08:00
Ishaan Jaff 4db1c7a9a9 linting fix v1.59.7 2025-01-24 21:30:24 -08:00
Krish DholakiaandGitHub 1ab10d8f72 Litellm dev 01 24 2025 p4 (#7992)
* feat(team_endpoints.py): new `/teams/available` endpoint - allows proxy admin to expose available teams for users to join on UI

* build(ui/): available_teams.tsx

allow user to join available teams on UI

makes it easier to onboard new users to teams

* fix(navbar.tsx): cleanup title

* fix(team_endpoints.py): fix linting error

* test: update groq model in test

* build(model_prices_and_context_window.json): update groq 3.3 model with 'supports function calling'
2025-01-24 21:29:37 -08:00
Ishaan Jaff f77882948d test_init_custom_logger_compatible_class_as_callback 2025-01-24 21:27:22 -08:00
Ishaan Jaff 3d8eb30a95 bump: version 1.59.6 → 1.59.7 2025-01-24 21:25:19 -08:00
Krish DholakiaandGitHub 8ca3229b26 Ensure base_model cost tracking works across all endpoints (#7989)
* test(test_completion_cost.py): add sdk test to ensure base model is used for cost tracking

* test(test_completion_cost.py): add sdk test to ensure custom pricing works

* fix(main.py): add base model cost tracking support for embedding calls

Enables base model cost tracking for embedding calls when base model set as a litellm_param

* fix(litellm_logging.py): update logging object with litellm params - including base model, if given

ensures base model param is always tracked

* fix(main.py): fix linting errors
2025-01-24 21:05:26 -08:00
Krish DholakiaandGitHub 9df6bd90ba fix(spend_tracking_utils.py): revert api key pass through fix (#7977)
* fix(spend_tracking_utils.py): revert api key pass through fix

* fix: fix linting error

* fix(spend_tracking_utils.py): add noqa - refactor post fixing standard logging payload on pass-through endpoints

* test(test_groq.py): bump groq model

* fix: fix positioning of noqa
2025-01-24 21:04:36 -08:00
Ishaan Jaff 2273b978f7 ui new build 2025-01-24 21:03:10 -08:00
Ishaan JaffandGitHub 74caef0843 (Feat) - Add GCS Pub/Sub Logging integration for sending DB SpendLogs to BigQuery (#7976)
* add pub_sub

* fix custom batch logger for GCS PUB/SUB

* GCS_PUBSUB_PROJECT_ID

* e2e gcs pub sub

* add gcs pub sub

* fix logging

* add GcsPubSubLogger

* fix pub sub

* add pub sub

* docs gcs pub / sub

* docs on pub sub controls

* test_gcs_pub_sub

* fix publish_message

* test_async_gcs_pub_sub

* test_async_gcs_pub_sub
2025-01-24 20:57:20 -08:00
Ishaan JaffandGitHub c9a32ebf76 (UI) - Usage page show days when spend is 0 and round spend figures on charts to 2 sig figs (#7991)
* ui with cyan

* ui format usage tab better

* fix activity page

* ui fix activity page

* ui show correct usage

* ui  usage page
2025-01-24 18:49:32 -08:00
Ishaan JaffandGitHub bf46ae7346 (Testing) e2e testing for team budget enforcement checks (#7988)
* test_team_and_key_budget_enforcement

* test_team_budget_update

* test_gemini_pro_json_schema_httpx_content_policy_error
2025-01-24 18:18:12 -08:00
Krrish Dholakia d7f862783d fix(langsmith.py): add /api/v1 to langsmith base url
ensures it works with self hosted langsmith
2025-01-24 17:58:42 -08:00
Ishaan Jaff 2017596913 Revert "test_team_and_key_budget_enforcement"
This reverts commit 9d44f51847.
2025-01-24 15:32:41 -08:00
Ishaan Jaff 9d44f51847 test_team_and_key_budget_enforcement 2025-01-24 15:31:48 -08:00
Ishaan JaffandGitHub ed283bc5b4 (Feat) - allow setting default_on guardrails (#7973)
* test_default_on_guardrail

* update debug on custom guardrail

* refactor guardrails init

* guardrail registry

* allow switching guardrails default_on

* fix circle import issue

* fix bedrock applying guardrails where content is a list

* fix unused import

* docs default on guardrail

* docs fix per api key
2025-01-24 10:14:05 -08:00
Ishaan Jaff bedd48e83e docs - store_prompts_in_spend_logs 2025-01-24 07:14:54 -08:00
Krish DholakiaandGitHub 1e011b66d3 Ollama ssl verify = False + Spend Logs reliability fixes (#7931)
* fix(http_handler.py): support passing ssl verify dynamically and using the correct httpx client based on passed ssl verify param

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

* feat(llm_http_handler.py): support passing `ssl_verify=False` dynamically in call args

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

* fix(proxy/utils.py): prevent bad logs from breaking all cost tracking + reset list regardless of success/failure

prevents malformed logs from causing all spend tracking to break since they're constantly retried

* test(test_proxy_utils.py): add test to ensure bad log is dropped

* test(test_proxy_utils.py): ensure in-memory spend logs reset after bad log error

* test(test_user_api_key_auth.py): add unit test to ensure end user id as str works

* fix(auth_utils.py): ensure extracted end user id is always a str

prevents db cost tracking errors

* test(test_auth_utils.py): ensure get end user id from request body always returns a string

* test: update tests

* test: skip bedrock test- behaviour now supported

* test: fix testing

* refactor(spend_tracking_utils.py): reduce size of get_logging_payload

* test: fix test

* bump: version 1.59.4 → 1.59.5

* Revert "bump: version 1.59.4 → 1.59.5"

This reverts commit 1182b46b2ed814064f55f438c11b590cd7248596.

* fix(utils.py): fix spend logs retry logic

* fix(spend_tracking_utils.py): fix get tags

* fix(spend_tracking_utils.py): fix end user id spend tracking on pass-through endpoints
2025-01-23 23:05:41 -08:00
851b0c4c4d Retry for replicate completion response of status=processing (#7901) (#7965)
We use the DEFAULT_REPLICATE_ constants for retry count and initial
delay. If the completion response returns status=processing, we
loop to retry.

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

Signed-off-by: BJ Hargrave <hargrave@us.ibm.com>
Co-authored-by: BJ Hargrave <bj@hargrave.dev>
2025-01-23 22:45:43 -08:00
Krish DholakiaandGitHub c6e9240405 Add datadog health check support + fix bedrock converse cost tracking w/ region name specified (#7958)
* fix(bedrock/converse_handler.py): fix bedrock region name on async calls

* fix(utils.py): fix split model handling

Fixes bedrock cost calculation when region name is given

* feat(_health_endpoints.py): support health checking datadog integration

Closes https://github.com/BerriAI/litellm/issues/7921
2025-01-23 22:17:09 -08:00
Ishaan Jaff a835baacfc ui new build - v1.59.6 2025-01-23 21:11:23 -08:00