zrouter — NVIDIA Free-Model Router
Enterprise-grade OpenAI-compatible proxy/router for NVIDIA's hosted NIM endpoints (https://integrate.api.nvidia.com/v1).
Features
- Free-only allowlist — Only free models are ever called; paid models are refused
- Multi-key rotation — On HTTP 429, the key is benched and the same model is retried on the next key
- Per-key rate limiting — Token-bucket style rate limiter per API key
- Exponential backoff — Per (key, model) pair backoff on failures
- Auto routing — Classifies prompts into general/code/reasoning/fast/vision routes
- Streaming (SSE) — With failover before the first byte
- Response caching — For temperature == 0, no tools, non-stream requests
- Persistent stats — Per model / per key: ok, fail, 429, latency
- OpenAI-compatible proxy — Point any OpenAI client at it
- CLI —
chat,list,probe,stats,keys,serve,models,discover,providers - GUI — Tkinter-based desktop GUI (
zcloud-gui.py) - TUI — Textual-based terminal UI (
zcloud-tui.py)
Quick Start
Prerequisites
- Python 3.10+
- At least one NVIDIA API key (get free keys at https://build.nvidia.com)
Installation
From PyPI
pip install zrouter
From Source
git clone https://github.com/cvsz/zrouter.git
cd zrouter
python -m venv .venv
source .venv/bin/activate
pip install -e .
Docker
docker build -t zrouter .
docker run -d \
--name zrouter \
-p 8000:8000 \
-e NVIDIA_API_KEYS="nvapi-xxx,nvapi-yyy" \
zrouter:latest
Usage
CLI
# Set your API key(s)
export NVIDIA_API_KEYS="nvapi-xxx,nvapi-yyy"
# List available models
python nvidia.py list
# Chat with auto-routing
python nvidia.py chat "write a regex for emails"
# Chat with specific route
python nvidia.py chat "explain TCP slow start" --route reasoning --stream
# Run the OpenAI-compatible proxy
python nvidia.py serve --port 8000 --token secret
GUI
python zcloud-gui.py
TUI
python zcloud-tui.py
Docker
docker run -d \
--name zrouter \
-p 8000:8000 \
-e NVIDIA_API_KEYS="nvapi-xxx,nvapi-yyy" \
zrouter:latest
Then point your OpenAI client at http://localhost:8000/v1.
Configuration
| Environment Variable | Default | Description |
|---|---|---|
NVIDIA_API_KEYS |
(required) | Comma-separated API keys |
NVIDIA_BASE_URL |
https://integrate.api.nvidia.com/v1 |
NVIDIA NIM API base URL |
NVIDIA_RPM |
35 | Per-key requests per minute |
NVIDIA_CACHE_TTL |
3600 | Cache TTL in seconds |
NVIDIA_TIMEOUT |
90 | Request timeout in seconds |
NVIDIA_MAX_WAIT |
60 | Max wait when all keys limited |
NVIDIA_ROUTER_CONFIG |
— | Path to router.json config |
NVIDIA_ROUTER_HOME |
~/.nvidia_free_router |
Stats directory |
ROUTER_TOKEN |
— | Bearer token for proxy auth |
Routes
| Route | Description |
|---|---|
auto |
Auto-classify the prompt |
general |
Everyday questions |
code |
Code / debugging / regex / SQL / git |
reasoning |
Maths, logic, step-by-step, long prompts |
fast |
Short prompts, smallest models |
vision |
Messages containing images |
License
MIT License# Auto-generated build timestamp Sun Nov 15 23:52:59 +07 2026
Metadata
Release files for zrouter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zrouter-1.0.0.tar.gz | 22.3 kB | Without provenance | Details for zrouter-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zrouter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for zrouter-1.0.0-py3-none-any.whl |
Total release size: 43.5 kB
Release files / zrouter-1.0.0.tar.gz
| Download URL | zrouter-1.0.0.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c342c9c2c3148976a229dffa26fe6c7aafafddb73e8e894248fd44e18f8174f
|
|
BLAKE2b-256 checksum How to use checksums |
e418d740c5202005384e4b9dd32b6eedd850847fe52990f1985bf79314ed72c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / zrouter-1.0.0-py3-none-any.whl
| Download URL | zrouter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 21.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f48fb84c8a903fe88b62596a21b8e827b87b447a94144e004cb525b639a11a2
|
|
BLAKE2b-256 checksum How to use checksums |
f43ea64cf56cc3ae0f8e5d1828dd82d7d489019b1578523eb8026b4f1bcb9fcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for zrouter 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.