Commit graph

18313 commits

Author SHA1 Message Date
Ishaan Jaff
42b95c5979 code cleanup 2024-09-02 16:36:19 -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
Ishaan Jaff
e9427205ef add test for pass through streaming usage tracking 2024-09-02 16:17:49 -07:00
Ishaan Jaff
a6d4a27207 pass through track usage for streaming endpoints 2024-09-02 16:11:20 -07:00
Ishaan Jaff
73d0a78444 use chunk_processort 2024-09-02 15:51:52 -07:00
Ishaan Jaff
fdecafd347 new streaming handler fn 2024-09-02 15:51:21 -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
Krish Dholakia
02f288a8a3
Azure Service Principal with Secret authentication workflow. (#5131) (#5437)
* Azure Service Principal with Secret authentication workflow. (#5131)

* Implement Azure Service Principal with Secret authentication workflow.

* Use `ClientSecretCredential` instead of `DefaultAzureCredential`.

* Move imports into the function.

* Add type hint for `azure_ad_token_provider`.

* Add unit test for router initialization and sample completion using Azure Service Principal with Secret authentication workflow.

* Add unit test for router initialization with neither API key nor using Azure Service Principal with Secret authentication workflow.

* fix(client_initializtion_utils.py): fix typing + overrides

* test: fix linting errors

* fix(client_initialization_utils.py): fix client init azure ad token logic

* fix(router_client_initialization.py): add flag check for reading azure ad token from environment

* test(test_streaming.py): skip end of life bedrock model

* test(test_router_client_init.py): add correct flag to test

---------

Co-authored-by: kzych-inpost <142029278+kzych-inpost@users.noreply.github.com>
2024-09-02 14:29:00 -07:00
Krrish Dholakia
2797b30a50 build(model_prices_and_context_window.json): fix token information 2024-09-02 13:14:11 -07:00
Kyrylo Yefimenko
1a0d8e7260
Add pricing for ft:gpt-3.5-turbo-* (#5471) 2024-09-02 13:12:57 -07:00
Ishaan Jaff
c8fc453b75 fix pass through construct_target_url when vertex_proj is None 2024-09-02 12:51:30 -07:00
Ishaan Jaff
d4f77832c0 docs add docs on supported params 2024-09-02 12:39:07 -07:00
Ishaan Jaff
f28e94827c docs update ai21 doc 2024-09-02 12:26:53 -07:00
Ishaan Jaff
93650db380 fix linting 2024-09-02 12:15:14 -07:00
Ishaan Jaff
263e283126 add ai21 model test 2024-09-02 12:14:13 -07:00
Ishaan Jaff
ae25c5695f add streaming test for ai21 2024-09-02 11:58:15 -07:00
Ishaan Jaff
0874885f04 add all ai21 params 2024-09-02 11:54:40 -07:00
Ishaan Jaff
0970475a3b test ai21 2024-09-02 11:47:48 -07:00
Ishaan Jaff
af0d2d1f3b refactor ai21 2024-09-02 11:47:04 -07:00
Ishaan Jaff
05d92e34a3 add ai21 provider 2024-09-02 11:45:27 -07:00
Ishaan Jaff
82eacf2106 add ai21_chat as new provider 2024-09-02 11:44:06 -07:00
Ishaan Jaff
40bfb21693 docs - update /health docs to show correct info 2024-09-02 08:54:19 -07:00
David Manouchehri
47e664a5da
(gemini): Fix Cloudflare AI Gateway typo. (#5429) 2024-09-02 07:52:18 -07:00
Krrish Dholakia
41114f1c25 docs(security.md): Adds security.md file to project root
Closes https://github.com/BerriAI/litellm/issues/5473
2024-09-02 07:41:29 -07:00
Krish Dholakia
e0d81434ed
LiteLLM minor fixes + improvements (31/08/2024) (#5464)
* fix(vertex_endpoints.py): fix vertex ai pass through endpoints

* test(test_streaming.py): skip model due to end of life

* feat(custom_logger.py): add special callback for model hitting tpm/rpm limits

Closes https://github.com/BerriAI/litellm/issues/4096
2024-09-01 13:31:42 -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
Ishaan Jaff
54b60a9afd bump: version 1.44.13 → 1.44.14 2024-08-31 16:55:37 -07:00
Ishaan Jaff
d9f3ac5159
Merge pull request #5463 from BerriAI/litellm_track_error_per_model
[Feat - Prometheus] - Track error_code, model metric
2024-08-31 16:36:04 -07:00
Ishaan Jaff
3e4e72ff1b
Merge pull request #5461 from BerriAI/litellm_add_cerebras
[Feat] New Provider - Add Cerebras AI API
2024-08-31 16:30:56 -07:00
Ishaan Jaff
56f10224df
Merge pull request #5457 from BerriAI/litellm_track_spend_logs_for_vertex_pass_through_endpoints
[Feat-Proxy] track spend logs for vertex pass through endpoints
2024-08-31 16:30:15 -07:00
Ishaan Jaff
4bd85b9d83 add cerebras cost tracking 2024-08-31 16:29:26 -07:00
Ishaan Jaff
9a3873b9ed mark flaky test as flaky 2024-08-31 15:02:56 -07:00
Ishaan Jaff
fd4157cf71 docs add cerebras 2024-08-31 14:57:12 -07:00
Krrish Dholakia
336022e97c test: skip test on end of life model 2024-08-31 14:50:52 -07:00
Krish Dholakia
65a9c933ad 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:52 -07:00
Krrish Dholakia
017dd88910 test: skip test on end of life model 2024-08-31 14:50:12 -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
2e0ee8c72f skip end of life model in test 2024-08-31 14:48:52 -07:00
Ishaan Jaff
e6faaba56e docs add litellm_error_code_metric_total 2024-08-31 14:46:41 -07:00
Krrish Dholakia
f450b99368 test: skip test on end of life model 2024-08-31 14:34:16 -07:00
Krish Dholakia
9c8f1d7815
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:09:35 -07:00
Ishaan Jaff
6ab601432b feat prometheus add metric for failure / model 2024-08-31 10:05:23 -07:00
Ishaan Jaff
b8bc448479 ci/cd run again 2024-08-31 09:42:58 -07:00
Ishaan Jaff
9e557ed072 fix test 2024-08-31 08:39:52 -07:00
Ishaan Jaff
de9efe76ca add cerebras api 2024-08-31 08:35:23 -07:00
Ishaan Jaff
cb6a0f0237 add cerebras config 2024-08-31 08:34:46 -07:00
Ishaan Jaff
b35bfb0302 fix cost tracking for vertex ai native 2024-08-31 08:22:27 -07:00
yujonglee
2c10f62763 forget to keep existing search - bring it back 2024-08-30 21:27:13 -04:00