Commands
serve
Serve any .dit model over a zero-dependency stdlib HTTP server with GET /health and POST /predict endpoints.
ochreml serve loads a .dit model into memory and serves JSON inference requests over Python's standard library http.server.HTTPServer (^▽^).
Usage
ochreml serve <model> [--host HOST] [--port PORT] [--device DEVICE]Arguments & Flags
| Argument / Flag | Default | Description |
|---|---|---|
model | required | Path to .dit model file |
--host | 127.0.0.1 | Bind host address |
--port | 8080 | Bind TCP port |
--device | auto | Target device for inference (auto, cpu, cuda:0, wgpu, tpu) |
HTTP Endpoints
| Method & Path | Request Body | Success Response (200 OK) |
|---|---|---|
GET /health | none | {"status": "ok", "model_type": "...", "model_path": "...", "version": "..."} |
POST /predict | {"inputs": [[...]]} or {"X": [[...]]} | {"predictions": [...], "model_type": "..."} |
Invalid payloads return 400 Bad Request with {"error": "..."}; unknown routes return 404 Not Found.
Environment Variables
OCHREML_DEBUG=1: Enable per-request[ochreml serve]HTTP access logs onstderr(silent by default).
Example
ochreml serve models/ridge.dit --host 127.0.0.1 --port 8080See the Local HTTP Model Serving guide for curl examples and deployment notes.