Commit graph

503 commits

Author SHA1 Message Date
Ishaan Jaff
5fe95f7232 fix handle o1 not supporting system message 2024-09-12 14:09:13 -07:00
Ishaan Jaff
283370aeef fix langsmith_batch_size 2024-09-11 11:25:33 -07:00
Ishaan Jaff
bdc22a9b58 add enum for all llm providers LlmProviders 2024-09-10 10:44:57 -07:00
Krish Dholakia
09ca581620 LiteLLM Minor Fixes and Improvements (09/09/2024) (#5602)
* fix(main.py): pass default azure api version as alternative in completion call

Fixes api error caused due to api version

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

* Fixed gemini-1.5-flash pricing (#5590)

* add /key/list endpoint

* bump: version 1.44.21 → 1.44.22

* docs architecture

* Fixed gemini-1.5-flash pricing

---------

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

* fix(bedrock/chat.py): fix converse api stop sequence param mapping

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

* fix(databricks/cost_calculator.py): handle databricks model name changes

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

* fix(azure.py): support azure api version 2024-08-01-preview

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

* fix(proxy/_types.py): allow dev keys to call cohere /rerank endpoint

Fixes issue where only admin could call rerank endpoint

* fix(azure.py): check if model is gpt-4o

* fix(proxy/_types.py): support /v1/rerank on non-admin routes as well

* fix(cost_calculator.py): fix split on `/` logic in cost calculator

---------

Co-authored-by: F1bos <44951186+F1bos@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
2024-09-09 21:56:12 -07:00
Krish Dholakia
52849e6422 LiteLLM Minor Fixes and Improvements (09/07/2024) (#5580)
* fix(litellm_logging.py): set completion_start_time_float to end_time_float if none

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

* feat(_init_.py): add new 'openai_text_completion_compatible_providers' list

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

Handles correctly routing fireworks ai calls when done via text completions

* fix: fix linting errors

* fix: fix linting errors

* fix(openai.py): fix exception raised

* fix(openai.py): fix error handling

* fix(_redis.py): allow all supported arguments for redis cluster (#5554)

* Revert "fix(_redis.py): allow all supported arguments for redis cluster (#5554)" (#5583)

This reverts commit f2191ef4cb.

* fix(router.py): return model alias w/ underlying deployment on router.get_model_list()

Fixes https://github.com/BerriAI/litellm/issues/5524#issuecomment-2336410666

* test: handle flaky tests

---------

Co-authored-by: Jonas Dittrich <58814480+Kakadus@users.noreply.github.com>
2024-09-09 18:54:17 -07:00
Krish Dholakia
c910a32439 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:21:42 -07:00
Ishaan Jaff
6f68e860e0 fix import error 2024-09-05 10:09:44 -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
44a1677c7c test get llm provider 2024-09-04 09:22:19 -07:00
Ishaan Jaff
09519b74db refactor get_secret 2024-09-03 10:42:12 -07:00
Krish Dholakia
18da7adce9 feat(router.py): Support Loadbalancing batch azure api endpoints (#5469)
* feat(router.py): initial commit for loadbalancing azure batch api endpoints

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

* fix(router.py): working `router.acreate_file()`

* feat(router.py): working router.acreate_batch endpoint

* feat(router.py): expose router.aretrieve_batch function

Make it easy for user to retrieve the batch information

* feat(router.py): support 'router.alist_batches' endpoint

Adds support for getting all batches across all endpoints

* feat(router.py): working loadbalancing on `/v1/files`

* feat(proxy_server.py): working loadbalancing on `/v1/batches`

* feat(proxy_server.py): working loadbalancing on Retrieve + List batch
2024-09-02 21:32:55 -07:00
Ishaan Jaff
9c14d63697 Merge branch 'main' into litellm_track_imagen_spend_logs 2024-09-02 21:21:15 -07:00
Ishaan Jaff
b6009233ac fix always read redis 2024-09-02 21:08:32 -07:00
Ishaan Jaff
ce4fb10b04 fix get_llm_provider for imagegeneration@006 2024-09-02 17:47:29 -07:00
Ishaan Jaff
dc1b0ec182 Merge pull request #5478 from BerriAI/litellm_Add_ai21
[Feat] Add AI21 /chat API
2024-09-02 16:20:37 -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
Krish Dholakia
3fbb4f8fac 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
Ishaan Jaff
b1f3f27342 add ai21 model test 2024-09-02 12:14:13 -07:00
Ishaan Jaff
6bd18f7cbe add ai21_chat as new provider 2024-09-02 11:44:06 -07:00
Krish Dholakia
e474c3665a 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
aa9f1896c6 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
6aaa7a75cd add cerebras api 2024-08-31 08:35:23 -07:00
Ishaan Jaff
ea12519b98 fix map input_type to task_type for vertex ai 2024-08-30 12:09:07 -07:00
Ishaan Jaff
dbdbf3d9a2 use correct vtx ai21 pricing 2024-08-29 19:04:05 -07:00
Ishaan Jaff
da43356242 Merge pull request #5431 from BerriAI/litellm_Add_fireworks_ai_health_check
[Fix-Proxy] /health check for provider wildcard models (fireworks/*)
2024-08-29 14:25:05 -07:00
Ishaan Jaff
f4f325953c add fireworks_ai_models 2024-08-29 09:23:11 -07:00
Krish Dholakia
996c028127 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
Krrish Dholakia
947801d3ac fix(__init__.py): fix import 2024-08-27 19:35:03 -07:00
Krrish Dholakia
882ae8ac2c fix: initial commit 2024-08-27 17:35:56 -07:00
Ishaan Jaff
f9d2c0c40f add basic cohere rerank 2024-08-27 15:55:43 -07:00
Ishaan Jaff
5f61539e90 refactor partner models to include ai21 2024-08-27 13:35:22 -07:00
Krrish Dholakia
df4dc24962 fix: fix imports 2024-08-26 22:24:30 -07:00
Krrish Dholakia
074e30fa10 feat(vertex_ai_context_caching.py): support making context caching calls to vertex ai in a normal chat completion call (anthropic caching format)
Closes https://github.com/BerriAI/litellm/issues/5213
2024-08-26 22:19:01 -07:00
Krish Dholakia
a33b3b2f24 Merge pull request #5376 from BerriAI/litellm_sagemaker_streaming_fix
fix(sagemaker.py): support streaming for messages api
2024-08-26 21:36:10 -07:00
Krrish Dholakia
b989762bb0 fix(sagemaker.py): support streaming for messages api
Fixes https://github.com/BerriAI/litellm/issues/5372
2024-08-26 15:08:08 -07:00
Ishaan Jaff
5c1ebb6ac2 use common folder for cohere 2024-08-26 14:28:50 -07:00
Krish Dholakia
bc2a96b2a5 Merge branch 'main' into litellm_vertex_migration 2024-08-24 18:24:19 -07:00
Krish Dholakia
5eba49c112 Merge pull request #5343 from BerriAI/litellm_sagemaker_chat
feat(sagemaker.py): add sagemaker messages api support
2024-08-23 21:00:00 -07:00
Krish Dholakia
6592de3ef9 Merge pull request #5292 from OgnjenFrancuski/main
Update SSL verification
2024-08-23 20:42:35 -07:00
Krrish Dholakia
f7aa787fe6 feat(sagemaker.py): add sagemaker messages api support
Closes https://github.com/BerriAI/litellm/issues/2641

 Closes https://github.com/BerriAI/litellm/pull/5178
2024-08-23 10:31:35 -07:00
Krrish Dholakia
a9b5d5271f feat(batches): add azure openai batches endpoint support
Closes https://github.com/BerriAI/litellm/issues/5073
2024-08-22 14:46:51 -07:00
Krrish Dholakia
d87e8f5b30 feat(utils.py): support global vertex ai safety settings param 2024-08-21 17:37:50 -07:00
Ognjen Francuski
f9093a6432 Update handling of 'litellm.ssl_verify' in HTTP handlers to allow for custom, self-signed certificates. 2024-08-20 10:16:03 +02:00
Krrish Dholakia
83ed174059 fix(__init__.py): fix models_by_provider to include cohere_chat models
Fixes https://github.com/BerriAI/litellm/issues/5201
2024-08-16 11:33:23 -07:00
Ishaan Jaff
c5515513a9 feat allow controlling logged tags on langfuse 2024-08-13 12:24:01 -07:00
Krrish Dholakia
f4c984878d fix(utils.py): Break out of infinite streaming loop
Fixes https://github.com/BerriAI/litellm/issues/5158
2024-08-12 14:00:43 -07:00
Ishaan Jaff
8e90139377 refactor prometheus to be a customLogger class 2024-08-10 09:28:46 -07:00
Ishaan Jaff
e82656d59a init bedrock_tool_name_mappings 2024-08-09 17:09:19 -07:00
Krrish Dholakia
36c37bcc8b fix(internal_user_endpoints.py): expose new 'internal_user_budget_duration' flag
Relevant to - https://github.com/BerriAI/litellm/issues/5106
2024-08-08 13:05:03 -07:00
Krish Dholakia
7d28b6ebc3 Merge branch 'main' into litellm_personal_user_budgets 2024-08-07 19:59:50 -07:00