Unified LLM usage management — API proxy, session diagnostics, multi-CLI orchestration. Mirror Agent open-network DLC.
Project description
llm-relay
Unified LLM usage management — API proxy, session diagnostics, multi-CLI orchestration.
Features
- Proxy: Transparent API proxy with cache/token monitoring and 12-strategy pruning
- Detect: 8 detectors (orphan, stuck, inflation, synthetic, bloat, cache, resume, microcompact)
- Recover: Session recovery and doctor (7 health checks)
- Guard: 4-tier threshold daemon with dual-zone classification
- Cost: Per-1% cost calculation and rate-limit header analysis
- Orch: Multi-CLI orchestration (Claude Code, Codex CLI, Gemini CLI)
- Display: Multi-CLI session monitor with provider badges and liveness detection
- MCP: 7 tools via stdio transport (cli_delegate, cli_status, cli_probe, orch_delegate, orch_history, relay_stats, session_turns)
Install
# CLI only (diagnostics, recovery, orchestration)
pip install llm-relay
# With proxy + web dashboard
pip install llm-relay[proxy]
# With MCP server (Python 3.10+)
pip install llm-relay[mcp]
# Everything
pip install llm-relay[all]
Quick Start
CLI diagnostics (no server needed)
llm-relay scan # Session health check (8 detectors)
llm-relay doctor # Configuration health check (7 checks)
llm-relay recover # Extract session context for resumption
Web dashboard
# Option 1: Direct
pip install llm-relay[proxy]
uvicorn llm_relay.proxy.proxy:app --host 0.0.0.0 --port 8083
# Option 2: Docker
cp .env.example .env # Edit as needed
docker compose up -d
Then open:
/dashboard/— CLI status, cost, delegation history/display/— Turn counter with CC/Codex/Gemini session cards
MCP server
llm-relay-mcp # stdio transport, 7 tools
API proxy for Claude Code
# Set in Claude Code
export ANTHROPIC_BASE_URL=http://localhost:8080
CLI Status
| CLI | Status |
|---|---|
| Claude Code | Fully supported |
| OpenAI Codex | Fully supported |
| Gemini CLI | Display supported, oauth-personal has known 403 server-side bug (#25425) |
Requirements
- Python >= 3.9
- MCP tools require Python >= 3.10
License
MIT
Ecosystem
Part of the QuartzUnit open-source ecosystem.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_relay-0.3.0.tar.gz.
File metadata
- Download URL: llm_relay-0.3.0.tar.gz
- Upload date:
- Size: 120.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f0f16d8f30c1946192ea8601c7ccfdff628c5191be87f4db669cfc70b02285a
|
|
| MD5 |
de9a2703787070160aadf0c02c2952a4
|
|
| BLAKE2b-256 |
746393b47e43de2a1f22ed443f0e6b1c5b41f17da59f251b3902f8136fffdf50
|
Provenance
The following attestation bundles were made for llm_relay-0.3.0.tar.gz:
Publisher:
publish.yml on QuartzUnit/llm-relay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_relay-0.3.0.tar.gz -
Subject digest:
8f0f16d8f30c1946192ea8601c7ccfdff628c5191be87f4db669cfc70b02285a - Sigstore transparency entry: 1304110793
- Sigstore integration time:
-
Permalink:
QuartzUnit/llm-relay@4305ada924da40a57c2e4c56ae4da517537797ec -
Branch / Tag:
refs/heads/main - Owner: https://github.com/QuartzUnit
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4305ada924da40a57c2e4c56ae4da517537797ec -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file llm_relay-0.3.0-py3-none-any.whl.
File metadata
- Download URL: llm_relay-0.3.0-py3-none-any.whl
- Upload date:
- Size: 111.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56ed93edb38bc209c9ae475fb117a511d2e39cb7dfb25ef6c75fe2a34913fa4d
|
|
| MD5 |
3ffabe9d5cde3783f431e3c83f23df67
|
|
| BLAKE2b-256 |
5e3efcf514b98b5c0b62b2a0e639363db51db8f93d578130619e5a21e29147e4
|
Provenance
The following attestation bundles were made for llm_relay-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on QuartzUnit/llm-relay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_relay-0.3.0-py3-none-any.whl -
Subject digest:
56ed93edb38bc209c9ae475fb117a511d2e39cb7dfb25ef6c75fe2a34913fa4d - Sigstore transparency entry: 1304110924
- Sigstore integration time:
-
Permalink:
QuartzUnit/llm-relay@4305ada924da40a57c2e4c56ae4da517537797ec -
Branch / Tag:
refs/heads/main - Owner: https://github.com/QuartzUnit
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4305ada924da40a57c2e4c56ae4da517537797ec -
Trigger Event:
workflow_dispatch
-
Statement type: