Commit graph

11876 commits

Author SHA1 Message Date
Ishaan Jaff
5310706d1d
Merge pull request #3681 from BerriAI/litellm_fix_langfuse_flush_on_shutdown
[Fix] Flush langfuse logs on proxy shutdown
2024-05-16 09:45:33 -07:00
Ishaan Jaff
579bc09c37 fix - flush langfuse logs on proxy shutdown 2024-05-16 09:21:48 -07:00
Ishaan Jaff
4d97ca4500
Merge pull request #3679 from BerriAI/litellm_fix_show_better_client_side_error
[Fix]- router/proxy show better client side errors when `no_healthy deployments available`
2024-05-16 09:21:41 -07:00
Ishaan Jaff
848561a8a7 fix - router show better client side errors 2024-05-16 09:01:27 -07:00
Marc Abramowitz
b079f4cb79 model_info_v{1,2} (LiteLLM) => model_list (OpenAI) 2024-05-16 07:54:09 -07:00
Krish Dholakia
fda3914f4c
Merge pull request #3652 from BerriAI/litellm_end_user_cost_tracking
feat(proxy_server.py): new `/end_user/info` endpoint
2024-05-15 22:27:45 -07:00
Krish Dholakia
152946e910
Merge branch 'main' into litellm_end_user_cost_tracking 2024-05-15 22:27:04 -07:00
Krrish Dholakia
00b9f1290e bump: version 1.37.11 → 1.37.12 2024-05-15 22:24:55 -07:00
Krish Dholakia
57d425aed7
Merge pull request #3666 from BerriAI/litellm_jwt_fix
feat(proxy_server.py): JWT-Auth improvements
2024-05-15 22:22:44 -07:00
Krrish Dholakia
600b6f7e1d feat(proxy_server.py): support 'user_id_upsert' flag for jwt_auth 2024-05-15 22:19:59 -07:00
Krrish Dholakia
99653d2d3e feat(handle_jwt.py): add support for 'team_id_default
allows admin to set a default team id for spend-tracking + permissions
2024-05-15 21:33:35 -07:00
Ishaan Jaff
bb86d2510f (ci/cd) run again 2024-05-15 21:07:55 -07:00
Krrish Dholakia
f48cd87cf3 feat(proxy_server.py): make team_id optional for jwt token auth (only enforced, if set)
Allows users to use jwt auth for internal chat apps
2024-05-15 21:05:14 -07:00
Ishaan Jaff
ac71a89b0e ui - new build 2024-05-15 21:04:09 -07:00
Ishaan Jaff
775eb0ba99 bump: version 1.37.10 → 1.37.11 2024-05-15 21:01:02 -07:00
Ishaan Jaff
5300a4c9b3 fix model prices 2024-05-15 21:00:56 -07:00
Ishaan Jaff
881812d5de
Merge pull request #3543 from kmheckel/main
Updated Ollama cost models to include LLaMa3 and Mistral/Mixtral Instruct series
2024-05-15 20:50:50 -07:00
Ishaan Jaff
370049c549
Merge pull request #3661 from BerriAI/litellm_enable_alerts_completions_endpoint
[FIX]  raise alerts for exceptions on `/completions` endpoint
2024-05-15 20:46:02 -07:00
Ishaan Jaff
7aac76b485
Merge pull request #3662 from BerriAI/litellm_feat_predibase_exceptions
[Fix] Mask API Keys from Predibase AuthenticationErrors
2024-05-15 20:45:40 -07:00
Krish Dholakia
25e4b34574
Merge pull request #3660 from BerriAI/litellm_proxy_ui_general_settings
feat(proxy_server.py): Enabling Admin to control general settings on proxy ui
2024-05-15 20:36:42 -07:00
Ishaan Jaff
e49fa9bd2c (ci/cd) run again 2024-05-15 20:29:23 -07:00
Ishaan Jaff
b3d472f910
Merge pull request #3664 from BerriAI/litellm_revert_3600
[Fix] Revert #3600 https://github.com/BerriAI/litellm/pull/3600
2024-05-15 20:19:35 -07:00
Krrish Dholakia
594ca947c8 fix(parallel_request_limiter.py): fix max parallel request limiter on retries 2024-05-15 20:16:11 -07:00
Ishaan Jaff
c2a306c4dd (ci/cd) run again 2024-05-15 20:03:30 -07:00
Ishaan Jaff
765d43d241 fix utils.py 2024-05-15 19:54:52 -07:00
Ishaan Jaff
1a67f244fb fix types/router.py 2024-05-15 19:46:30 -07:00
Ishaan Jaff
86223bc703 revert changes to types/completion.py 2024-05-15 19:45:16 -07:00
Ishaan Jaff
136746abc9 fix test config 2024-05-15 19:42:39 -07:00
Ishaan Jaff
8e3aa14287 fix revert 3600 2024-05-15 19:40:34 -07:00
Krrish Dholakia
153ce0d085 build(ui/general_settings.tsx): support updating global max parallel requests on the ui 2024-05-15 19:26:57 -07:00
Ishaan Jaff
d208dedb35 (ci/cd) run again 2024-05-15 17:39:21 -07:00
Marc Abramowitz
ddf77656fb Allow non-admins to use OpenAI routes
The problem we were having is non-admin users trying to use
`/engines/{model}/chat/completions` were getting an HTTP 401 error.

