Commit graph

3786 commits

Author SHA1 Message Date
Krish Dholakia
501b6f5bac Allow client-side credentials to be sent to proxy (accept only if complete credentials are given) (#5575)
* feat: initial commit

* fix(proxy/auth/auth_utils.py): Allow client-side credentials to be given to the proxy (accept only if complete credentials are given)
2024-09-06 19:21:54 -07:00
Ishaan Jaff
2b7580916e ui new build 2024-09-06 18:10:46 -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
Ishaan Jaff
164d8696ca Merge pull request #5574 from BerriAI/litellm_tags_use_views
[Feat-Proxy] Use DB Views to Get spend per Tag (Usage endpoints)
2024-09-06 17:33:06 -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
0c4022d848 fix use view for getting tag usage 2024-09-06 16:28:24 -07:00
Ishaan Jaff
b3629ebdc5 allow passing expiry time to /key/regenerate 2024-09-06 08:36:34 -07:00
Krish Dholakia
355f4a7c90 LiteLLM Minor Fixes and Improvements (#5537)
* fix(vertex_ai): Fixes issue where multimodal message without text was failing vertex calls

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

* fix(azure.py): move to using httphandler for oidc token calls

Fixes issue where ssl certificates weren't being picked up as expected

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

* feat: Allows admin to set a default_max_internal_user_budget in config, and allow setting more specific values as env vars

* fix(proxy_server.py): fix read for max_internal_user_budget

* build(model_prices_and_context_window.json): add regional gpt-4o-2024-08-06 pricing

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

* test: skip re-test
2024-09-05 18:03:34 -07:00
Ishaan Jaff
18e2169c40 ui new build 2024-09-05 17:05:39 -07:00
Ishaan Jaff
dd7d93fd54 Merge branch 'main' into litellm_allow_internal_user_view_usage 2024-09-05 16:46:06 -07:00
Ishaan Jaff
56835f77aa fix on /user/info show all keys - even expired ones 2024-09-05 15:31:41 -07:00
Ishaan Jaff
7ef1ac7996 fix allow internal user to view their own usage 2024-09-05 12:53:44 -07:00
Ishaan Jaff
3a48776720 fix /global/spend/provider 2024-09-05 12:48:58 -07:00
Ishaan Jaff
b4d6efd454 add global/spend/provider 2024-09-05 12:44:44 -07:00
Ishaan Jaff
6d656983c6 allow internal user to view global/spend/models 2024-09-05 12:38:48 -07:00
Ishaan Jaff
bb0fc2504b allow internal user to view their own spend 2024-09-05 12:35:04 -07:00
Ishaan Jaff
14ba077bf9 add usage endpoints for internal user 2024-09-05 12:34:41 -07:00
Ishaan Jaff
6ab47703b8 show /spend/logs for internal users 2024-09-05 12:14:03 -07:00
Ishaan Jaff
38890a731d fix create view - MonthlyGlobalSpendPerUserPerKey 2024-09-05 12:11:59 -07:00
Ishaan Jaff
5d808f488e add /spend/tags as allowed route for internal user 2024-09-05 10:41:43 -07:00
Krish Dholakia
6f354ecac6 fix(pass_through_endpoints): support bedrock agents via pass through (#5527) 2024-09-04 22:22:22 -07:00
Krish Dholakia
6fdee99632 LiteLLM Minor fixes + improvements (08/04/2024) (#5505)
* Minor IAM AWS OIDC Improvements (#5246)

* AWS IAM: Temporary tokens are valid across all regions after being issued, so it is wasteful to request one for each region.

* AWS IAM: Include an inline policy, to help reduce misuse of overly permissive IAM roles.

* (test_bedrock_completion.py): Ensure we are testing cross AWS region OIDC flow.

* fix(router.py): log rejected requests

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

* refactor: don't use verbose_logger.exception, if exception is raised

User might already have handling for this. But alerting systems in prod will raise this as an unhandled error.

* fix(datadog.py): support setting datadog source as an env var

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

* docs(logging.md): add dd_source to datadog docs

* fix(proxy_server.py): expose `/customer/list` endpoint for showing all customers

* (bedrock): Fix usage with Cloudflare AI Gateway, and proxies in general. (#5509)

* feat(anthropic.py): support 'cache_control' param for content when it is a string

* Revert "(bedrock): Fix usage with Cloudflare AI Gateway, and proxies in gener…" (#5519)

This reverts commit 3fac0349c2.

* refactor: ci/cd run again

---------

Co-authored-by: David Manouchehri <david.manouchehri@ai.moda>
2024-09-04 22:16:55 -07:00
Ishaan Jaff
15ac8f4ebe fix allow general guardrails on free tier 2024-09-04 19:59:32 -07:00
Ishaan Jaff
770fc45ec1 Merge pull request #5518 from BerriAI/litellm_log_request_response
[Feat] log request / response on pass through endpoints
2024-09-04 17:57:47 -07:00
Ishaan Jaff
3e1ff425de return error from /global/spend endpoint 2024-09-04 17:26:34 -07:00
Ishaan Jaff
8426d0e3e0 return error client side from spend endpoints 2024-09-04 17:20:47 -07:00
Ishaan Jaff
94ecb4e480 show error from /spend/tags 2024-09-04 17:14:49 -07:00
Ishaan Jaff
784ceaad0d rename type 2024-09-04 16:33:36 -07:00
Ishaan Jaff
b336977ff6 add doc on PassthroughStandardLoggingObject 2024-09-04 16:30:47 -07:00
Ishaan Jaff
5e121660d5 feat log request / response on pass through endpoints 2024-09-04 16:26:32 -07:00
Ishaan Jaff
b468ccbb77 Merge pull request #5514 from BerriAI/litellm_add_presidio
[Fix-Refactor] support presidio on new guardrails config
2024-09-04 16:09:54 -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
Ishaan Jaff
a5f892bb6d fix init presidio guardrail 2024-09-04 15:22:37 -07:00
Ishaan Jaff
120486d2fc allow init guardrails with output parsing logic 2024-09-04 14:40:35 -07:00
Ishaan Jaff
5e15433004 docs new presidio language controls 2024-09-04 13:04:19 -07:00
Ishaan Jaff
7b1e0beda5 fix allow setting language per call to presidio 2024-09-04 12:46:59 -07:00
Ishaan Jaff
935dba4470 Merge pull request #5484 from BerriAI/litellm_fix_redis
fix proxy server - always read redis for rate limiting logic
2024-09-04 12:39:15 -07:00
Ishaan Jaff
90163de80a fix presidio calling logic 2024-09-04 12:14:30 -07:00
Ishaan Jaff
69e8e4fdb5 migrate presidio to new guardrails 2024-09-04 10:12:23 -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
Ishaan Jaff
2a6bcad5d2 Merge branch 'main' into litellm_allow_setting_route_controls 2024-09-03 17:00:22 -07:00
Ishaan Jaff
daaca2760e add test for admin only routes 2024-09-03 15:26:42 -07:00
Ishaan Jaff
bfb0aceeae add check for admin only routes 2024-09-03 15:03:32 -07:00
Ishaan Jaff
dd9ae9ccae Merge pull request #5489 from BerriAI/litellm_Add_secret_managers
[Feat] Add Google Secret Manager Support
2024-09-03 14:51:32 -07:00
Ishaan Jaff
cf66ca89b9 allow setting allowed routes on proxy 2024-09-03 13:59:31 -07:00
Ishaan Jaff
b5d1d93c14 refactor secret managers 2024-09-03 10:58:02 -07:00
Ishaan Jaff
47bfa77e3b read from .env for secret manager 2024-09-03 10:53:52 -07:00
Ishaan Jaff
09519b74db refactor get_secret 2024-09-03 10:42:12 -07:00
Krrish Dholakia
030567b886 fix(proxy/_types.py): add lago 'charge_by' env var to proxy ui 2024-09-03 08:19:40 -07:00