forked from phoenix/litellm-mirror
Add backwards compatability
This commit is contained in:
parent
d557f3be74
commit
7ddfeb75bc
1 changed files with 25 additions and 3 deletions
|
@ -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("../..")
|
||||||
|
@ -17,10 +18,31 @@ try:
|
||||||
import yaml
|
import yaml
|
||||||
import rq
|
import rq
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError(
|
import sys
|
||||||
"Running `litellm proxy` requires installing via `pip install litellm[proxy]`"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
subprocess.check_call(
|
||||||
|
[
|
||||||
|
sys.executable,
|
||||||
|
"-m",
|
||||||
|
"pip",
|
||||||
|
"install",
|
||||||
|
"uvicorn",
|
||||||
|
"fastapi",
|
||||||
|
"appdirs",
|
||||||
|
"backoff",
|
||||||
|
"pyyaml",
|
||||||
|
"rq"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
import uvicorn
|
||||||
|
import fastapi
|
||||||
|
import appdirs
|
||||||
|
import backoff
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
warnings.warn(
|
||||||
|
"Installed runtime dependencies for proxy server. Specify these dependencies explicitly with `pip install litellm[proxy]`"
|
||||||
|
)
|
||||||
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue