Commit graph

70 commits

Author SHA1 Message Date
Krish Dholakia
7f47c48b35 LiteLLM Minor Fixes and Improvements (09/10/2024) (#5618)
* fix(cost_calculator.py): move to debug for noisy warning message on cost calculation error

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

* fix(databricks/cost_calculator.py): Handles model name issues for databricks models

* fix(main.py): fix stream chunk builder for multiple tool calls

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

* fix: correctly set user_alias when passed in

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

* fix(types/utils.py): allow passing role for message object

https://github.com/BerriAI/litellm/issues/5621

* fix(litellm_logging.py): Fix langfuse logging across multiple projects

Fixes issue where langfuse logger was re-using the old logging object

* feat(proxy/_types.py): support adding key-based tags for tag-based routing

Enable tag based routing at key-level

* fix(proxy/_types.py): fix inheritance

* test(test_key_generate_prisma.py): fix test

* test: fix test

* fix(litellm_logging.py): return used callback object
2024-09-11 11:30:29 -07:00
Ishaan Jaff
a4ccffefd7 fix regen keys when no duration is passed 2024-09-10 08:04:18 -07:00
Ishaan Jaff
0e0decd6b9 add /key/list endpoint 2024-09-07 16:52:28 -07:00
Ishaan Jaff
4db821897d Merge pull request #5566 from BerriAI/litellm_ui_regen_keys
[Feat] Allow setting duration time when regenerating key
2024-09-06 18:05:51 -07:00
Krish Dholakia
2cab33b061 LiteLLM Minor Fixes and Improvements (08/06/2024) (#5567)
* fix(utils.py): return citations for perplexity streaming

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

* fix(anthropic/chat.py): support fallbacks for anthropic streaming (#5542)

* fix(anthropic/chat.py): support fallbacks for anthropic streaming

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

* fix(anthropic/chat.py): use module level http client if none given (prevents early client closure)

* fix: fix linting errors

* fix(http_handler.py): fix raise_for_status error handling

* test: retry flaky test

* fix otel type

* fix(bedrock/embed): fix error raising

* test(test_openai_batches_and_files.py): skip azure batches test (for now) quota exceeded

* fix(test_router.py): skip azure batch route test (for now) - hit batch quota limits

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>

* All `model_group_alias` should show up in `/models`, `/model/info` , `/model_group/info` (#5539)

* fix(router.py): support returning model_alias model names in `/v1/models`

* fix(proxy_server.py): support returning model alias'es on `/model/info`

* feat(router.py): support returning model group alias for `/model_group/info`

* fix(proxy_server.py): fix linting errors

* fix(proxy_server.py): fix linting errors

* build(model_prices_and_context_window.json): add amazon titan text premier pricing information

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

* feat(litellm_logging.py): log standard logging response object for pass through endpoints. Allows bedrock /invoke agent calls to be correctly logged to langfuse + s3

* fix(success_handler.py): fix linting error

* fix(success_handler.py): fix linting errors

* fix(team_endpoints.py): Allows admin to update team member budgets

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
2024-09-06 17:16:24 -07:00
Ishaan Jaff
16a3223474 fix linting 2024-09-06 16:54:43 -07:00
Ishaan Jaff
b3629ebdc5 allow passing expiry time to /key/regenerate 2024-09-06 08:36:34 -07:00
Ishaan Jaff
56835f77aa fix on /user/info show all keys - even expired ones 2024-09-05 15:31:41 -07:00
Krish Dholakia
0595d03116 security - Prevent sql injection in /team/update query (#5513)
* fix(team_endpoints.py): replace `.get_data()` usage with prisma interface

Prevent sql injection in `/team/update` query

Fixes https://huntr.com/bounties/a4f6d357-5b44-4e00-9cac-f1cc351211d2

* fix(vertex_ai_non_gemini.py): handle message being a pydantic model
2024-09-04 16:03:02 -07:00
Krish Dholakia
8eb7cb5300 LiteLLM Minor fixes + improvements (08/03/2024) (#5488)
* fix(internal_user_endpoints.py): set budget_reset_at for /user/update

* fix(vertex_and_google_ai_studio_gemini.py): handle accumulated json

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

* fix(vertex_ai_and_gemini.py): fix assistant message function call when content is not None

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

* fix(proxy_server.py): generic state uuid for okta sso

* fix(lago.py): improve debug logs

Debugging for https://github.com/BerriAI/litellm/issues/5477

* docs(bedrock.md): add bedrock cross-region inferencing to docs

* fix(azure.py): return azure response headers on aembedding call

* feat(azure.py): return azure response headers for `/audio/transcription`

* fix(types/utils.py): standardize deepseek / anthropic prompt caching usage information

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

* docs(usage.md): add docs on litellm usage object

* test(test_completion.py): mark flaky test
2024-09-03 21:21:34 -07:00
Krish Dholakia
11f85d883f LiteLLM Minor Fixes + Improvements (#5474)
* feat(proxy/_types.py): add lago billing to callbacks ui

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

* fix(anthropic.py): return anthropic prompt caching information

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

* feat(bedrock/chat.py): support 'json_schema' for bedrock models

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

* fix(bedrock/embed/embeddings.py): support async embeddings for amazon titan models

* fix: linting fixes

* fix: handle key errors

* fix(bedrock/chat.py): fix bedrock ai21 streaming object

* feat(bedrock/embed): support bedrock embedding optional params

* fix(databricks.py): fix usage chunk

* fix(internal_user_endpoints.py): apply internal user defaults, if user role updated

Fixes issue where user update wouldn't apply defaults

* feat(slack_alerting.py): provide multiple slack channels for a given alert type

multiple channels might be interested in receiving an alert for a given type

* docs(alerting.md): add multiple channel alerting to docs
2024-09-02 14:29:57 -07:00
Ishaan Jaff
3bed17fc95 add set / update tags for a team 2024-08-29 13:05:00 -07:00
Krish Dholakia
9327326100 Merge pull request #5414 from BerriAI/litellm_main_staging
fixes: minor litellm fixes
2024-08-28 22:01:01 -07:00
Krrish Dholakia
fd26e7b335 fix(team_endpoints.py): update to include the budget in the response 2024-08-28 21:58:41 -07:00
Krrish Dholakia
a8ea301bbe feat(team_endpoints.py): return team member budgets in /team/info call
Fixes https://github.com/BerriAI/litellm/issues/5390
2024-08-28 19:14:01 -07:00
Krrish Dholakia
ea3fe34105 fix(key_management_endpoints.py): expose 'key' param, for setting your own key value 2024-08-28 12:27:32 -07:00
Ishaan Jaff
3ae7132cce enforce regenerating keys in enterprise tier 2024-08-26 18:54:50 -07:00
Ishaan Jaff
dd0d8658e1 update key name when regenerating a key 2024-08-26 18:40:51 -07:00
Ishaan Jaff
7e3f6ebf50 allow using hashed api keys on regen key 2024-08-26 18:15:52 -07:00
Ishaan Jaff
e69de5b426 add regenerate_key_fn 2024-08-26 17:59:44 -07:00
Ishaan Jaff
99ea908257 fix linting errors when adding a new team member 2024-08-24 16:38:43 -07:00
Krrish Dholakia
17a795a0f2 feat(team_endpoints.py): expose 2 new fields - updated_users and updated_team_memberships, on /team/member_add
Fixes https://github.com/BerriAI/litellm/issues/5345#issuecomment-2307863265

Helps user see the stored budget per team member
2024-08-24 09:22:16 -07:00
Ishaan Jaff
0de3f615ca fix /user/delete doc string 2024-08-22 09:09:51 -07:00
Ishaan Jaff
b0b5400cde fix team_member_add 2024-08-21 19:10:37 -07:00
Krrish Dholakia
35a9f328c7 fix(internal_user_endpoints.py): pass in user api key dict value 2024-08-21 12:46:43 -07:00
Krrish Dholakia
748943f910 test(test_proxy_server.py): fix test to specify user role 2024-08-21 08:37:04 -07:00
Krrish Dholakia
e32a68c94b refactor(team_endpoints.py): refactor auth checks for team member endpoints to ui team admin to manage it 2024-08-20 16:57:18 -07:00
Krrish Dholakia
64affd0d6b feat(user_api_key_auth.py): allow team admin to add new members to team 2024-08-20 14:01:12 -07:00
Ishaan Jaff
50e9d05921 feat control guardrails per API Key 2024-08-20 08:16:28 -07:00
Ishaan Jaff
a2178c026b update tpm / rpm limit per model 2024-08-17 15:26:12 -07:00
Ishaan Jaff
2c5f5996f3 add tpm limits per api key per model 2024-08-17 13:20:55 -07:00
Krrish Dholakia
4bbabb4039 refactor(test_users.py): refactor test for user info to use mock endpoints 2024-08-12 18:48:43 -07:00
Ishaan Jaff
2e94d3003b Merge pull request #5168 from BerriAI/litellm_use_user_api_key_auth_int_usr_endpoints
[Feat Proxy] Send slack alert on CRUD endpoints for Internal Users
2024-08-12 12:20:16 -07:00
Ishaan Jaff
2b79e44fc5 fix internal user tests to pass 2024-08-12 12:11:23 -07:00
Ishaan Jaff
79874caf98 fix doc string for team endpoints 2024-08-12 11:54:28 -07:00
Ishaan Jaff
dbd98acb25 use management_endpoint_wrapper for key endpoints 2024-08-12 11:02:21 -07:00
Krrish Dholakia
259ca15d7b fix(internal_user_endpoints.py): return all teams if user is admin 2024-08-10 16:36:43 -07:00
Krrish Dholakia
482acc7ee1 fix(router.py): fallback on 400-status code requests 2024-08-09 12:16:49 -07:00
Krrish Dholakia
a70e9661fd fix(management_helpers/utils.py): use user_default max_budget, budget duration on new user upsert during team member add
Fixes https://github.com/BerriAI/litellm/issues/5106
2024-08-08 19:14:43 -07:00
Krrish Dholakia
856ede4a05 test(test_proxy_server.py): unit testing to make sure internal user params don't impact admin 2024-08-08 17:59:30 -07:00
Krrish Dholakia
6266937c75 fix(internal_user_endpoints.py): expose new 'internal_user_budget_duration' flag
Relevant to - https://github.com/BerriAI/litellm/issues/5106
2024-08-08 17:19:05 -07:00
Krrish Dholakia
182d63853b fix: use more descriptive flag 2024-08-07 18:59:46 -07:00
Krrish Dholakia
e60b2d9258 fix(internal_user_endpoints.py): respect 'max_user_budget' for new internal user's 2024-08-07 18:50:40 -07:00
Krrish Dholakia
cbad9e7502 build(ui): allow admin_viewer to view teams tab
Allows admin viewe role to see available teams on proxy ui
2024-08-02 16:19:40 -07:00
Krrish Dholakia
1915adfc2d fix(auth_checks.py): fix redis usage for team cached objects 2024-07-30 17:30:00 -07:00
Krish Dholakia
473308a6dd Merge branch 'main' into litellm_redis_team_object 2024-07-25 19:31:52 -07:00
Krrish Dholakia
d1622f6c0c fix(internal_user_endpoints.py): support updating budgets for /user/update 2024-07-24 21:51:46 -07:00
Krrish Dholakia
487035c970 feat(auth_check.py): support using redis cache for team objects
Allows team update / check logic to work across instances instantly
2024-07-24 18:14:49 -07:00
Krrish Dholakia
254b6dc630 fix(key_management_endpoints.py): if budget duration set, set budget_reset_at 2024-07-24 15:02:22 -07:00
Ishaan Jaff
926e50c50e add endpoint to disable logging for a team 2024-07-23 08:38:23 -07:00