Commit graph

18211 commits

Author SHA1 Message Date
Ishaan Jaff
8037d94b7b critical fix - call connect on prisma client when running setup 2024-11-01 17:54:12 +05:30
Ishaan Jaff
1bb8b8bed4 fix test_proxy_server_prisma_setup 2024-11-01 17:53:50 +05:30
Ishaan Jaff
8c9dfd5f69 fix getting response cost 2024-11-01 10:45:37 +05:30
Ishaan Jaff
e7ab928c33 fix kwargs.get("response_cost") 2024-11-01 10:45:23 +05:30
Ishaan Jaff
9c1270fa0e fix use standard logging payload for getting response cost 2024-11-01 10:45:12 +05:30
Ishaan Jaff
9647c6158e fix use failing_model as cache key for failed_tracking_alert 2024-11-01 10:44:55 +05:30
Ishaan Jaff
7b2b8d32ce fix only apply vertex $schema fixes 2024-11-01 10:43:06 +05:30
Ishaan Jaff
c5f7182547 add tests for $schema vertex 2024-11-01 10:37:42 +05:30
vibhanshu-ob
134bd2cebb
Update utils.py (#6468)
Fixed missing keys
2024-10-29 09:06:23 -07:00
Xingyao Wang
e16f780b7c
Add azure/gpt-4o-mini-2024-07-18 to model_prices_and_context_window.json (#6477) 2024-10-29 09:02:42 -07:00
Ishaan Jaff
e99f2cb0ae bump: version 1.51.0 → 1.51.1 2024-10-29 21:29:44 +05:30
Ishaan Jaff
f05bdd4074
(fix) PrometheusServicesLogger _get_metric should return metric in Registry (#6486)
* fix logging DB fails on prometheus

* unit testing log to otel wrapper

* unit testing for service logger + prometheus

* use LATENCY buckets for service logging

* fix service logging

* fix _get_metric in prom services logger

* add clear doc string

* unit testing for prom service logger
2024-10-29 21:29:19 +05:30
Ishaan Jaff
8e19a31d36
(fix) proxy - fix when STORE_MODEL_IN_DB should be set (#6492)
* set store_model_in_db at the top

* correctly use store_model_in_db global
2024-10-29 21:28:14 +05:30
Ishaan Jaff
441adad3ae
(router_strategy/) ensure all async functions use async cache methods (#6489)
* fix router strat

* use async set / get cache in router_strategy

* add coverage for router strategy

* fix imports

* fix batch_get_cache

* use async methods for least busy

* fix least busy use async methods

* fix test_dual_cache_increment

* test async_get_available_deployment when routing_strategy="least-busy"
2024-10-29 21:07:17 +05:30
Ishaan Jaff
f9ba74ef87 docs clarify vertex vs gemini 2024-10-29 13:14:26 +05:30
Ishaan Jaff
69b1bc1f1e
(fix) Prometheus - Log Postgres DB latency, status on prometheus (#6484)
* fix logging DB fails on prometheus

* unit testing log to otel wrapper

* unit testing for service logger + prometheus

* use LATENCY buckets for service logging

* fix service logging
2024-10-29 12:17:35 +05:30
Krish Dholakia
4f8a3fd4cf
redis otel tracing + async support for latency routing (#6452)
* docs(exception_mapping.md): add missing exception types

Fixes https://github.com/Aider-AI/aider/issues/2120#issuecomment-2438971183

* fix(main.py): register custom model pricing with specific key

Ensure custom model pricing is registered to the specific model+provider key combination

* test: make testing more robust for custom pricing

* fix(redis_cache.py): instrument otel logging for sync redis calls

ensures complete coverage for all redis cache calls

* refactor: pass parent_otel_span for redis caching calls in router

allows for more observability into what calls are causing latency issues

* test: update tests with new params

* refactor: ensure e2e otel tracing for router

* refactor(router.py): add more otel tracing acrosss router

catch all latency issues for router requests

* fix: fix linting error

* fix(router.py): fix linting error

* fix: fix test

* test: fix tests

* fix(dual_cache.py): pass ttl to redis cache

* fix: fix param
2024-10-28 21:52:12 -07:00
Ishaan Jaff
d9e7818e6b
(Testing) Add unit testing for DualCache - ensure in memory cache is used when expected (#6471)
* test test_dual_cache_get_set

* unit testing for dual cache

* fix async_set_cache_sadd

* test_dual_cache_local_only
2024-10-29 08:42:57 +05:30
Krish Dholakia
70111a7abd
Litellm dev 10 26 2024 (#6472)
* docs(exception_mapping.md): add missing exception types

Fixes https://github.com/Aider-AI/aider/issues/2120#issuecomment-2438971183

* fix(main.py): register custom model pricing with specific key

Ensure custom model pricing is registered to the specific model+provider key combination

* test: make testing more robust for custom pricing

* fix(redis_cache.py): instrument otel logging for sync redis calls

ensures complete coverage for all redis cache calls
2024-10-28 15:05:43 -07:00
Krish Dholakia
f44ab00de2
LiteLLM Minor Fixes & Improvements (10/24/2024) (#6441)
* fix(azure.py): handle /openai/deployment in azure api base

* fix(factory.py): fix faulty anthropic tool result translation check

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

* fix(gpt_transformation.py): add support for parallel_tool_calls to azure

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

* fix(factory.py): support anthropic prompt caching for tool results

* fix(vertex_ai/common_utils): don't pop non-null required field

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

* feat(vertex_ai.py): support code_execution tool call for vertex ai + gemini

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

* build(model_prices_and_context_window.json): Add 'supports_assistant_prefill' for bedrock claude-3-5-sonnet v2 models

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

* fix(types/utils.py): fix linting

* test: update test to include required fields

* test: fix test

* test: handle flaky test

* test: remove e2e test - hitting gemini rate limits
2024-10-28 15:05:20 -07:00
Ishaan Jaff
828631d6fc
add pricing for amazon.titan-embed-image-v1 (#6444) 2024-10-28 22:01:48 +05:30
Ishaan Jaff
030ece8c3f
(Feat) New Logging integration - add Datadog LLM Observability support (#6449)
* add type for dd llm obs request ob

* working dd llm obs

* datadog use well defined type

* clean up

* unit test test_create_llm_obs_payload

* fix linting

* add datadog_llm_observability

* add datadog_llm_observability

* docs DD LLM obs

* run testing again

* document DD_ENV

* test_create_llm_obs_payload
2024-10-28 22:01:32 +05:30
Ishaan Jaff
151991c66d
(testing) increase prometheus.py test coverage to 90% (#6466)
* testing for failure events prometheus

* set set_llm_deployment_failure_metrics

* test_async_post_call_failure_hook

* unit testing for all prometheus functions

* fix linting
2024-10-28 18:08:05 +04:00
Ishaan Jaff
fb9fb3467d
(UI) Delete Internal Users on Admin UI (#6442)
* add /user/delete call

* ui show modal asking if you want to delete user

* fix delete user modal
2024-10-26 11:41:37 +04:00
Ishaan Jaff
b3141e1a5f
Merge pull request #6433 from BerriAI/litellm_fix_audit_logs
(proxy audit logs) fix serialization error on audit logs
2024-10-26 10:01:01 +04:00
Krish Dholakia
c03e5da41f
LiteLLM Minor Fixes & Improvements (10/24/2024) (#6421)
* fix(utils.py): support passing dynamic api base to validate_environment

Returns True if just api base is required and api base is passed

* fix(litellm_pre_call_utils.py): feature flag sending client headers to llm api

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

* fix(anthropic/chat/transformation.py): return correct error message

* fix(http_handler.py): add error response text in places where we expect it

* fix(factory.py): handle base case of no non-system messages to bedrock

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

* feat(cohere/embed): Support cohere image embeddings

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

* fix(__init__.py): fix linting error

* docs(supported_embedding.md): add image embedding example to docs

* feat(cohere/embed): use cohere embedding returned usage for cost calc

* build(model_prices_and_context_window.json): add embed-english-v3.0 details (image cost + 'supports_image_input' flag)

* fix(cohere_transformation.py): fix linting error

* test(test_proxy_server.py): cleanup test

* test: cleanup test

* fix: fix linting errors
2024-10-25 15:55:56 -07:00
Ishaan Jaff
38708a355a bump: version 1.50.4 → 1.51.0 2024-10-25 23:39:15 +04:00
Ishaan Jaff
b8d91b3f41 ui new build 2024-10-25 23:38:54 +04:00
Ishaan Jaff
81157aa135 fix linting 2024-10-25 18:43:00 +04:00
Ishaan Jaff
6c21d09f1a
Merge pull request #6430 from BerriAI/litellm_allow_internal_user_to_regen_tokens
(admin ui / auth fix) Allow internal user to call /key/{token}/regenerate
2024-10-25 18:27:11 +04:00
Ishaan Jaff
dbf8b8d834 fix type error 2024-10-25 18:23:40 +04:00
Ishaan Jaff
6f1c06f7ae fix test audit logs 2024-10-25 18:21:17 +04:00
Ishaan Jaff
a047fd190e
Merge pull request #6436 from BerriAI/litellm_code_cov_2
Code cov - add checks for patch and overall repo
2024-10-25 17:34:21 +04:00
Ishaan Jaff
8cf0191cf4 unit testing test_create_audit_log_in_db 2024-10-25 17:28:37 +04:00
Ishaan Jaff
c27555677e fix code quality 2024-10-25 16:50:24 +04:00
Ishaan Jaff
eb24ce25ea fix create_audit_log_for_update 2024-10-25 16:48:25 +04:00
Ishaan Jaff
61e28ebb3e fix StandardLoggingMetadata with user_api_key_org_id 2024-10-25 16:47:35 +04:00
Ishaan Jaff
b0bf182db9 fix LitellmTableNames type 2024-10-25 16:47:17 +04:00
Ishaan Jaff
ab15028850 use separate file for create_audit_log_for_update 2024-10-25 13:31:02 +04:00
Ishaan Jaff
646f4c4524 add unit testing for non_proxy_admin_allowed_routes_check 2024-10-25 13:04:37 +04:00
Ishaan Jaff
7c4c3a2ced fix typing on StandardLoggingMetadata 2024-10-25 10:55:54 +04:00
Ishaan Jaff
5485a2a52f
Merge pull request #6429 from BerriAI/litellm_ui_show_created_at_for_key
(admin ui) - show created_at for virtual keys
2024-10-25 10:50:38 +04:00
Ishaan Jaff
99c721136b fix RouteChecks test 2024-10-25 10:48:00 +04:00
Ishaan Jaff
7db8d8b285 unit test route checks 2024-10-25 10:44:26 +04:00
Ishaan Jaff
c42ec81b8d fix name of tests on config 2024-10-25 10:44:14 +04:00
Ishaan Jaff
574f07d782 test_is_ui_route_allowed 2024-10-25 10:37:11 +04:00
Ishaan Jaff
cdb94ffe16 use helper for _route_matches_pattern 2024-10-25 10:31:21 +04:00
Ishaan Jaff
2e0f501b56 use static methods for Routechecks 2024-10-25 10:26:43 +04:00
Ishaan Jaff
c4cab8812a add key/{token_id}/regenerate to internal user routes 2024-10-25 10:24:40 +04:00
Ishaan Jaff
2d2a2c35d8 ui show created at date 2024-10-25 09:23:08 +04:00