# llm-as-a-verifier/turboagent — AlpLab Radar Static Code Audit

- Ring: `trial`
- Category: `dev`
- Overall score: `3.5/5`
- Implementation check: `verified`
- Maturity: `early`
- Audited commit: `31ea8dadc002` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-01T20:26:55Z
- Repository: https://github.com/llm-as-a-verifier/turboagent
- Radar entry: https://radar.alplab.co/#repo/llm-as-a-verifier/turboagent
- License: `Apache-2.0`
- Tags: `llm-proxy`, `best-of-n`, `llm-as-a-verifier`, `logprob-reward`, `fastapi`, `coding-agents`

## Summary

A FastAPI-based LLM API proxy (turbo-agent) that fans out N concurrent candidate completions via litellm, selects the best candidate through the llm-verifier package's Probabilistic Pivot Tournament scored on token logprobs, and serves both Anthropic (/v1/messages) and OpenAI (/v1/chat/completions, /v1/models) formats with SSE replay plus a React/dagre DAG visualizer of every request pipeline.

## Implementation Check

Every core README claim maps to working code: concurrent fan-out in turbo_agent/proxy/backend.py (_gather_completions over _model_entries with num_candidates), pivot-tournament selection in turbo_agent/verifier/verifier.py (Verifier.select_best delegating to llm_verifier.select with pivots/seed/criteria plus _try_majority_voting), context refinement in turbo_agent/context/refiner.py (ContextRefiner.refine), post-hoc progress scoring in turbo_agent/progress_monitor/monitor.py (llm_verifier.track spawned via Backend._spawn_progress), dual-format routing and SSE replay in turbo_agent/proxy/proxy.py and backend.py, Claude-verifier rejection in turbo_agent/utils/verifier_client.py (_ensure_verifiable), and the visualizer backend/frontend in turbo_agent/visualizer.py and frontend/src/visualizer/ui/.

## When to Use

Use when you route a coding agent (Claude Code, opencode, Codex) through a local proxy and want best-of-N response selection — accepting N× token cost, single-burst instead of token-streamed replies, and a logprob-capable verifier key (Vertex AI, DeepSeek, or a local vLLM/SGLang server). Not for latency- or cost-sensitive workloads, streaming-heavy UX, or any multi-user/LAN-exposed deployment.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.0/5 |
| usability | 4.0/5 |
| reliability | 2.5/5 |
| security | 3.0/5 |
| integration | 4.0/5 |

## Code Evidence

turbo_agent/proxy/backend.py Backend._gather_completions gathers num_candidates-per-model entries concurrently with asyncio.gather(return_exceptions=True) and _pick_best feeds Backend.format_history/format_action strings into Verifier.select_best, falling back to the first valid response on verifier failure; turbo_agent/verifier/verifier.py Verifier.select_best short-circuits on _try_majority_voting (strict majority of identical actions) then runs llm_verifier.select in asyncio.to_thread with pivots/n_evaluations/seed/criteria and reconstructs per-pair Comparison records from the score cache via directed_reward; turbo_agent/utils/verifier_client.py build_verifier_client routes deepseek//openai+base_url/gemini prefixes to the right llm-verifier client and raises ValueError for anthropic/ verifiers (no logprobs); turbo_agent/proxy/proxy.py ProxyServer._proxy dispatches /v1/messages and /v1/chat/completions to backend paths and everything else to _handle_upstream passthrough to api.anthropic.com; turbo_agent/utils/conversion.py AnthropicToOpenAI/OpenAIToAnthropic implement full message/tool-call/tool-result conversion both ways and SSE replay paths (_replay_anthropic_sse, _replay_openai_sse) re-emit a chosen non-streaming candidate as stream events; backend.py _sanitized_config masks api_key as '***' in request logs and check_api_key.py _redact strips secret-looking strings from its report; turbo-agent.yaml provides a commented reference config wired to Config properties (verifier_config, progress_monitor_config, context_config) in turbo_agent/utils/config.py.

## Issues Found

turbo_agent/cli.py binds uvicorn to host 0.0.0.0 by default while logging 'Listening on http://localhost:{port}' — key-backed generation, the unauthenticated visualizer, and the unauthenticated catch-all upstream passthrough (proxy.py _handle_upstream forwards client headers to api.anthropic.com) are all reachable from the LAN with no auth. turbo_agent/visualizer.py serve_visualizer joins the unvalidated /visualizer/{path:path} URL segment with os.path.join(_static_dir, path) and no '..' normalization before os.path.isfile/open — a likely path-traversal arbitrary-file-read if reachable. turbo_agent/proxy/backend.py _setup_env writes each model's api_key into process-global os.environ keyed by provider prefix, so two models on the same provider with different keys silently collide (last one wins) and exported shell keys get overwritten. Test suite covers only verifier-client routing — none of the proxy, SSE, conversion, or backend pipeline paths are tested, and there is no CI.

## Key Risks

Nothing was executed — 'tests exist' (tests/test_verifier_client.py, 7 no-network tests covering only verifier-client routing and config base_url resolution) is not 'tests pass', and there is no CI config in the repo. The verifier core (pivot tournament, fine-grained logprob reward) is delegated entirely to the external llm-verifier dependency, so its correctness could not be audited here. Visualizer requires a Node/yarn build (turbo_agent/visualizer-dist is gitignored and not present at this commit). Quality-improvement claims (best-of-N beats single-shot) are empirical and unverifiable statically. The proxy is designed as a single-user local tool: no authentication on any endpoint and full prompt/response request logs written to .turbo-agent/ on disk.

## Reviewed Files

- `README.md`
- `pyproject.toml`
- `.env.example`
- `.gitignore`
- `turbo-agent.yaml`
- `turbo_agent/__main__.py`
- `turbo_agent/cli.py`
- `turbo_agent/visualizer.py`
- `turbo_agent/check_api_key.py`
- `turbo_agent/proxy/backend.py`
- `turbo_agent/proxy/proxy.py`
- `turbo_agent/verifier/verifier.py`
- `turbo_agent/context/refiner.py`
- `turbo_agent/progress_monitor/monitor.py`
- `turbo_agent/utils/__init__.py`
- `turbo_agent/utils/config.py`
- `turbo_agent/utils/conversion.py`
- `turbo_agent/utils/llm.py`
- `turbo_agent/utils/logging_utils.py`
- `turbo_agent/utils/request_log.py`
- `turbo_agent/utils/sse.py`
- `turbo_agent/utils/verifier_client.py`
- `tests/test_verifier_client.py`
- `frontend/index.html`
- `frontend/package.json`
- `frontend/vite.config.ts`
- `frontend/src/visualizer/ui/App.tsx`
- `frontend/src/visualizer/ui/types.ts`
- `frontend/src/visualizer/ui/components/DAGView.tsx`
- `frontend/src/visualizer/ui/utils/buildGraph.ts`
