Commit graph

45 commits

Author SHA1 Message Date
Krrish Dholakia
ea96eebe85 refactor: move all testing to top-level of repo
Closes https://github.com/BerriAI/litellm/issues/486
2024-09-28 21:08:14 -07:00
Krish Dholakia
e78b370c8b 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
ed5635e9a2 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
1a55827a0a test: replace gpt-3.5-turbo-0613 (deprecated model) (#5794) 2024-09-19 15:39:37 -07:00
Krrish Dholakia
e2249961cb 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
00dde68001 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
57584ce879 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
106f25625a 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
5bc8681412 fix(utils.py): correctly raise openrouter error 2024-06-28 21:50:21 -07:00
Krrish Dholakia
c7b06c42b7 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
ce06123417 test - test_get_llm_provider_ft_models 2024-06-19 16:51:51 -07:00
Krrish Dholakia
f47358ba1d test(test_utils.py): reset env after test complete 2024-06-17 20:33:39 -07:00
Krrish Dholakia
6482e57f56 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
bd05a0ca36 test(test_utils.py): fix import 2024-06-15 14:47:46 -07:00
Krrish Dholakia
af2aeb595d 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
417e25ae08 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
84a546e801 test test_redact_msgs_from_logs 2024-06-13 13:49:23 -07:00
James Braza
cab0e0e703 Added handling of unmapped provider, with test 2024-06-11 18:34:10 -07:00
James Braza
85b8724484 Added simple test of get_supported_openai_params with no custom provider 2024-06-11 18:18:21 -07:00
Krrish Dholakia
ecbb3c54c3 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
8b4bc4c832 include methods in init import, add test, fix encode/decode param ordering 2024-05-02 15:49:22 +10:00
Chen Wang
2567f9a3a6 Use max_input_token for trim_messages 2024-04-16 13:36:25 +01:00
Ishaan Jaff
c356173d73 test groq tool calling 2024-04-15 08:41:53 -07:00
Mikhail Khludnev
2686d0368e utils.validate_environment to handle OLLAMA_API_BASE env 2024-03-02 13:41:59 +03:00
ishaan-jaff
2ecb649302 (test) supports_function_calling 2024-02-28 17:51:34 -08:00
ishaan-jaff
86d1aabf22 (test) supports_function_calling 2024-02-28 17:36:15 -08:00
ishaan-jaff
ac19302d0d (test) stream chunk builder - azure prompt tokens 2023-12-29 15:45:41 +05:30
ishaan-jaff
95a98f5463 (test) test_token_counter_azure 2023-12-29 15:37:46 +05:30
ishaan-jaff
a20331e47a (test) token_counter - prompt tokens == tokens from API 2023-12-29 15:15:39 +05:30
Krrish Dholakia
79978c44ba refactor: add black formatting 2023-12-25 14:11:20 +05:30
Krrish Dholakia
6556f060f7 test: fix flaky test 2023-12-01 15:46:39 -08:00
ishaan-jaff
cf244fc5bf (test) token_counter 2023-11-13 08:02:46 -08:00
ishaan-jaff
ea2c029c50 (test) add test token counter 2023-11-13 07:42:08 -08:00
Duc Pham
61f2e37349 Reverted error while refactoring 2023-11-10 01:35:41 +07:00
Duc Pham
c74e6f8cdd Improved trimming logic and OpenAI token counter 2023-11-10 01:26:13 +07:00
Krrish Dholakia
743dda9724 fix(init.py): fix linting errors 2023-10-24 15:54:21 -07:00
ishaan-jaff
c0f7c7a001 (feat) new function_to_dict litellm.util 2023-10-14 18:26:15 -07:00
Krrish Dholakia
7f62b5b6e0 fix llama index validate environment error 2023-09-26 17:53:22 -07:00
ishaan-jaff
7d5f3c48c6 bump version + check_valid_key 2023-09-12 11:56:04 -07:00
ishaan-jaff
25e97882f0 update testing key 2023-09-12 11:50:30 -07:00
ishaan-jaff
78c7ad7c68 add test_valid_key to utils 2023-09-12 11:45:55 -07:00
ishaan-jaff
22fa1f6cd9 add test for test_get_valid_models 2023-09-12 11:29:18 -07:00
ishaan-jaff
9f1a8844cd rename safe_messages to trim_messages 2023-09-11 18:54:18 -07:00
ishaan-jaff
d0984d8c60 add safe_message trimmer 2023-09-11 17:58:37 -07:00
ishaan-jaff
df80e62566 add test cases for token trimmer 2023-09-11 17:58:37 -07:00