Commit graph

11603 commits

Author SHA1 Message Date
Marc Abramowitz
bfec894f6b Cast SLACK_DAILY_REPORT_FREQUENCY to int 2024-05-13 17:08:53 -07:00
Krrish Dholakia
af9489bbfd fix(router.py): overloads fix 2024-05-13 17:04:04 -07:00
Marc Abramowitz
bdb995f436 Revert = None changes
because @krrishdholakia said [here](https://github.com/BerriAI/litellm/pull/3600#discussion_r1599108453)
that they were problematic in the past.
2024-05-13 16:49:36 -07:00
Krrish Dholakia
240c9550f0 fix(utils.py): handle api assistant returning 'null' role
Fixes https://github.com/BerriAI/litellm/issues/3621
2024-05-13 16:46:07 -07:00
Marc Abramowitz
01da3b0a7a Add ability to customize slack report frequency
via `SLACK_DAILY_REPORT_FREQUENCY` env var

Addresses one thing that @taralika mentioned in
https://github.com/BerriAI/litellm/issues/3597
2024-05-13 16:39:44 -07:00
Ishaan Jaff
d3f76e33e4 ui - clean up edit team input box 2024-05-13 16:36:21 -07:00
Ishaan Jaff
8c37c47c8d bump: version 1.37.8 → 1.37.9 2024-05-13 16:30:05 -07:00
Krish Dholakia
e92f433566
Merge pull request #3554 from paneru-rajan/Issue-3544-fix-message
Fixes #3544 based on the data-type of message
2024-05-13 16:23:58 -07:00
Krrish Dholakia
c7b3193944 fix(proxy/_types.py): allow jwt admin to access /team/list route 2024-05-13 16:07:31 -07:00
Ishaan Jaff
ea9b4dc439
Merge pull request #3619 from BerriAI/litellm_show_spend_reports
[Feat] -  `/global/spend/report`
2024-05-13 16:06:02 -07:00
Ishaan Jaff
eb2d6ba20a ui - new build 2024-05-13 15:56:59 -07:00
Ishaan Jaff
53ab935151 cleanup PR template 2024-05-13 15:54:58 -07:00
Ishaan Jaff
d0a5c9b363 docs - spend per team 2024-05-13 15:48:26 -07:00
Krrish Dholakia
aa2f6aa5bd bump: version 1.37.7 → 1.37.8 2024-05-13 15:31:59 -07:00
Ishaan Jaff
11d3c86cf1 test /spend/report 2024-05-13 15:26:39 -07:00
Krrish Dholakia
b4a8665d11 fix(utils.py): fix custom pricing when litellm model != response obj model name 2024-05-13 15:25:35 -07:00
Ishaan Jaff
1be6ea0c0d
Merge pull request #3603 from alexanderepstein/langfuse_turn_off_messaging
feat(langfuse.py): Allow for individual call message/response redaction
2024-05-13 15:21:41 -07:00
Ishaan Jaff
12cf9d71c7 feat - /spend/report endpoint 2024-05-13 15:01:02 -07:00
Krrish Dholakia
1312eece6d fix(router.py): overloads for better router.acompletion typing 2024-05-13 14:27:16 -07:00
Krrish Dholakia
bd2f46fd75 fix(slack_alerting.py): if 'turn_off_message_logging' enabled, do not log the message to logging integration 2024-05-13 14:02:43 -07:00
Ishaan Jaff
9d4b727913 fix - show team based spend reports 2024-05-13 13:56:48 -07:00
Krrish Dholakia
7fa203c810 docs(input.md): add mistral to input param docs 2024-05-13 13:50:49 -07:00
Krrish Dholakia
20456968e9 fix(openai.py): creat MistralConfig with response_format mapping for mistral api 2024-05-13 13:29:58 -07:00
Ishaan Jaff
20fe4ffd6b bump: version 1.37.6 → 1.37.7 2024-05-13 13:03:14 -07:00
Ishaan Jaff
112c06ae54
Merge pull request #3550 from BerriAI/dependabot/npm_and_yarn/ui/litellm-dashboard/next-14.1.1
build(deps): bump next from 14.1.0 to 14.1.1 in /ui/litellm-dashboard
2024-05-13 13:01:02 -07:00
Ishaan Jaff
3a838934c9 docs - cooldown deployment 2024-05-13 12:50:59 -07:00
Ishaan Jaff
dac8c644fd docs - router show cooldown_time 2024-05-13 12:49:51 -07:00
Ishaan Jaff
21845bc061
Merge pull request #3609 from BerriAI/litellm_send_daily_spend_report
[Feat] send weekly spend reports by Team/Tag
2024-05-13 12:45:37 -07:00
Krrish Dholakia
39e4927752 fix(utils.py): fix vertex ai function calling + streaming
Completes https://github.com/BerriAI/litellm/issues/3147
2024-05-13 12:32:39 -07:00
Ishaan Jaff
40b2f33a80 fix - only schedule spend alerting when db is not none 2024-05-13 12:30:54 -07:00
Ishaan Jaff
efaf4c87f2
Merge pull request #3601 from msabramo/msabramo/update-fastapi-to-update-starlette-to-fix-httpx-warnings
Update FastAPI to update starlette to fix warnings
2024-05-13 12:20:17 -07:00
Krrish Dholakia
5dc3f157a6 build(model_prices_and_context_window.json): fix gpt-4o max tokens 2024-05-13 12:11:15 -07:00
Krish Dholakia
6c2168b6f7
Merge pull request #3613 from ConnorDoyle/patch-1
Add gpt-4o metadata
2024-05-13 12:09:27 -07:00
Connor Doyle
5da5021918
Update model_prices_and_context_window.json 2024-05-13 11:51:54 -07:00
Marc Abramowitz
1efa2e65ac Merge branch 'main' into msabramo/fix-pydantic-warnings 2024-05-13 11:34:06 -07:00
Marc Abramowitz
73541b1f17 Merge branch 'msabramo/pydantic_replace_root_validator_with_model_validator' into msabramo/fix-pydantic-warnings 2024-05-13 11:25:55 -07:00
Marc Abramowitz
e261a9b2c2 Use Config class w/ arbitrary_types_allowed for pydantic v1
pydantic v2 warns about using a Config class.
But without this, pydantic v1 will raise an error:
    RuntimeError: no validator found for <class 'openai.Timeout'>,
    see `arbitrary_types_allowed` in Config
Putting arbitrary_types_allowed = True in the ConfigDict doesn't work in pydantic v1.
So we mostly use model_config = ConfigDict(...) and then only use the Config
class with arbitrary_types_allowed = True for pydantic v1.
2024-05-13 11:22:50 -07:00
Connor Doyle
a4380f67a9
Add gpt-4o metadata
#3612
2024-05-13 11:12:17 -07:00
Marc Abramowitz
f233cde36c Replace some Config classes with model_config
in `litellm/types/router.py`

I didn't replace the ones that have `allow_arbitrary_types` because changing
those seems to break pydantic v1 compatibility.
2024-05-13 11:04:13 -07:00
Ishaan Jaff
7f6f196e66 ui - show daily reports on UI 2024-05-13 10:55:54 -07:00
Ishaan Jaff
3fbebe16aa fix - spend reports on alerts 2024-05-13 10:51:59 -07:00
Ishaan Jaff
aac81c59b5 test - weekly / monthly spend report alerts on /health/services 2024-05-13 10:50:26 -07:00
Ishaan Jaff
197eb44832 fix scheduling spend reports 2024-05-13 10:45:22 -07:00
Ishaan Jaff
4a679bb640 schedule weekly/monthly spend reports 2024-05-13 10:44:19 -07:00
Krrish Dholakia
04ae285001 fix(vertex_ai.py): support tool call list response async completion 2024-05-13 10:42:31 -07:00
Marc Abramowitz
4ccdbfd67d model_config = ConfigDict instead of model_config = dict 2024-05-13 10:38:01 -07:00
Marc Abramowitz
eacafa7cd7 Revert litellm/types/router.py changes
These don't work in pydantic v1.
2024-05-13 10:34:05 -07:00
Marc Abramowitz
abd90e6296 Revert root_validator => model_validator change
I have it in a separate PR:

https://github.com/BerriAI/litellm/pull/3611
2024-05-13 10:33:04 -07:00
Marc Abramowitz
ad8c3ac2c3 Change pydantic root_validator to model_validator
pydantic v1 uses `root_validator` and pydantic v2 uses `model_validator`.

pydantic v2 emits a warning when `root_validator` is used. E.g.:

```
litellm/proxy/_types.py:225
  /Users/abramowi/Code/OpenSource/litellm/litellm/proxy/_types.py:225:
  PydanticDeprecatedSince20: Pydantic V1 style `@root_validator`
  validators are deprecated.
  You should migrate to Pydantic V2 style `@model_validator` validators,
  see the migration guide for more details.
  Deprecated in Pydantic V2.0 to be removed in V3.0.
  See Pydantic V2 Migration Guide at
  https://errors.pydantic.dev/2.7/migration/
    @root_validator(pre=True)
```

This change eliminates those warnings with pydantic v2, while retaining
compatibility with pydantic v1.

pydantic 2.7.1 before

```
$ env -i PATH=$PATH poetry run pytest litellm/tests/test_proxy_server.py
...
litellm/proxy/_types.py:225
  /Users/abramowi/Code/OpenSource/litellm/litellm/proxy/_types.py:225: PydanticDeprecatedSince20: Pydantic V1 style `@root_validator` validators are deprecated. You should migrate to Pydantic V2 style `@model_validator` validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.7/migration/
    @root_validator(pre=True)
...
========================== 10 passed, 2 skipped, 39 warnings in 8.67s ===========================
```

pydantic 2.7.1 after

```
$ env -i PATH=$PATH poetry run pytest litellm/tests/test_proxy_server.py
...
========================== 10 passed, 2 skipped, 27 warnings in 9.85s ===========================
```

pydantic 1.10.5 after

```
$ poetry run pip install 'pydantic<2'
...
Successfully installed pydantic-1.10.15
$ env -i PATH=$PATH poetry run pytest litellm/tests/test_proxy_server.py
...
=========================== 10 passed, 2 skipped, 1 warning in 8.13s ============================
```
2024-05-13 10:23:44 -07:00
Ishaan Jaff
2cd584a3ad feat - send_monthly_spend_report 2024-05-13 10:17:40 -07:00