Commit graph

73 commits

Author SHA1 Message Date
Krrish Dholakia
3560f0ef2c 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
0b30e212da
LiteLLM Minor Fixes & Improvements (09/27/2024) (#5938)
* fix(langfuse.py): prevent double logging requester metadata

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

* build(model_prices_and_context_window.json): add mistral pixtral cost tracking

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

* 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

* fix(groq/chat/transformation.py): Fixes https://github.com/BerriAI/litellm/issues/5839

* feat(anthropic/chat.py): return 'retry-after' headers from anthropic

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

* feat: raise validation error if message has tool calls without passing `tools` param for anthropic/bedrock

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

* [Feature]#5940, add max_workers parameter for the batch_completion (#5947)

* handle streaming for azure ai studio error

* bump: version 1.48.2 → 1.48.3

* docs(data_security.md): add legal/compliance faq's

Make it easier for companies to use litellm

* docs: resolve imports

* [Feature]#5940, add max_workers parameter for the batch_completion method

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: josearangos <josearangos@Joses-MacBook-Pro.local>

* fix(converse_transformation.py): fix default message value

* fix(utils.py): fix get_model_info to handle finetuned models

Fixes issue for standard logging payloads, where model_map_value was null for finetuned openai models

* fix(litellm_pre_call_utils.py): add debug statement for data sent after updating with team/key callbacks

* fix: fix linting errors

* fix(anthropic/chat/handler.py): fix cache creation input tokens

* fix(exception_mapping_utils.py): fix missing imports

* fix(anthropic/chat/handler.py): fix usage block translation

* test: fix test

* test: fix tests

* style(types/utils.py): trigger new build

* test: fix test

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Jose Alberto Arango Sanchez <jose.arangos@udea.edu.co>
Co-authored-by: josearangos <josearangos@Joses-MacBook-Pro.local>
2024-09-27 22:52:57 -07:00
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
98c335acd0
LiteLLM Minor Fixes & Improvements (09/17/2024) (#5742)
* fix(proxy_server.py): use default azure credentials to support azure non-client secret kms

* fix(langsmith.py): raise error if credentials missing

* feat(langsmith.py): support error logging for langsmith + standard logging payload

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

* Fix hardcoding of schema in view check (#5749)

* fix - deal with case when check view exists returns None (#5740)

* Revert "fix - deal with case when check view exists returns None (#5740)" (#5741)

This reverts commit 535228159b.

* test(test_router_debug_logs.py): move to mock response

* Fix hardcoding of schema

---------

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

* fix(proxy_server.py): allow admin to disable ui via `DISABLE_ADMIN_UI` flag

* fix(router.py): fix default model name value

Fixes 55db19a1e4 (r1763712148)

* fix(utils.py): fix unbound variable error

* feat(rerank/main.py): add azure ai rerank endpoints

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

* feat(secret_detection.py): Allow configuring secret detection params

Allows admin to control what plugins to run for secret detection. Prevents overzealous secret detection.

* docs(secret_detection.md): add secret detection guardrail docs

* fix: fix linting errors

* fix - deal with case when check view exists returns None (#5740)

* Revert "fix - deal with case when check view exists returns None (#5740)" (#5741)

This reverts commit 535228159b.

* Litellm fix router testing (#5748)

* test: fix testing - azure changed content policy error logic

* test: fix tests to use mock responses

* test(test_image_generation.py): handle api instability

* test(test_image_generation.py): handle azure api instability

* fix(utils.py): fix unbounded variable error

* fix(utils.py): fix unbounded variable error

* test: refactor test to use mock response

* test: mark flaky azure tests

* Bump next from 14.1.1 to 14.2.10 in /ui/litellm-dashboard (#5753)

Bumps [next](https://github.com/vercel/next.js) from 14.1.1 to 14.2.10.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v14.1.1...v14.2.10)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [Fix] o1-mini causes pydantic warnings on `reasoning_tokens`  (#5754)

* add requester_metadata in standard logging payload

* log requester_metadata in metadata

* use StandardLoggingPayload for logging

* docs StandardLoggingPayload

* fix import

* include standard logging object in failure

* add test for requester metadata

* handle completion_tokens_details

* add test for completion_tokens_details

* [Feat-Proxy-DataDog] Log Redis, Postgres Failure events on DataDog  (#5750)

* dd - start tracking redis status on dd

* add async_service_succes_hook / failure hook in custom logger

* add async_service_failure_hook

* log service failures on dd

* fix import error

* add test for redis errors / warning

* [Fix] Router/ Proxy - Tag Based routing, raise correct error when no deployments found and tag filtering is on  (#5745)

* fix tag routing - raise correct error when no model with tag based routing

* fix error string from tag based routing

* test router tag based routing

* raise 401 error when no tags avialable for deploymen

* linting fix

* [Feat] Log Request metadata on gcs bucket logging (#5743)

* add requester_metadata in standard logging payload

* log requester_metadata in metadata

* use StandardLoggingPayload for logging

* docs StandardLoggingPayload

* fix import

* include standard logging object in failure

* add test for requester metadata

* fix(litellm_logging.py): fix logging message

* fix(rerank_api/main.py): fix linting errors

* fix(custom_guardrails.py): maintain backwards compatibility for older guardrails

* fix(rerank_api/main.py): fix cost tracking for rerank endpoints

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: steffen-sbt <148480574+steffen-sbt@users.noreply.github.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-17 23:00:04 -07:00
Ishaan Jaff
2efdd2a6a4 mark test as flaky 2024-09-14 19:32:22 -07:00
Ishaan Jaff
9a3873b9ed mark flaky test as flaky 2024-08-31 15:02:56 -07:00
Krish Dholakia
dd7b008161
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
Krish Dholakia
8ce1e49fbe
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
Krrish Dholakia
67eb58d9f8 test(test_custom_callback_input.py): skip flaky ci/cd test 2024-08-22 09:19:10 -07:00
Krrish Dholakia
cf4574dd65 test(test_custom_callback_input.py): fix test 2024-08-22 08:54:59 -07:00
Krrish Dholakia
8a05ce77e9 feat(litellm_logging.py): add 'saved_cache_cost' to standard logging payload (s3) 2024-08-21 16:58:07 -07:00
Krrish Dholakia
0ce476a7f6 test(test_custom_callback.py): add test for message redaction to standard logging object 2024-08-19 17:06:41 -07:00
Krrish Dholakia
a92dcdd2d6 fix(litellm_logging.py): fix price information logging to s3 2024-08-16 16:42:38 -07:00
Krrish Dholakia
178139f18d feat(litellm_logging.py): support logging model price information to s3 logs 2024-08-16 16:21:34 -07:00
Krrish Dholakia
f6dba82882 feat(litellm_logging.py): cleanup payload + add response cost to logged payload 2024-08-15 17:53:25 -07:00
Krrish Dholakia
cda50e5d47 fix(s3.py): fix s3 logging payload to have valid json values
Previously pydantic objects were being stringified, making them unparsable
2024-08-15 17:09:02 -07:00
Krrish Dholakia
a26b23a3f4 fix(litellm_logging.py): fix calling success callback w/ stream_options true
Fixes https://github.com/BerriAI/litellm/issues/5118
2024-08-09 18:20:42 -07:00
Krish Dholakia
e6963217ba
Merge branch 'main' into litellm_parallel_requests 2024-07-24 19:25:56 -07:00
Krrish Dholakia
9d10881f3d test: re-run ci/cd 2024-07-23 07:55:42 -07:00
Krrish Dholakia
1a83935aa4 fix(proxy/utils.py): add stronger typing for litellm params in failure call logging 2024-07-22 21:31:39 -07:00
Krrish Dholakia
a4b0740c4a fix(test_custom_callback_input.py): fix unit test for embedding logging 2024-07-15 21:47:05 -07:00
Krrish Dholakia
d136f2b8a7 fix(litellm_logging.py): fix circular reference 2024-07-15 21:28:33 -07:00
Ishaan Jaff
4aa98dcbe9 test_amazing_sync_embedding 2024-07-15 20:53:13 -07:00
Ishaan Jaff
4baa48ba4b fix test_sync_embedding 2024-07-15 20:51:29 -07:00
Krrish Dholakia
f5b3cc6c02 fix(litellm_logging.py): fix condition check
Fixes https://github.com/BerriAI/litellm/issues/4633
2024-07-12 09:22:19 -07:00
Krrish Dholakia
beddb58852 test(test_custom_callback_input.py): fix custom callback input test 2024-06-07 16:13:30 -07:00
Krrish Dholakia
f73b6033fd fix(test_custom_callbacks_input.py): unit tests for 'turn_off_message_logging'
ensure no raw request is logged either
2024-06-07 15:39:15 -07:00
Krrish Dholakia
2b3da449c8 feat(lowest_latency.py): route by time to first token, for streaming requests (if available)
Closes https://github.com/BerriAI/litellm/issues/3574
2024-05-21 13:08:17 -07:00
Krrish Dholakia
21f2ba6f1f fix(bedrock_httpx.py): logging fixes 2024-05-16 23:20:51 -07:00
Krrish Dholakia
29aefaa7d7 fix(utils.py): fix default values 2024-05-01 22:24:37 -07:00
Krrish Dholakia
6234982fd9 test(test_custom_callback_input.py): fix assert 2024-04-06 18:48:33 -07:00
Krrish Dholakia
6110d32b1c feat(proxy/utils.py): return api base for request hanging alerts 2024-04-06 15:58:53 -07:00
Ishaan Jaff
1ba1c84d83 skip vertex test for this PR 2024-04-05 09:06:15 -07:00
Krrish Dholakia
0d949d71ab fix(main.py): support text completion input being a list of strings
addresses - https://github.com/BerriAI/litellm/issues/2792, https://github.com/BerriAI/litellm/issues/2777
2024-04-02 08:50:16 -07:00
Krrish Dholakia
364526d0bc test: fix test 2024-03-30 20:22:48 -07:00
Krrish Dholakia
bd75498913 fix(utils.py): log success event for streaming 2024-03-25 19:03:10 -07:00
Krrish Dholakia
8d2d51b625 fix(utils.py): fix model name checking 2024-03-09 18:22:26 -08:00
Krrish Dholakia
478307d4cf fix(bedrock.py): support anthropic messages api on bedrock (claude-3) 2024-03-04 17:15:47 -08:00
Krrish Dholakia
4c951d20bc test: removing aws tests - account suspended - pending their approval 2024-02-28 13:46:20 -08:00
Krrish Dholakia
a042092faa test: removing bedrock claude-v1 testing - bedrock removed this 2024-02-28 11:08:17 -08:00
Krrish Dholakia
e48fff47dd test(test_custom_callback_input.py): assert async success called only once during vertex ai streaming 2024-02-26 09:18:46 -08:00
Krrish Dholakia
2d62dee712 fix(utils.py): enable streaming cache logging 2024-02-21 21:10:58 -08:00
Krrish Dholakia
d2d9e63176 test(test_custom_callback_input.py): fix test 2024-02-21 20:32:39 -08:00
Krrish Dholakia
f8b233b653 fix(utils.py): support streaming cached response logging 2024-02-21 17:53:14 -08:00
Krrish Dholakia
9cbdbda8e4 test(test_custom_callback_input.py): fix image gen callback test 2024-02-16 16:29:26 -08:00
Krrish Dholakia
f57483ea70 fix(utils.py): support image gen logging to langfuse 2024-02-16 16:12:52 -08:00
Krish Dholakia
9ab59045a3
Merge branch 'main' into litellm_embedding_caching_updates 2024-02-03 18:08:47 -08:00
Krrish Dholakia
618d216c11 fix(openai.py): fix image gen logging 2024-01-26 21:04:06 -08:00
Krrish Dholakia
a299ac2328 fix(utils.py): enable cost tracking for image gen models on proxy 2024-01-26 20:51:13 -08:00
Krrish Dholakia
09ec6d6458 fix(utils.py): fix sagemaker async logging for sync streaming
https://github.com/BerriAI/litellm/issues/1592
2024-01-25 12:49:45 -08:00