Skip to main content

Module http

Module http 

Source
Expand description

Axum HTTP router and endpoint handlers. HTTP layer — axum 0.8.

Routes:

  • POST /v1/systemone → the Jev evaluation endpoint
  • GET /health → liveness
  • GET /v1/models → list available model aliases (Jev shape)
  • GET /metrics → Prometheus scrape
  • GET /playground → embedded web UI, only with --playground on
  • POST /v1/arrow → unofficial bulk Arrow IPC endpoint, only with --arrow on; outside the TypeSafe wire contract (see crate::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 playground is set (openkindd --playground on).
router_daemon_with_arrow
Build the daemon router with the unofficial Arrow endpoint explicitly enabled. arrow = false has the same behavior as router_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.