Commit graph

1640 commits

Author SHA1 Message Date
Krish Dholakia
1e7e538261
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
Krish Dholakia
fa2d9002b5
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
be3c7b401e
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
b0178a85cf refactor get_secret 2024-09-03 10:42:12 -07:00
Ishaan Jaff
c1adb0b7f2
Merge branch 'main' into litellm_track_imagen_spend_logs 2024-09-02 21:21:15 -07:00
Ishaan Jaff
bfb39eb0cd fix linting errors 2024-09-02 19:39:10 -07:00
Ishaan Jaff
aa13977136 refactor vtx image gen 2024-09-02 17:35:51 -07:00
Ishaan Jaff
eb9e4f1787 track /embedding in spendLogs 2024-09-02 17:05:53 -07:00
Ishaan Jaff
666dd6aca2
Merge pull request #5478 from BerriAI/litellm_Add_ai21
[Feat] Add AI21 /chat API
2024-09-02 16:20:37 -07:00
Krish Dholakia
f9e6507cd1
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
0874885f04 add all ai21 params 2024-09-02 11:54:40 -07:00
Ishaan Jaff
af0d2d1f3b refactor ai21 2024-09-02 11:47:04 -07:00
David Manouchehri
47e664a5da
(gemini): Fix Cloudflare AI Gateway typo. (#5429) 2024-09-02 07:52:18 -07:00
Simon S. Viloria
7778fa0146
fix response_format={'type': 'json_object'} not working for Azure models (#5468) 2024-09-01 13:31:13 -07:00
Krish Dholakia
37f9705d6e
Bedrock Embeddings refactor + model support (#5462)
* refactor(bedrock): initial commit to refactor bedrock to a folder

Improve code readability + maintainability

* refactor: more refactor work

* fix: fix imports

* feat(bedrock/embeddings.py): support translating embedding into amazon embedding formats

* fix: fix linting errors

* test: skip test on end of life model

* fix(cohere/embed.py): fix linting error

* fix(cohere/embed.py): fix typing

* fix(cohere/embed.py): fix post-call logging for cohere embedding call

* test(test_embeddings.py): fix error message assertion in test
2024-09-01 13:29:58 -07:00
Krish Dholakia
6fb82aaf75
Minor LiteLLM Fixes and Improvements (#5456)
* fix(utils.py): support 'drop_params' for embedding requests

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

* feat(vertex_ai_non_gemini.py): support function param in messages

* test: skip test - model end of life

* fix(vertex_ai_non_gemini.py): fix gemini history parsing
2024-08-31 17:58:10 -07:00
Krish Dholakia
47ef1f9191 anthropic prompt caching cost tracking (#5453)
* fix(utils.py): support 'drop_params' for embedding requests

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

* feat(anthropic/cost_calculation.py): Support calculating cost for prompt caching on anthropic

* feat(types/utils.py): allows us to migrate to openai's equivalent, once that comes out

* fix: fix linting errors

* test: mark flaky test
2024-08-31 14:50:12 -07:00
Ishaan Jaff
cb6a0f0237 add cerebras config 2024-08-31 08:34:46 -07:00
Ishaan Jaff
3a72197e77
Merge pull request #5455 from BerriAI/litellm_vtx_add_input_type_mapping
[Feat] Vertex embeddings - map `input_type` to `text_type`
2024-08-30 17:03:04 -07:00
Ishaan Jaff
541033ec7e add VertexAITextEmbeddingConfig 2024-08-30 12:53:43 -07:00
Ishaan Jaff
518aa639fa fix map input_type to task_type for vertex ai 2024-08-30 12:09:07 -07:00
Ishaan Jaff
570a5a2825 fix dir structure for tts 2024-08-30 11:44:23 -07:00
Ishaan Jaff
1bd2b2fc92
Merge pull request #5449 from BerriAI/litellm_Fix_vertex_multimodal
[Fix-Proxy] Allow running /health checks on vertex multimodal embedding requests
2024-08-30 10:21:42 -07:00
Ishaan Jaff
a6273a29fe add test for test_vertexai_multimodal_embedding_text_input 2024-08-30 09:19:48 -07:00
Krish Dholakia
dd7b008161
fix: Minor LiteLLM Fixes + Improvements (29/08/2024) (#5436)
* fix(model_checks.py): support returning wildcard models on `/v1/models`

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

* fix(bedrock_httpx.py): support calling bedrock via api_base

Closes https://github.com/BerriAI/litellm/pull/4587

* fix(litellm_logging.py): only leave last 4 char of gemini key unmasked

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

* feat(router.py): support setting 'weight' param for models on router

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

* test(test_bedrock_completion.py): add unit test for custom api base

* fix(model_checks.py): handle no "/" in model
2024-08-29 22:40:25 -07:00
David Manouchehri
19db80ffeb
(bedrock): Add new cross-region inference support for Bedrock. 2024-08-29 17:49:16 +00:00
Krish Dholakia
559a6ad826
fix(google_ai_studio): working context caching (#5421)
* fix(google_ai_studio): working context caching

* feat(vertex_ai_context_caching.py): support async cache check calls

* fix(vertex_and_google_ai_studio_gemini.py): fix setting headers

* fix(vertex_ai_parter_models): fix import

* fix(vertex_and_google_ai_studio_gemini.py): fix input

* test(test_amazing_vertex_completion.py): fix test
2024-08-29 07:00:30 -07:00
Krrish Dholakia
dd9c5d10bd fix(vertex_ai_partner_models.py): fix vertex import 2024-08-28 18:08:33 -07:00
Krish Dholakia
a857f4a8ee
Merge branch 'main' into litellm_main_staging 2024-08-28 18:05:27 -07:00
Krish Dholakia
d928220ed2
Merge pull request #5393 from BerriAI/litellm_gemini_embedding_support
feat(vertex_ai_and_google_ai_studio): Support Google AI Studio Embedding Endpoint
2024-08-28 13:46:28 -07:00
Ishaan Jaff
58506dbade update validate_vertex_input 2024-08-28 12:52:26 -07:00
Ishaan Jaff
6d11b392f8 add ssml input on vertex tts 2024-08-28 12:17:53 -07:00
Krrish Dholakia
e1db58b8e5 fix(main.py): simplify to just use /batchEmbedContent 2024-08-27 21:46:05 -07:00
Krrish Dholakia
a6ce27ca29 feat(batch_embed_content_transformation.py): support google ai studio /batchEmbedContent endpoint
Allows for multiple strings to be given for embedding
2024-08-27 19:23:50 -07:00
Krrish Dholakia
bb42146ffe feat(embeddings_handler.py): support async gemini embeddings 2024-08-27 18:31:57 -07:00
Ishaan Jaff
647504b462 add test for rerank on custom api base 2024-08-27 18:25:51 -07:00
Krrish Dholakia
5b29ddd2a6 fix(embeddings_handler.py): initial working commit for google ai studio text embeddings /embedContent endpoint 2024-08-27 18:14:56 -07:00
Krrish Dholakia
77e6da78a1 fix: initial commit 2024-08-27 17:35:56 -07:00
Ishaan Jaff
06529f19df
Merge pull request #5392 from BerriAI/litellm_add_native_cohere_rerank
[Feat] Add cohere rerank and together ai rerank
2024-08-27 17:29:37 -07:00
Ishaan Jaff
37ed201c50 fix install on 3.8 2024-08-27 17:09:16 -07:00
Krrish Dholakia
5b06ea136c fix(openai.py): fix error re-raising 2024-08-27 17:06:25 -07:00
Ishaan Jaff
b3892b871d add async support for rerank 2024-08-27 17:02:48 -07:00
Krrish Dholakia
d29a7087f1 feat(vertex_ai_and_google_ai_studio): Support Google AI Studio Embeddings endpoint
Closes https://github.com/BerriAI/litellm/issues/5385
2024-08-27 16:53:11 -07:00
Ishaan Jaff
f33dfe0b95 add rerank params 2024-08-27 16:45:39 -07:00
Ishaan Jaff
dc42ad0021 add tg ai rerank support 2024-08-27 16:25:54 -07:00
Krrish Dholakia
6431af0678 fix(bedrock_httpx.py): support 'Auth' header as extra_header
Fixes https://github.com/BerriAI/litellm/issues/5389#issuecomment-2313677977
2024-08-27 16:08:54 -07:00
Krrish Dholakia
1b2f73c220 fix(azure_text.py): fix streaming parsing 2024-08-27 15:52:55 -07:00
Ishaan Jaff
6ab8cbc105
Merge pull request #5391 from BerriAI/litellm_add_ai21_support
[Feat] Add Vertex  AI21 support
2024-08-27 15:06:26 -07:00
Ishaan Jaff
33a3a01949 add mock test for ai21 2024-08-27 14:42:13 -07:00
Krrish Dholakia
b91e5d3887 fix(openai.py): fix post call error logging for aembedding calls 2024-08-27 14:26:06 -07:00