Spaces:
Paused
Paused
Download app.py from Tom716/litellm: direct link, hf CLI and curl.
- Browser
- Download file 792 Bytes
-
https://huggingface.co/spaces/Tom716/litellm/resolve/main/app.py
- Command line
-
hf download hf://spaces/Tom716/litellm/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Tom716/litellm/resolve/main/app.py
792 Bytes
| import os | |
| import subprocess | |
| import sys | |
| import litellm | |
| from litellm.proxy.proxy_cli import run_server | |
| # Bypass automated prisma engine checks if needed | |
| os.environ["DATABASE_URL"] = os.getenv("DATABASE_URL", "") | |
| litellm_pkg_dir = os.path.dirname(litellm.__file__) | |
| schema_path = None | |
| for root, _, files in os.walk(litellm_pkg_dir): | |
| if "schema.prisma" in files: | |
| schema_path = os.path.join(root, "schema.prisma") | |
| break | |
| if schema_path: | |
| subprocess.run( | |
| [sys.executable, "-m", "prisma", "generate", f"--schema={schema_path}"], | |
| check=True, | |
| ) | |
| if __name__ == "__main__": | |
| run_server( | |
| args=[ | |
| "--host", "0.0.0.0", | |
| "--port", "7860", | |
| "--config", "config.yaml", | |
| "--telemetry", "False" | |
| ], | |
| standalone_mode=False, | |
| ) |