Skip to main content

ZidoRouter

Self-hosted gateway for LLM APIs. One process, zero dependencies beyond Python stdlib.

Point any OpenAI-compatible client at it and get: provider failover, circuit breakers, prompt caching, token savings, per-key metering, budget caps, and a live dashboard.

Install

Requires Python 3.9+.

pip install .

Quickstart

  1. Add a provider (repeat for each upstream you have):
zidorouter add groq https://api.groq.com/openai/v1 gpt-4o-mini YOUR_GROQ_KEY
  1. Set a dashboard password:
zidorouter dashboard-pass
  1. Serve:
zidorouter serve 8764

Now point your client at http://127.0.0.1:8764/v1 and use any dashboard-issued key (zid-...) as the API key.

Dashboard

Open http://127.0.0.1:8764/ and log in with the password you set. From there:

  • add or remove providers, toggle them on or off
  • issue and revoke client keys
  • set model aliases (combos) and per-provider prices
  • watch usage, cache hit rate, and audit logs live

Features

  • Multi-provider pool with automatic failover and per-provider circuit breakers
  • Health probes and status at a glance
  • Auto prompt-cache markers (opt out per request or globally)
  • Context slimming: trims old tool output and folds mid-history so tokens are never sent twice
  • Per-key rate limits, daily budgets, and usage metering
  • Cost estimation per provider
  • Webhooks for failover, budget exceeded, and provider recovery events
  • Audit log of every request

CLI

zidorouter list                 # show providers
zidorouter add NAME BASE MODEL KEY [NOTES]
zidorouter remove NAME
zidorouter dashboard-pass       # set or change the dashboard password
zidorouter serve [PORT] [HOST]  # default: 8764 on 127.0.0.1

Running as a service (systemd)

[Unit]
Description=ZidoRouter
After=network.target

[Service]
ExecStart=/usr/bin/env zidorouter serve 8764
Restart=always

[Install]
WantedBy=multi-user.target

Notes

State lives in ~/.zidorouter/ (keys, aliases, audit log, metrics). Back that folder up and you can move the whole gateway to a new machine in minutes.

Metadata

Release files for zidorouter 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zidorouter 1.0.0
File Size Uploaded
zidorouter-1.0.0.tar.gz 42.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zidorouter 1.0.0
File Interpreter ABI Platform
zidorouter-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 89.2 kB

Release files / zidorouter-1.0.0.tar.gz

Download URL zidorouter-1.0.0.tar.gz
Size 42.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bec08f180c2c3e430e4bfb6c3f2d744838226c76f9dc1428ee8d97a80e206699
BLAKE2b-256 checksum
How to use checksums
8935dee4037c24ae649ec18d4ade947b67d1d2e70acd9f53d1f3aff57ce0b65b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / zidorouter-1.0.0-py3-none-any.whl

Download URL zidorouter-1.0.0-py3-none-any.whl
Size 46.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b77a2a9ba8c9751627943fe867084d1852c9ef55f0637ae3f860b97dae50b27c
BLAKE2b-256 checksum
How to use checksums
c18073b084b568b0dcc7e4858d063c18e7c9fa9c6f5df4ddd4ecf1ccbaec679c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page