An LLM API proxy that improves response quality through concurrent inference, pivot-tournament verification, and context refinement.
Project description
Turbo Agent
Turbo Agent is the Claude Code plugin for LLM-as-a-Verifier. It implements an LLM API proxy that improves response quality through concurrent inference, verification, and refinement. It sits between your client (Claude Code, Codex, etc.) and the LLM provider, sending multiple parallel requests and selecting the best response with a Probabilistic Pivot Tournament (PPT) scored by a fine-grained logprob verifier.
Client request
│
[Context Refinement] (optional) rewrite/augment the system prompt for clarity
│
[Concurrent Inference] send N parallel candidates to the backend model
│
[Verification] pivot tournament over the candidates, pick the best one
│
Best response → Client
Verification uses the pivot tournament from the llm-verifier package to pick the best of N candidates.
Install
pip install turbo-agent
Or from source:
pip install -e .
Setup
For turbo agent to work, you need a turbo-agent.yaml. You can copy the reference file in this repo.
turbo-agent.yaml references keys with $VAR_NAME syntax. The recommended way to provide them is a .env file in the project root (next to turbo-agent.yaml) — the proxy loads it automatically on startup. Copy the committed template and fill in your keys:
cp .env.example .env
# then edit .env
# .env
VERTEX_API_KEY=your-vertex-key # preferred for Gemini 2.5 logprobs (verifier)
# GEMINI_API_KEY=your-gemini-key # used by gemini/ models (AI Studio)
# OPENAI_API_KEY=... # only if you route to openai/ models
# ANTHROPIC_API_KEY=... # only if you route to anthropic/ models
.env is gitignored; .env.example is committed as the template. Keys already
exported in your shell environment work too and take nothing extra. The verifier
and progress monitor use Gemini logprobs, which are best served by a Vertex
AI key (VERTEX_API_KEY + provider: vertex_ai in the config); a plain
GEMINI_API_KEY also works for the gemini/ backend models.
Verify your keys are valid:
turbo-agent check
It checks every supported provider (Gemini, Vertex AI, OpenAI, Anthropic) and reports each with ✅ / ❌ / ⚠️ / ⚪️, flagging which keys your config actually uses.
Run
turbo-agent # default port 8888
turbo-agent -p 9000 # custom port
Use with Claude Code
ANTHROPIC_BASE_URL=http://localhost:8888 claude
Use with OpenAI-compatible clients
export OPENAI_API_BASE=http://localhost:8888/v1
Configuration
Edit turbo-agent.yaml. API keys can reference environment variables with $VAR_NAME syntax. See the reference turbo-agent.yaml file for reference and usage.
Model prefixes
| Prefix | Provider |
|---|---|
gemini/ |
Google Gemini |
openai/ |
OpenAI |
anthropic/ |
Anthropic |
| (none) | OpenAI-compatible endpoint |
API endpoints
| Endpoint | Format |
|---|---|
POST /v1/messages |
Anthropic |
POST /v1/chat/completions |
OpenAI |
GET /v1/models |
OpenAI |
GET /visualizer |
Pipeline visualizer UI |
* |
Upstream passthrough to api.anthropic.com |
Visualizer
A built-in web UI at http://localhost:8888/visualizer shows the pipeline DAG for each request — context refinement, all candidate responses, the pairwise tournament comparisons and scores, and the final selection.
To build the frontend (requires Node.js):
cd frontend
yarn install
yarn build
Publish to PyPI
cd frontend && yarn build && cd ..
pip install build twine
rm -rf dist
python -m build
twine check dist/*
twine upload dist/*
Project details
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 turbo_agent-0.1.3.tar.gz.
File metadata
- Download URL: turbo_agent-0.1.3.tar.gz
- Upload date:
- Size: 164.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50b7a38e4d3b9662397f68560d2f1be4e783e064909c3c64f1ba5ffc890c1414
|
|
| MD5 |
d6e4f84b357b5d0ea5259b4b0bf89542
|
|
| BLAKE2b-256 |
cc6bd18bef9790b0f70d43a3bff5745b537d4a9c08c235d5b6e8f47526c89cab
|
File details
Details for the file turbo_agent-0.1.3-py3-none-any.whl.
File metadata
- Download URL: turbo_agent-0.1.3-py3-none-any.whl
- Upload date:
- Size: 168.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f844d6b91092db682b98dcff971f978813fc2bbd2b67ed6e42d810197aaf8524
|
|
| MD5 |
1477a4abc91f82971a772e6882e9df2d
|
|
| BLAKE2b-256 |
1af11aa53776e3cc05f37fa837f43c27ebe593f0e047513b6facf269c81ff7a6
|