Skip to main content
khaos serve loads one or more artifacts and exposes them over HTTP. It runs the same pipelines you get from khaos.load(), so what you test locally is what you deploy.

Run a server

You can also point it at a local artifact directory, for example straight out of a training run:
All artifacts are loaded at start-up, so a missing or broken artifact fails the deploy instead of the first request.

Endpoints

The result is the artifact’s own container, serialized field by field. Arrays become nested lists. File-based domains such as CAD parts and SEC filings use the upload route:

Authentication

Set KHAOS_API_KEY to require a bearer token on every /v1 route. /health stays open for load balancers.

Docker

The repository ships a Dockerfile. Mount a volume at /models to ship weights with the deployment, or let the container download them from the Hub on start.

Configuration

Inference runs on CPU through ONNX Runtime. Requests run in a thread pool, so scale throughput by running more worker processes behind a load balancer.