Commit graph

44 commits

Author SHA1 Message Date
Krish Dholakia
bd17424c4b
LiteLLM Minor Fixes & Improvements (09/26/2024) (#5925) (#5937)
* LiteLLM Minor Fixes & Improvements (09/26/2024)  (#5925)

* fix(litellm_logging.py): don't initialize prometheus_logger if non premium user

Prevents bad error messages in logs

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

* Add Support for Custom Providers in Vision and Function Call Utils (#5688)

* Add Support for Custom Providers in Vision and Function Call Utils Lookup

* Remove parallel function call due to missing model info param

* Add Unit Tests for Vision and Function Call Changes

* fix-#5920: set header value to string to fix "'int' object has no att… (#5922)

* LiteLLM Minor Fixes & Improvements (09/24/2024) (#5880)

* LiteLLM Minor Fixes & Improvements (09/23/2024)  (#5842)

* feat(auth_utils.py): enable admin to allow client-side credentials to be passed

Makes it easier for devs to experiment with finetuned fireworks ai models

* feat(router.py): allow setting configurable_clientside_auth_params for a model

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

* build(model_prices_and_context_window.json): fix anthropic claude-3-5-sonnet max output token limit

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

* fix(azure_ai/): support content list for azure ai

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

* fix(litellm_logging.py): always set saved_cache_cost

Set to 0 by default

* fix(fireworks_ai/cost_calculator.py): add fireworks ai default pricing

handles calling 405b+ size models

* fix(slack_alerting.py): fix error alerting for failed spend tracking

Fixes regression with slack alerting error monitoring

* fix(vertex_and_google_ai_studio_gemini.py): handle gemini no candidates in streaming chunk error

* docs(bedrock.md): add llama3-1 models

* test: fix tests

* fix(azure_ai/chat): fix transformation for azure ai calls

* feat(azure_ai/embed): Add azure ai embeddings support

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

* fix(azure_ai/embed): enable async embedding

* feat(azure_ai/embed): support azure ai multimodal embeddings

* fix(azure_ai/embed): support async multi modal embeddings

* feat(together_ai/embed): support together ai embedding calls

* feat(rerank/main.py): log source documents for rerank endpoints to langfuse

improves rerank endpoint logging

* fix(langfuse.py): support logging `/audio/speech` input to langfuse

* test(test_embedding.py): fix test

* test(test_completion_cost.py): fix helper util

* fix-#5920: set header value to string to fix "'int' object has no attribute 'encode'"

---------

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>

* Revert "fix-#5920: set header value to string to fix "'int' object has no att…" (#5926)

This reverts commit a554ae2695.

* build(model_prices_and_context_window.json): add azure ai cohere rerank model pricing

Enables cost tracking for azure ai cohere rerank models

* fix(litellm_logging.py): fix debug log to be clearer

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

* test(test_utils.py): fix test name

* fix(azure_ai/cost_calculator.py): support cost tracking for azure ai rerank models

* fix(azure_ai): fix azure ai base model cost tracking for rerank endpoints

* fix(converse_handler.py): support new llama 3-2 models

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

* fix(litellm_logging.py): ensure response is redacted for standard message logging

Fixes https://github.com/BerriAI/litellm/issues/5890#issuecomment-2378242360

* fix(cost_calculator.py): use 'get_model_info' for cohere rerank cost calculation

allows user to set custom cost for model

* fix(config.yml): fix docker hub auht

* build(config.yml): add docker auth to all tests

* fix(db/create_views.py): fix linting error

* fix(main.py): fix circular import

* fix(azure_ai/__init__.py): fix circular import

* fix(main.py): fix import

* fix: fix linting errors

* test: fix test

* fix(proxy_server.py): pass premium user value on startup

used for prometheus init

---------

Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
Co-authored-by: bravomark <62681807+bravomark@users.noreply.github.com>

* handle streaming for azure ai studio error

* [Perf Proxy] parallel request limiter - use one cache update call (#5932)

* fix parallel request limiter - use one cache update call

* ci/cd run again

* run ci/cd again

* use docker username password

* fix config.yml

* fix config

* fix config

* fix config.yml

* ci/cd run again

* use correct typing for batch set cache

* fix async_set_cache_pipeline

* fix only check user id tpm / rpm limits when limits set

* fix test_openai_azure_embedding_with_oidc_and_cf

* test: fix test

* test(test_rerank.py): fix test

---------

Co-authored-by: Cole Murray <colemurray.cs@gmail.com>
Co-authored-by: bravomark <62681807+bravomark@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
2024-09-27 17:54:13 -07:00
Krish Dholakia
16c0307eab
LiteLLM Minor Fixes & Improvements (09/24/2024) (#5880)
* LiteLLM Minor Fixes & Improvements (09/23/2024)  (#5842)

* feat(auth_utils.py): enable admin to allow client-side credentials to be passed

Makes it easier for devs to experiment with finetuned fireworks ai models

* feat(router.py): allow setting configurable_clientside_auth_params for a model

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

* build(model_prices_and_context_window.json): fix anthropic claude-3-5-sonnet max output token limit

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

* fix(azure_ai/): support content list for azure ai

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

* fix(litellm_logging.py): always set saved_cache_cost

Set to 0 by default

* fix(fireworks_ai/cost_calculator.py): add fireworks ai default pricing

handles calling 405b+ size models

* fix(slack_alerting.py): fix error alerting for failed spend tracking

Fixes regression with slack alerting error monitoring

* fix(vertex_and_google_ai_studio_gemini.py): handle gemini no candidates in streaming chunk error

* docs(bedrock.md): add llama3-1 models

* test: fix tests

* fix(azure_ai/chat): fix transformation for azure ai calls

* feat(azure_ai/embed): Add azure ai embeddings support

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

* fix(azure_ai/embed): enable async embedding

* feat(azure_ai/embed): support azure ai multimodal embeddings

* fix(azure_ai/embed): support async multi modal embeddings

* feat(together_ai/embed): support together ai embedding calls

* feat(rerank/main.py): log source documents for rerank endpoints to langfuse

improves rerank endpoint logging

* fix(langfuse.py): support logging `/audio/speech` input to langfuse

* test(test_embedding.py): fix test

* test(test_completion_cost.py): fix helper util
2024-09-25 22:11:57 -07:00
Krish Dholakia
6051086322
test: replace gpt-3.5-turbo-0613 (deprecated model) (#5794) 2024-09-19 15:39:37 -07:00
Krrish Dholakia
1553f7fa48 fix(types/utils.py): handle null completion tokens
Fixes https://github.com/BerriAI/litellm/issues/5096
2024-08-10 09:23:03 -07:00
Krrish Dholakia
ae4bcd8a41 fix(utils.py): fix trim_messages to handle tool calling
Fixes https://github.com/BerriAI/litellm/issues/4931
2024-07-29 13:04:41 -07:00
Krrish Dholakia
1ba3fcc3fb feat(utils.py): accept 'api_key' as param for validate_environment
Closes https://github.com/BerriAI/litellm/issues/4375
2024-07-11 12:02:23 -07:00
Krrish Dholakia
5718d1e205 fix(utils.py): new helper function to check if provider/model supports 'response_schema' param 2024-06-29 12:40:29 -07:00
Krrish Dholakia
ca04244a0a fix(utils.py): correctly raise openrouter error 2024-06-28 21:50:21 -07:00
Krrish Dholakia
2584120012 refactor(litellm_logging.py): refactors how slack_alerting generates langfuse trace url
gets the url from logging object
2024-06-21 16:12:25 -07:00
Ishaan Jaff
c14b1751db test - test_get_llm_provider_ft_models 2024-06-19 16:51:51 -07:00
Krrish Dholakia
f1b0cc756b test(test_utils.py): reset env after test complete 2024-06-17 20:33:39 -07:00
Krrish Dholakia
b886812787 fix(__init__.py): add gemini models to all model list
Fixes https://github.com/BerriAI/litellm/issues/4240
2024-06-17 10:54:28 -07:00
Krrish Dholakia
6a0b71c1eb test(test_utils.py): fix import 2024-06-15 14:47:46 -07:00
Krrish Dholakia
d8acda9f39 fix(proxy/utils.py): fix reset monthly budget
fix to reset at the same time each month (not at start of month)
2024-06-14 14:41:06 -07:00
Krrish Dholakia
f65752c18b feat(proxy/utils.py): allow budget duration in months
Closes https://github.com/BerriAI/litellm/issues/4042
2024-06-13 16:52:17 -07:00
Ishaan Jaff
d274cfeb3f test test_redact_msgs_from_logs 2024-06-13 13:49:23 -07:00
James Braza
ef6e920161 Added handling of unmapped provider, with test 2024-06-11 18:34:10 -07:00
James Braza
8be37bee04 Added simple test of get_supported_openai_params with no custom provider 2024-06-11 18:18:21 -07:00
Krrish Dholakia
7523f803d2 fix(utils.py): support get_max_tokens() call with same model_name as completion
Closes https://github.com/BerriAI/litellm/issues/3921
2024-05-31 21:37:51 -07:00
Christian Privitelli
2d43153efa include methods in init import, add test, fix encode/decode param ordering 2024-05-02 15:49:22 +10:00
Chen Wang
ebc889d77a
Use max_input_token for trim_messages 2024-04-16 13:36:25 +01:00
Ishaan Jaff
c8832489d6 test groq tool calling 2024-04-15 08:41:53 -07:00
Mikhail Khludnev
381858139e utils.validate_environment to handle OLLAMA_API_BASE env 2024-03-02 13:41:59 +03:00
ishaan-jaff
01f1dfdba3 (test) supports_function_calling 2024-02-28 17:51:34 -08:00
ishaan-jaff
56d20cd073 (test) supports_function_calling 2024-02-28 17:36:15 -08:00
ishaan-jaff
73f60b7315 (test) stream chunk builder - azure prompt tokens 2023-12-29 15:45:41 +05:30
ishaan-jaff
b1077ebc38 (test) test_token_counter_azure 2023-12-29 15:37:46 +05:30
ishaan-jaff
4a028d012a (test) token_counter - prompt tokens == tokens from API 2023-12-29 15:15:39 +05:30
Krrish Dholakia
4905929de3 refactor: add black formatting 2023-12-25 14:11:20 +05:30
Krrish Dholakia
2c1103247d test: fix flaky test 2023-12-01 15:46:39 -08:00
ishaan-jaff
7a3607e00c (test) token_counter 2023-11-13 08:02:46 -08:00
ishaan-jaff
e5ec4a92fe (test) add test token counter 2023-11-13 07:42:08 -08:00
Duc Pham
eeac3954d5 Reverted error while refactoring 2023-11-10 01:35:41 +07:00
Duc Pham
07e8cf1d9a Improved trimming logic and OpenAI token counter 2023-11-10 01:26:13 +07:00
Krrish Dholakia
f967d6af5e fix(init.py): fix linting errors 2023-10-24 15:54:21 -07:00
ishaan-jaff
7848f1b5b7 (feat) new function_to_dict litellm.util 2023-10-14 18:26:15 -07:00
Krrish Dholakia
076affbff2 fix llama index validate environment error 2023-09-26 17:53:22 -07:00
ishaan-jaff
e6d48d91ce bump version + check_valid_key 2023-09-12 11:56:04 -07:00
ishaan-jaff
33f0da2d69 update testing key 2023-09-12 11:50:30 -07:00
ishaan-jaff
ff36b9c6da add test_valid_key to utils 2023-09-12 11:45:55 -07:00
ishaan-jaff
a48cb49820 add test for test_get_valid_models 2023-09-12 11:29:18 -07:00
ishaan-jaff
dda87a55ff rename safe_messages to trim_messages 2023-09-11 18:54:18 -07:00
ishaan-jaff
be5a92c40a add safe_message trimmer 2023-09-11 17:58:37 -07:00
ishaan-jaff
bcb89dcf4a add test cases for token trimmer 2023-09-11 17:58:37 -07:00