Hatrack is a small OpenAI-compatible semantic router for local inference backends. It exposes one /v1 endpoint and routes requests to configured upstream backends using editable routing profiles called "hats".
It includes:
- OpenAI-compatible proxy endpoints for chat completions, completions, embeddings, and model listing
- A browser control panel at
/panel - Editable backends, hats, word clouds, weights, and assignments
- Explicit routing with
model: "backend:<id>"ormodel: "hat:<id>" - Local backend discovery for OpenAI-compatible
/v1/modelsendpoints - Simple backend health tracking and recent decision logging
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python hatrack.pyThen open:
http://127.0.0.1:8200/panel
Use the OpenAI-compatible endpoint at:
http://127.0.0.1:8200/v1
Runtime state is stored outside the repository at:
~/.config/hatrack/state.json
~/.config/hatrack/decisions.jsonl
The checked-in defaults are generic and sanitized. Edit your live backend URLs and routing hats from the panel or API.
Hatrack is designed for local/trusted deployments. The admin API and panel can modify backend URLs and routing state. Do not expose it directly to the public internet without authentication or a trusted reverse proxy.
MIT