Expand description
Axum HTTP router and endpoint handlers. HTTP layer — axum 0.8.
Routes:
POST /v1/systemone→ the Jev evaluation endpointGET /health→ livenessGET /v1/models→ list available model aliases (Jev shape)GET /metrics→ Prometheus scrapeGET /playground→ embedded web UI, only with--playground onPOST /v1/arrow→ unofficial bulk Arrow IPC endpoint, only with--arrow on; outside the TypeSafe wire contract (seecrate::arrow)
Every response is stamped with x-typesafe-request-id (the SDK reads
this to log per-request correlation), and /v1/* is gated by an
optional bearer token when OPENKIND_API_KEY is set.
Re-exports§
pub use router_with_state as build_router_with_state;
Constants§
- MAX_
PAYLOAD_ SIZE_ BYTES - Maximum allowed request payload size in bytes (16 MB) to protect against DoS memory exhaustion.
Functions§
- install_
metrics_ recorder - Install the Prometheus recorder. Called by the server binary on startup. Exposed here so the binary doesn’t have to depend on metrics-exporter-prometheus directly.
- router
- Build the HTTP router with default authentication configuration (no API key required).
- router_
daemon - Build the daemon HTTP router: explicit payload size limit, rate limiting,
and the embedded playground UI when
playgroundis set (openkindd --playground on). - router_
daemon_ with_ arrow - Build the daemon router with the unofficial Arrow endpoint explicitly enabled.
arrow = falsehas the same behavior asrouter_daemon. - router_
with_ auth - Build the HTTP router with explicit authentication configuration.
- router_
with_ state - Build the HTTP router with a pre-built state and default 16MB payload limit. Used by the daemon.
- router_
with_ state_ and_ limit - Build the HTTP router with explicit payload size limit and the default
per-IP rate limit (see
crate::middleware::RateLimitConfig::default). - router_
with_ state_ auth_ rate_ limit - Build the HTTP router with explicit payload size limit and rate limiting.