INNER CODE UNIT · Python
serve
416rehman/DeepZero · src/deepzero/cli.py:621
def serve(host: str, port: int, work_dir: str):
"""start the rest api server"""
if host not in ("127.0.0.1", "localhost", "::1"):
console.print(
f"[bold yellow]⚠ binding to {host} - server will be accessible on the network[/]"
)
console.print(f"[bold cyan]deepzero serve[/] - http://{host}:{port}")
console.print(f" work_dir: {work_dir}")
_load_env()
from deepzero.api.server import create_app
try:
import uvicorn
except ImportError as exc:
console.print("[red]uvicorn required: pip install deepzero[serve][/]")
raise SystemExit(1) from exc