Commit graph

1850 commits

Author SHA1 Message Date
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
ca4e746545 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
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
9f9b6e81a7 add VertexAITextEmbeddingConfig 2024-08-30 12:53:43 -07:00
Ishaan Jaff
0866deea97 Merge pull request #5439 from BerriAI/litellm_use_correct_ai21_pricing
[Fix] Use correct Vertex AI AI21 Cost tracking
2024-08-30 10:49:42 -07:00
JooHo Kim
e9591bdfe9 chore: Clarify support-related Exceptions in utils.py (#5447)
Improved the clarity of Exceptions in supports_system_messages, supports_response_schema, supports_function_calling, and supports_parallel_function_calling. Previously, it was difficult to determine the cause of Exception logs due to vague messaging. Each case now includes a more specific and appropriate Exception message.
2024-08-30 08:29:05 -07:00
Krish Dholakia
321b0961b5 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
Ishaan Jaff
dbdbf3d9a2 use correct vtx ai21 pricing 2024-08-29 19:04:05 -07:00
Krish Dholakia
3e8f5009f4 fix(utils.py): correctly log streaming cache hits (#5417) (#5426)
Fixes https://github.com/BerriAI/litellm/issues/5401
2024-08-28 22:50:33 -07:00
Ishaan Jaff
5f61539e90 refactor partner models to include ai21 2024-08-27 13:35:22 -07:00
Krish Dholakia
34eb1206c6 Merge pull request #5358 from BerriAI/litellm_fix_retry_after
fix retry after - cooldown individual models based on their specific 'retry-after' header
2024-08-27 11:50:14 -07:00
Krrish Dholakia
30bf8a4c1d test: fix test 2024-08-27 10:46:57 -07:00
Krrish Dholakia
fe6ba2d025 fix: fix imports 2024-08-26 22:19:01 -07:00
Krrish Dholakia
b277086cf7 feat(vertex_ai_context_caching.py): check gemini cache, if key already exists 2024-08-26 22:19:01 -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
6ff17f1acd Merge pull request #5368 from BerriAI/litellm_vertex_function_support
feat(vertex_httpx.py): support 'functions' param for gemini google ai studio + vertex ai
2024-08-26 22:11:42 -07:00
Krrish Dholakia
cd7a9898e0 fix(utils.py): fix message replace 2024-08-26 15:43:30 -07:00
Krrish Dholakia
73f8315a77 fix(utils.py): support 'PERPLEXITY_API_KEY' in env 2024-08-26 13:59:57 -07:00
Krrish Dholakia
778b2d7fd6 fix(utils.py): fix value check 2024-08-26 12:04:56 -07:00
Krrish Dholakia
c3db2d8bbf feat(utils.py): support gemini/vertex ai streaming function param usage 2024-08-26 11:23:45 -07:00
Krish Dholakia
bc2a96b2a5 Merge branch 'main' into litellm_vertex_migration 2024-08-24 18:24:19 -07:00
Krrish Dholakia
757172e31a fix(azure.py): add response header coverage for azure models 2024-08-24 15:12:51 -07:00
Krrish Dholakia
79bfdb83cc fix(main.py): cover openai /v1/completions endpoint 2024-08-24 13:25:17 -07:00
Krrish Dholakia
27a5cd12e0 fix(utils.py): correctly re-raise the headers from an exception, if present
Fixes issue where retry after on router was not using azure / openai numbers
2024-08-24 12:30:30 -07:00
Krrish Dholakia
e51ac377cc fix(utils.py): support passing response_format for together ai calls 2024-08-23 21:31:59 -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
Krrish Dholakia
425d8711b3 fix(utils.py): only filter additional properties if gemini/vertex ai 2024-08-23 14:22:59 -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
2a6aa6da7a fix(utils.py): handle additionalProperties is False for vertex ai / gemini calls
Fixes https://github.com/BerriAI/litellm/issues/5338

Also adds together ai json mode support
2024-08-23 09:21:32 -07:00
Ishaan Jaff
2864d16fa1 Merge branch 'main' into litellm_allow_using_azure_ad_token_auth 2024-08-22 18:21:24 -07:00
Krrish Dholakia
2c5fc1ffb4 docs(utils.py): cleanup docstring 2024-08-22 11:05:25 -07:00
Krrish Dholakia
900d8ecbf0 feat(factory.py): enable 'user_continue_message' for interweaving user/assistant messages when provider requires it
allows bedrock to be used with autogen
2024-08-22 11:03:33 -07:00
Ishaan Jaff
26354fbb9d add azure_ad_token_provider as all litellm params 2024-08-22 10:59:18 -07:00
Krrish Dholakia
8f306f8e41 fix(cohere_chat.py): support passing 'extra_headers'
Fixes https://github.com/BerriAI/litellm/issues/4709
2024-08-22 10:17:36 -07:00
Krrish Dholakia
d87e8f5b30 feat(utils.py): support global vertex ai safety settings param 2024-08-21 17:37:50 -07:00
Ishaan Jaff
e4fe5924a5 Merge pull request #5326 from BerriAI/litellm_Add_vertex_multimodal_embedding
[Feat] add vertex multimodal embedding support
2024-08-21 17:06:43 -07:00
Ishaan Jaff
0435101df4 add multi modal vtx embedding 2024-08-21 15:05:59 -07:00
Krrish Dholakia
ac5c6c8751 fix(litellm_pre_call_utils.py): handle dynamic keys via api correctly 2024-08-21 13:37:21 -07:00
Ishaan Jaff
a34aeafdb5 Merge pull request #5018 from haadirakhangi/main
Qdrant Semantic Caching
2024-08-21 08:50:43 -07:00
Krrish Dholakia
a06d9d44a9 fix(utils.py): support openrouter streaming
Fixes https://github.com/BerriAI/litellm/issues/5080
2024-08-21 08:48:58 -07:00
Krrish Dholakia
0091f64ff1 fix(utils.py): ensure consistent cost calc b/w returned header and logged object 2024-08-20 19:01:20 -07:00
Krish Dholakia
e49e454929 Merge pull request #5287 from BerriAI/litellm_fix_response_cost_cal
fix(cost_calculator.py): only override base model if custom pricing is set
2024-08-20 11:42:48 -07:00
Krish Dholakia
969b724615 Merge pull request #5296 from BerriAI/litellm_azure_json_schema_support
feat(azure.py): support 'json_schema' for older models
2024-08-20 11:41:38 -07:00
Krrish Dholakia
cf1a1605a6 feat(cost_calculator.py): only override base model if custom pricing is set 2024-08-19 16:05:49 -07:00
Krrish Dholakia
c5d1899940 feat(Support-pass-through-for-bedrock-endpoints): Allows pass-through support for bedrock endpoints 2024-08-17 17:57:43 -07:00
Krrish Dholakia
afcebac8ed feat(azure.py): support 'json_schema' for older models
Converts the json schema input to a tool call, allows the call to still work on older azure models
2024-08-17 16:31:13 -07:00
Krish Dholakia
0916197c9d Merge pull request #5244 from BerriAI/litellm_better_error_logging_sentry
refactor: replace .error() with .exception() logging for better debugging on sentry
2024-08-16 19:16:20 -07:00
Krish Dholakia
1844e01133 Merge pull request #5251 from Manouchehri/oidc-improvements-20240816
(oidc): Add support for loading tokens via a file, env var, and path in env var
2024-08-16 19:15:31 -07:00