Commit graph

662 commits

Author SHA1 Message Date
Krish Dholakia
1e7e538261
LiteLLM Minor fixes + improvements (08/04/2024) (#5505)
* Minor IAM AWS OIDC Improvements (#5246)

* AWS IAM: Temporary tokens are valid across all regions after being issued, so it is wasteful to request one for each region.

* AWS IAM: Include an inline policy, to help reduce misuse of overly permissive IAM roles.

* (test_bedrock_completion.py): Ensure we are testing cross AWS region OIDC flow.

* fix(router.py): log rejected requests

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

* refactor: don't use verbose_logger.exception, if exception is raised

User might already have handling for this. But alerting systems in prod will raise this as an unhandled error.

* fix(datadog.py): support setting datadog source as an env var

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

* docs(logging.md): add dd_source to datadog docs

* fix(proxy_server.py): expose `/customer/list` endpoint for showing all customers

* (bedrock): Fix usage with Cloudflare AI Gateway, and proxies in general. (#5509)

* feat(anthropic.py): support 'cache_control' param for content when it is a string

* Revert "(bedrock): Fix usage with Cloudflare AI Gateway, and proxies in gener…" (#5519)

This reverts commit 3fac0349c2.

* refactor: ci/cd run again

---------

Co-authored-by: David Manouchehri <david.manouchehri@ai.moda>
2024-09-04 22:16:55 -07:00
Krish Dholakia
be3c7b401e
LiteLLM Minor fixes + improvements (08/03/2024) (#5488)
* fix(internal_user_endpoints.py): set budget_reset_at for /user/update

* fix(vertex_and_google_ai_studio_gemini.py): handle accumulated json

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

* fix(vertex_ai_and_gemini.py): fix assistant message function call when content is not None

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

* fix(proxy_server.py): generic state uuid for okta sso

* fix(lago.py): improve debug logs

Debugging for https://github.com/BerriAI/litellm/issues/5477

* docs(bedrock.md): add bedrock cross-region inferencing to docs

* fix(azure.py): return azure response headers on aembedding call

* feat(azure.py): return azure response headers for `/audio/transcription`

* fix(types/utils.py): standardize deepseek / anthropic prompt caching usage information

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

* docs(usage.md): add docs on litellm usage object

* test(test_completion.py): mark flaky test
2024-09-03 21:21:34 -07:00
Ishaan Jaff
1546a82f18 add sync_construct_request_headers 2024-09-03 10:36:10 -07:00
Krish Dholakia
f9e6507cd1
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
e0d81434ed
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
Ishaan Jaff
6ab601432b feat prometheus add metric for failure / model 2024-08-31 10:05:23 -07:00
Ishaan Jaff
7d746064ab add gcs bucket base 2024-08-30 10:41:39 -07:00
Krish Dholakia
8d6a0bdc81
- merge - fix TypeError: 'CompletionUsage' object is not subscriptable #5441 (#5448)
* fix TypeError: 'CompletionUsage' object is not subscriptable (#5441)

* test(test_team_logging.py): mark flaky test

---------

Co-authored-by: yafei lee <yafei@dao42.com>
2024-08-30 08:54:42 -07:00
Ishaan Jaff
443e1b3bba prometheus - safe update start / end time 2024-08-28 16:13:56 -07:00
Ishaan Jaff
fb5be57bb8 v0 add rerank on litellm proxy 2024-08-27 17:28:39 -07:00
Ishaan Jaff
a99258440c fix use guardrail for pre call hook 2024-08-23 09:34:08 -07:00
Ishaan Jaff
4ac78a0765 fix prom latency metrics 2024-08-23 06:59:19 -07:00
Ishaan Jaff
36b550b8db update promtheus metric names 2024-08-22 14:03:00 -07:00
Ishaan Jaff
06a362d35f track litellm_request_latency_metric 2024-08-22 13:58:10 -07:00
Ishaan Jaff
65c0626aa4 fix init correct prometheus metrics 2024-08-22 13:29:35 -07:00
Krish Dholakia
e961810139
Merge pull request #5323 from MarkRx/feature/langsmith-ids
Support LangSmith parent_run_id, trace_id, session_id
2024-08-21 15:38:50 -07:00
MarkRx
19e5299a6d Support LangSmith parent_run_id, trace_id, session_id 2024-08-21 16:09:30 -04:00
Ishaan Jaff
1fdebfb0b7 working lakera ai during call hook 2024-08-20 14:39:04 -07:00
Ishaan Jaff
ae7cc6b198 fix _get_spend_report_for_time_range 2024-08-19 20:53:39 -07:00
Ishaan Jaff
8cd1963c11 feat - guardrails v2 2024-08-19 18:24:20 -07:00
Ishaan Jaff
4685b9909a feat - allow accessing data post success call 2024-08-19 11:35:33 -07:00
Ishaan Jaff
feb8c3c5b4
Merge pull request #5259 from BerriAI/litellm_return_remaining_tokens_in_header
[Feat] return `x-litellm-key-remaining-requests-{model}`: 1, `x-litellm-key-remaining-tokens-{model}: None` in response headers
2024-08-17 12:41:16 -07:00
Ishaan Jaff
5985c7e933 feat - use commong helper for getting model group 2024-08-17 10:46:04 -07:00
Ishaan Jaff
d630f77b73 show correct metric 2024-08-17 10:12:23 -07:00
Ishaan Jaff
412d30d362 add litellm-key-remaining-tokens on prometheus 2024-08-17 10:02:20 -07:00
Krrish Dholakia
61f4b71ef7 refactor: replace .error() with .exception() logging for better debugging on sentry 2024-08-16 09:22:47 -07:00
Krish Dholakia
6c3f37f8b4
Merge pull request #5235 from BerriAI/litellm_fix_s3_logs
fix(s3.py): fix s3 logging payload to have valid json values
2024-08-15 23:00:18 -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
Ishaan Jaff
a59ed00fd3 litellm always log cache_key on hits/misses 2024-08-15 09:59:58 -07:00
Ishaan Jaff
d8ef882905 fix langfuse log_provider_specific_information_as_span 2024-08-14 17:54:18 -07:00
Ishaan Jaff
98ea24aab0
Merge pull request #5202 from BerriAI/litellm_prom_prefix_litellm
[Fix] Prometheus use 'litellm_' prefix for new deployment metrics
2024-08-14 09:50:36 -07:00
Ishaan Jaff
acadabe6c9 use litellm_ prefix for new deployment metrics 2024-08-14 09:08:14 -07:00
Ishaan Jaff
326d797111 log failure calls on gcs + testing 2024-08-14 08:55:51 -07:00
Ishaan Jaff
63af2942ab feat log fail events on gcs 2024-08-14 08:39:16 -07:00
Krrish Dholakia
a9a3282031 fix(langsmith.py): support langsmith 'extra' field object
Closes https://github.com/BerriAI/litellm/issues/5179
2024-08-13 15:20:50 -07:00
Ishaan Jaff
f1df555c79 allow using langfuse_default_tags 2024-08-13 12:26:37 -07:00
Ishaan Jaff
42bd5de7c0 feat allow controlling logged tags on langfuse 2024-08-13 12:24:01 -07:00
Ishaan Jaff
49b8dee14d feat log responses in folders 2024-08-12 16:28:12 -07:00
Ishaan Jaff
19240b6cfd feat gcs log user api key metadata 2024-08-12 16:06:10 -07:00
Ishaan Jaff
c401970522
Merge pull request #5166 from BerriAI/litellm_log_key_created_slack
[Feat-Security] Send Slack Alert when CRUD ops done on Virtual Keys, Teams, Internal Users
2024-08-12 12:18:04 -07:00
Ishaan Jaff
4435a23121 send alert on all key events 2024-08-12 11:39:24 -07:00
Krrish Dholakia
b3c7d63ec1 fix(proxy_server.py): add info log when spend logs is skipped because disable_spend_logs=True. 2024-08-12 11:20:30 -07:00
Ishaan Jaff
30a54ef007 v0 log KeyCreatedEvent 2024-08-12 10:56:11 -07:00
Ishaan Jaff
dd9be6f160 allow setting PROMETHEUS_SELECTED_INSTANCE 2024-08-10 17:31:05 -07:00
Ishaan Jaff
e46009f3d2
Merge pull request #5154 from BerriAI/litellm_send_prometheus_fallbacks_from_slack
[Feat-Proxy] send prometheus fallbacks stats to slack
2024-08-10 17:14:01 -07:00
Ishaan Jaff
cc3316104f doc new prometheus metrics 2024-08-10 17:13:36 -07:00
Ishaan Jaff
28b930c0b7 feat - use api to get prometheus api metrics 2024-08-10 16:36:06 -07:00
Ishaan Jaff
35de40e6eb add fallback_reports in slack alert types 2024-08-10 16:08:36 -07:00
Ishaan Jaff
4cdc5c2e25 feat add prometheus api to get data from endpoint 2024-08-10 16:07:08 -07:00
Ishaan Jaff
d1eedb04bd prometheus log_success_fallback_event 2024-08-10 14:05:18 -07:00