diff --git a/dist/litellm-0.1.7712-py3-none-any.whl b/dist/litellm-0.1.7712-py3-none-any.whl new file mode 100644 index 000000000..b59fd81b4 Binary files /dev/null and b/dist/litellm-0.1.7712-py3-none-any.whl differ diff --git a/dist/litellm-0.1.7712.tar.gz b/dist/litellm-0.1.7712.tar.gz new file mode 100644 index 000000000..b1ad1110d Binary files /dev/null and b/dist/litellm-0.1.7712.tar.gz differ diff --git a/dist/litellm-0.1.7713-py3-none-any.whl b/dist/litellm-0.1.7713-py3-none-any.whl new file mode 100644 index 000000000..a2871cf75 Binary files /dev/null and b/dist/litellm-0.1.7713-py3-none-any.whl differ diff --git a/dist/litellm-0.1.7713.tar.gz b/dist/litellm-0.1.7713.tar.gz new file mode 100644 index 000000000..45ac493ba Binary files /dev/null and b/dist/litellm-0.1.7713.tar.gz differ diff --git a/litellm/__init__.py b/litellm/__init__.py index 727d55578..a357292c9 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -322,4 +322,4 @@ from .exceptions import ( ) from .budget_manager import BudgetManager -from .proxy_server.proxy_cli import run_server \ No newline at end of file +from .proxy.proxy_cli import run_server \ No newline at end of file diff --git a/litellm/__pycache__/__init__.cpython-311.pyc b/litellm/__pycache__/__init__.cpython-311.pyc index 040428ab0..e65faa9a7 100644 Binary files a/litellm/__pycache__/__init__.cpython-311.pyc and b/litellm/__pycache__/__init__.cpython-311.pyc differ diff --git a/litellm/proxy_server/proxy_cli.py b/litellm/proxy/proxy_cli.py similarity index 92% rename from litellm/proxy_server/proxy_cli.py rename to litellm/proxy/proxy_cli.py index 6a3be5755..75bad1b6f 100644 --- a/litellm/proxy_server/proxy_cli.py +++ b/litellm/proxy/proxy_cli.py @@ -7,7 +7,7 @@ load_dotenv() @click.option('--api_base', default=None, help='API base URL.') @click.option('--model', required=True, help='The model name to pass to litellm expects') def run_server(port, api_base, model): - from proxy_server import app, initialize + from .proxy_server import app, initialize initialize(model, api_base) try: import uvicorn diff --git a/litellm/proxy_server/proxy_server.py b/litellm/proxy/proxy_server.py similarity index 87% rename from litellm/proxy_server/proxy_server.py rename to litellm/proxy/proxy_server.py index fbb182bcb..4535775d2 100644 --- a/litellm/proxy_server/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -1,3 +1,4 @@ +import litellm from fastapi import FastAPI, Request from fastapi.responses import StreamingResponse import json @@ -11,6 +12,12 @@ def initialize(model, api_base): user_model = model user_api_base = api_base + +# for streaming +def data_generator(response): + for chunk in response: + yield f"data: {json.dumps(chunk)}\n\n" + @app.get("/models") # if project requires model list def model_list(): return dict( diff --git a/pyproject.toml b/pyproject.toml index 6f5018ea5..bc7ae8dde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "0.1.771" +version = "0.1.7713" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT License"