Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hatrack

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>" or model: "hat:<id>"
  • Local backend discovery for OpenAI-compatible /v1/models endpoints
  • Simple backend health tracking and recent decision logging

Quick start

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python hatrack.py

Then open:

http://127.0.0.1:8200/panel

Use the OpenAI-compatible endpoint at:

http://127.0.0.1:8200/v1

Configuration

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.

Security note

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.

License

MIT

About

OpenAI-compatible semantic router for local inference backends

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages