Go
1 stars
Model serving that stays predictable under overload: a Go gateway with per-tenant quotas, admission control sized with Little's law, deadlines, fan-out, retries and replica ejection, in front of batching ONNX workers. Kubernetes with KEDA, tested on kind in CI.
### Overview: This project is a Go-based inference platform designed to handle unpredictable load, ensuring predictability even when demand exceeds capacity. It includes admission control, tenant quotas, deadlines, fan-out, retries, and replica ejection, making it ideal for teams serving models to multiple applications from shared infrastructure.
### Key Features:
- **Admission Control Sized with Little's Law:** Admits only as much work as the replicas can finish within the latency budget, ensuring no timeouts.
- **Tenant Quotas and Priorities:** Each tenant has a token bucket based on texts, not requests, and can be shed first if it exceeds capacity.
- **Deadlines End to End:** Requests are dropped before running the model to ensure deadlines are met.
- **Fan-Out:** Large requests are split into chunks and sent to different replicas in parallel, merging results in order.
- **Failure Handling:** Replicas are routed by power of two choices on outstanding work, retries on failed calls, and ejected if they fail repeatedly.
- **Dynamic Batching:** Concurrent requests share one model call with a bounded queue.
- **Kubernetes-Ready:** Uses headless services for discovery, readiness tied to a warmed model, graceful drain, PodDisruptionBudgets, NetworkPolicies, and restricted Pod Security profile.
### Tech Stack: Go 1.25 (gateway, load generator) · Python 3.13 · FastAPI · ONNX Runtime (bge-small-en-v1.5 embeddings, MiniLM cross-encoder reranker) · Prometheus · Grafana · Docker · Kubernetes (K