Merge pull request #966 from PSU3D0/proxy_extras

(feat) Allow installing proxy dependencies explicitly with `pip install litellm[proxy]`
This commit is contained in:
Ishaan Jaff 2023-11-30 15:46:25 -08:00 committed by GitHub
commit 854ffbe79a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 2 deletions

View file

@ -13,7 +13,7 @@ Docs outdated. New docs 👉 [here](./simple_proxy.md)
## Usage ## Usage
```shell ```shell
pip install litellm pip install litellm[proxy]
``` ```
```shell ```shell
$ litellm --model ollama/codellama $ litellm --model ollama/codellama

View file

@ -16,7 +16,7 @@ LiteLLM Server manages:
View all the supported args for the Proxy CLI [here](https://docs.litellm.ai/docs/simple_proxy#proxy-cli-arguments) View all the supported args for the Proxy CLI [here](https://docs.litellm.ai/docs/simple_proxy#proxy-cli-arguments)
```shell ```shell
$ pip install litellm $ pip install litellm[proxy]
``` ```
```shell ```shell

View file

@ -4,6 +4,7 @@ import shutil, random, traceback, requests
from datetime import datetime, timedelta from datetime import datetime, timedelta
from typing import Optional, List from typing import Optional, List
import secrets, subprocess import secrets, subprocess
import warnings
messages: list = [] messages: list = []
sys.path.insert( sys.path.insert(
0, os.path.abspath("../..") 0, os.path.abspath("../..")
@ -39,6 +40,10 @@ except ImportError:
import backoff import backoff
import yaml import yaml
warnings.warn(
"Installed runtime dependencies for proxy server. Specify these dependencies explicitly with `pip install litellm[proxy]`"
)
import random import random
list_of_messages = [ list_of_messages = [

View file

@ -19,6 +19,19 @@ certifi = "^2023.7.22"
appdirs = "^1.4.4" appdirs = "^1.4.4"
aiohttp = "*" aiohttp = "*"
uvicorn = {version = "^0.24.0.post1", optional = true}
fastapi = {version = "^0.104.1", optional = true}
backoff = {version = "*", optional = true}
rq = {version = "*", optional = true}
[tool.poetry.extras]
proxy = [
"uvicorn",
"fastapi",
"backoff",
"rq"
]
[tool.poetry.scripts] [tool.poetry.scripts]
litellm = 'litellm:run_server' litellm = 'litellm:run_server'