docker-laya: multi-checkpoint Laya API with auth, presets and bulk inference
Dockerized FastAPI service bundling all three checkpoints behind a language router, with timing-safe API keys, OpenAPI docs, triage and moderation presets and bulk inference.
# docker-laya [](https://github.com/chneau/docker-laya/actions/workflows/publish.yml) [](https://ghcr.io/chneau/laya) Dockerized [Laya](https://huggingface.co/convaiinnovations/laya) prediction service: loads one or more checkpoints behind a router, then serves typed decisions (choice / score / noul) over HTTP, auto-routed by language or pinned with `model`. Built and published for `linux/amd64` and `linux/arm64`. --- ## ✨ Features - 🔀 **Multi-Checkpoint Routing**: bundles `english`, `multilingual` and `typed-decisions`, auto-selected by language or pinned per request. - 🎯 **Typed Decisions**: `choice` / `score` / `noul` questions with calibrated probabilities, confidence and action probability. - 🔐 **Timing-Safe Auth**: API keys (`X-API-Key` / `Authorization: Bearer`) and HTTP Basic, compared in constant time. - 📑 **Interactive OpenAPI Docs**: Swagger UI (`/docs`), ReDoc (`/redoc`) and the raw schema at `/openapi.json`. - 🧰 **Built-in Presets**: ready-made question sets (`triage`, `email`, `guard`, `moderation`, `router`). - 📦 **Bulk Inference**: `/predict/bulk` over many states, with per-state questions/model and isolated errors. - 🔎 **Detection & Email Helpers**: `/detect` (script/language) and `/email/state` (clean + structure an email). - 🧩 **Flexible State**: string, JSON object, or conversation turns; criteria values may be any JSON (dicts/lists/numbers are rendered as compact JSON). - 🛡️ **Non-Root**: runs as unprivileged `appuser` (uid `10001`). - 📦 **Multi-Architecture**: supports both `linux/amd64` and `linux/arm64`. - 🩺 **Healthcheck**: dedicated `/healthz` endpoint and container `HEALTHCHECK`. - 🪶 **CPU-Only Torch**: uses the PyTorch CPU wheel index (no CUDA), roughly `0.35s` per predict on CPU. --- ## 🚀 Quickstart Pu