Skip to main content

An LLM API proxy that improves response quality through concurrent inference, pivot-tournament verification, and context refinement.

Project description

Turbo Agent

Turbo Agent visualizer

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 .

API keys

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 with the script:

python check_api_key.py

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

turbo_agent-0.1.1.tar.gz (161.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

turbo_agent-0.1.1-py3-none-any.whl (164.5 kB view details)

Uploaded Python 3

File details

Details for the file turbo_agent-0.1.1.tar.gz.

File metadata

  • Download URL: turbo_agent-0.1.1.tar.gz
  • Upload date:
  • Size: 161.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for turbo_agent-0.1.1.tar.gz
Algorithm Hash digest
SHA256 00fd89c1b6772e52f8f94a9f994cb1c2985527cb8b95cbb823b680c07e146d13
MD5 3219b0ffdaab830f2430fb221d51eb36
BLAKE2b-256 15b0a013fbdde1361c35e7e284419b0d52e51725c6cf6a315b54ec15f011a6cd

See more details on using hashes here.

File details

Details for the file turbo_agent-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: turbo_agent-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 164.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for turbo_agent-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb9a8c2fd5d43f26fe5c3d03d9666b4ede4c44e69c91fd112b0d46f184413e3
MD5 c219d05f7a4cfdb18da0350c8b62bed8
BLAKE2b-256 86ff0252f24a492c610f671e90c98b35fbe9a5f320e55c87af6e098d93af1717

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page