```shell
$ curl -sSL 'http://localhost:4000/engines/gpt-35-turbo-0125/chat/completions' \
    --header "Authorization: Bearer ${LITELLM_KEY}" \
    --header 'Content-Type: application/json' \
    --data ' {
        "model": "gpt-35-turbo-0125",
        "messages": [
            {
                "role": "user",
                "content": "Write a poem about LiteLLM"
            }
        ]
    }' \
    | jq '.'
{
  "error": {
    "message": "Authentication Error, Only proxy admin can be used to generate, delete, update info for new keys/users/teams. Route=/engines/gpt-35-turbo-0125/chat/completions. Your role=unknown. Your user_id=someone@company.com",
    "type": "auth_error",
    "param": "None",
    "code": 401
  }
}
```

This seems to be related to code in `user_api_key_auth` that checks that the URL
matches a list of routes that are allowed for non-admin users, where the list of
routes is in `LiteLLMRoutes.openai_routes.value`. The problem is that the route
`/engines/{model}/chat/completions` is not in that list and furthermore, that
wouldn't even work if it were, because the comparison is done with
`request.url.path` and that will have the actual model name in it (e.g.:
`gpt-35-turbo-0125`), rather than `{model}`.

I added a new list `LiteLLMRoutes.openai_route_names` and added the route
**names** to that list. Then I added a check in `user_api_key_auth` to see if
the route name is in the list of route names.
2024-05-15 17:36:11 -07:00
Ishaan Jaff
89dd1ffee8 fix deep copy logic in during_call_hook 2024-05-15 17:34:54 -07:00
Ishaan Jaff
240b183d7a ci/cd run again 2024-05-15 17:31:14 -07:00
Ishaan Jaff
1262c5cb39 fix - /organization/new logic 2024-05-15 17:27:46 -07:00
Ishaan Jaff
ed0a815c2b test - exceptions predibase 2024-05-15 16:53:41 -07:00
Ishaan Jaff
b88ad61490 feat - predibase exceptions 2024-05-15 16:52:33 -07:00
Ishaan Jaff
f138c15859 (ci/cd) fix test_vertex_ai_stream 2024-05-15 16:32:40 -07:00
Ishaan Jaff
f2e8b2500f fix function calling mistral large latest 2024-05-15 16:05:17 -07:00
Ishaan Jaff
9f43761000 fix - show alerts on /completions endpoint 2024-05-15 15:45:21 -07:00
Ishaan Jaff
e518b1e6c1 fix - vertex exception test 2024-05-15 15:37:59 -07:00
Krrish Dholakia
6a357b4275 feat(proxy_server.py): Enabling Admin to control general settings on proxy ui 2024-05-15 15:26:57 -07:00
Ishaan Jaff
6d8ea641ec (ci/cd) fix test_content_policy_exception_azure 2024-05-15 14:47:39 -07:00
Ishaan Jaff
371043d683 fix - test mistral/large _parallel_function_call 2024-05-15 14:31:00 -07:00
Ishaan Jaff
3e831b4e1a fix debug logs on router test 2024-05-15 14:28:17 -07:00
Ishaan Jaff
fdf7a4d8c8 fix - test_lowest_latency_routing_first_pick 2024-05-15 14:24:13 -07:00
Ishaan Jaff
c00d232900
Merge pull request #3655 from BerriAI/litellm_only_show_debug_info_server_side
Fix Proxy Server - only show API base, Model server log exceptions, not on client side
2024-05-15 14:20:14 -07:00
Ishaan Jaff
1a11b151b7 fix - show litellm debug info in errors 2024-05-15 14:18:12 -07:00
Sebastián Estévez
9b7465a222
Another dictionary changed size during iteration error
```
ImportError while loading conftest '/astra-assistants-api/tests/openai-sdk/conftest.py'.
conftest.py:13: in <module>
    from impl.astra_vector import CassandraClient
../../impl/astra_vector.py:45: in <module>
    from impl.services.inference_utils import get_embeddings
../../impl/services/inference_utils.py:5: in <module>
    import litellm
.cache/pypoetry/virtualenvs/astra-assistants-api-eiSmbCzm-py3.10/lib/python3.10/site-packages/litellm/__init__.py:678: in <module>
    from .main import *  # type: ignore
.cache/pypoetry/virtualenvs/astra-assistants-api-eiSmbCzm-py3.10/lib/python3.10/site-packages/litellm/main.py:73: in <module>
    from .llms.azure_text import AzureTextCompletion
.cache/pypoetry/virtualenvs/astra-assistants-api-eiSmbCzm-py3.10/lib/python3.10/site-packages/litellm/llms/azure_text.py:23: in <module>
    openai_text_completion_config = OpenAITextCompletionConfig()
.cache/pypoetry/virtualenvs/astra-assistants-api-eiSmbCzm-py3.10/lib/python3.10/site-packages/litellm/llms/openai.py:192: in __init__
    for key, value in locals_.items():
E   RuntimeError: dictionary changed size during iteration
```
2024-05-15 17:06:54 -04:00
Ishaan Jaff
f6e342303e show debug info on slack alerts 2024-05-15 13:23:44 -07:00