Commit graph

699 commits

Author SHA1 Message Date
Krish Dholakia
4ac66bd843
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
ce67858ceb 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
25887c1846 fix import error 2024-09-05 10:09:44 -07:00
Ishaan Jaff
4e392ebdb2
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
9ed4dad5ac test get llm provider 2024-09-04 09:22:19 -07:00
Ishaan Jaff
b0178a85cf refactor get_secret 2024-09-03 10:42:12 -07:00
Krish Dholakia
9f3fa29624
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
c1adb0b7f2
Merge branch 'main' into litellm_track_imagen_spend_logs 2024-09-02 21:21:15 -07:00
Ishaan Jaff
fd122cb759 fix always read redis 2024-09-02 21:08:32 -07:00
Ishaan Jaff
80dd2cfc7f fix get_llm_provider for imagegeneration@006 2024-09-02 17:47:29 -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
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
Ishaan Jaff
263e283126 add ai21 model test 2024-09-02 12:14:13 -07:00
Ishaan Jaff
82eacf2106 add ai21_chat as new provider 2024-09-02 11:44:06 -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
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
de9efe76ca add cerebras api 2024-08-31 08:35:23 -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
6bd6c956a5 use correct vtx ai21 pricing 2024-08-29 19:04:05 -07:00
Ishaan Jaff
5851a8f901
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
4b6a2fa4f3 add fireworks_ai_models 2024-08-29 09:23:11 -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
Krrish Dholakia
bd4f63eebf fix(__init__.py): fix import 2024-08-27 19:35:03 -07:00
Krrish Dholakia
77e6da78a1 fix: initial commit 2024-08-27 17:35:56 -07:00
Ishaan Jaff
3a82334762 add basic cohere rerank 2024-08-27 15:55:43 -07:00
Ishaan Jaff
11c175a215 refactor partner models to include ai21 2024-08-27 13:35:22 -07:00
Krrish Dholakia
3ec8a0d25d fix: fix imports 2024-08-26 22:24:30 -07:00
Krrish Dholakia
b0cc1df2d6 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
3a6412c9c3
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
8e9acd117b 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
da63775371 use common folder for cohere 2024-08-26 14:28:50 -07:00
Krish Dholakia
f27abe0462
Merge branch 'main' into litellm_vertex_migration 2024-08-24 18:24:19 -07:00
Krish Dholakia
cd61ddc610
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
f458f565af
Merge pull request #5292 from OgnjenFrancuski/main
Update SSL verification
2024-08-23 20:42:35 -07:00
Krrish Dholakia
3f116b25a9 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
80675b22bd 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
3c99ad19fa feat(utils.py): support global vertex ai safety settings param 2024-08-21 17:37:50 -07:00
Ognjen Francuski
765e020e75 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
cbdaecb5a8 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
42bd5de7c0 feat allow controlling logged tags on langfuse 2024-08-13 12:24:01 -07:00
Krrish Dholakia
fdd9a07051 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
ce9af1e1df refactor prometheus to be a customLogger class 2024-08-10 09:28:46 -07:00
Ishaan Jaff
43ff70348d init bedrock_tool_name_mappings 2024-08-09 17:09:19 -07:00
Krrish Dholakia
5da4c27e8d 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
baf01b47d8
Merge branch 'main' into litellm_personal_user_budgets 2024-08-07 19:59:50 -07:00
Krrish Dholakia
ec0b511119 fix: use more descriptive flag 2024-08-07 18:59:46 -07:00
Krrish Dholakia
2dd27a4e12 feat(utils.py): support validating json schema client-side if user opts in 2024-08-06 19:35:33 -07:00
Krrish Dholakia
5f6f1bdad4 fix(__init__.py): bump default allowed fails 2024-08-05 16:50:26 -07:00
Krrish Dholakia
936640948d fix: bump default allowed_fails + reduce default db pool limit
Fixes issues with running proxy server in production
2024-08-05 15:07:46 -07:00