Introduction
Repath is a transparent proxy that sits between your application and any LLM provider. It enables progressive delivery for AI — the same canary deployment patterns used for traditional software, but adapted for the non-deterministic world of LLMs.
When you change a prompt or switch model versions, Repath routes a small percentage of traffic to the new version, evaluates response quality with an AI judge, and automatically promotes or rolls back based on your thresholds — before users notice anything is wrong.
How it works
- Point your app at Repath — change one line (your base URL)
- Create a rollout — define baseline vs candidate version, traffic split, and quality thresholds
- Repath splits traffic — routes X% to candidate, rest to baseline
- LLM Judge scores responses — evaluates every response async (~120ms), zero latency added
- Controller decides — every 30 seconds, checks rolling scores. Quality holds → advance. Quality drops → rollback
Quick Start
Get Repath running in under 5 minutes. You need an account and an OpenAI API key.
1. Sign up and get your gateway URL
After signing up at tryrepath.com/signup, your dashboard shows your unique gateway URL:
2. Change one line in your app
Vercel AI SDK
The AI SDK talks the OpenAI wire protocol, so it needs the same two changes. Streaming works — Repath forwards every SSE chunk to your app as it arrives and evaluates the assembled response afterwards, so streamText stays token-by-token.
OpenRouter, Anthropic and Gemini
Point the same client at Repath and name the provider’s model. For Anthropic, Repath translates the request and response between the OpenAI and Anthropic formats, so your OpenAI client keeps working unchanged. Store that provider’s key under Settings → Provider API Keys first, and Repath uses it instead of forwarding yours.
3. Create your first rollout
Go to your dashboard → Rollouts → New Rollout. The form maps one-to-one onto this rollout definition:
Integration
Supported providers
| Provider | Base URL to use | Notes |
|---|---|---|
| OpenAI | https://api.tryrepath.com/v1 | Drop-in replacement |
| Anthropic | https://api.tryrepath.com/v1 | Request translation automatic |
| Google Gemini | https://api.tryrepath.com/v1 | Via OpenAI-compat endpoint |
| OpenRouter | https://api.tryrepath.com/v1 | Auto-failover hub |
| Vercel AI Gateway | https://api.tryrepath.com/v1 | One key, every vendor (e.g. openai/gpt-6-luna) |
| Other models | https://api.tryrepath.com/v1 | Through OpenRouter (e.g. x-ai/grok-4.7); custom endpoints on private deployments |
Specifying which model to use
Pass the model in the request body as normal. Repath sends it to the model's own provider:claude-* to Anthropic (with the request format translated), gemini-* to Google, a vendor-prefixed id like x-ai/grok-4.7 to OpenRouter, and everything else to OpenAI. Your provider key goes in Authorization as usual.
Sending traffic to a rollout
Name the rollout in the X-Repath-Rollout header, by name or id. Repath then chooses the baseline or the candidate for each request, and the rollout's own model and prompt apply. Without the header, a request uses your most recently started rollout, if any.
Core Concepts
Rollout
A controlled experiment comparing a baseline version against a candidate version. Has a lifecycle: created → canary → promoted (or rolled_back).
Version
A specific combination of model + prompt + parameters. Immutable — each change creates a new version.
Evaluation
A quality score for a single response. Computed by the LLM judge (async) or programmatic checks.
Quality gate
A threshold that traffic must pass before advancing. E.g. `quality_score >= 0.85` to move from 25% to 50%.
Decision
An action taken by the controller: advance, rollback, pause, or promote. Every decision is logged.
Tenant
Your account. In cloud mode, each tenant gets isolated routing, storage, and billing.
Creating a Rollout
A rollout has three required fields: baseline, candidate, and strategy.
Traffic Splitting
Weights
Traffic weight is a float from 0.0 to 1.0. A weight of 0.10 routes 10% of requests to the candidate.
Sticky sessions
Pass X-User-Id or X-Session-Id in your requests. Repath uses consistent hashing so the same user always sees the same version during a rollout — no jarring switches mid-conversation.
Quality Gates
The controller checks every rollout every 30 seconds against the last 10 minutes of judged traffic. It advances to the next step when the candidate's judged quality meets the gate, its error rate is under the ceiling and the step's minimum duration has passed. It rolls back the moment quality falls below the rollback trigger.
policy.min_samples while traffic is light.Shadow Mode
type: shadow rather than silently running a canary. For the lowest-risk start today, use a canary with a small first step, such as 1% or 5%.LLM-as-Judge: How It Works
After every proxied request, Repath enqueues the request/response pair to a Redis Stream. Python evaluation workers consume from this stream and score the response using an LLM judge. This is fully asynchronous — evaluation never blocks or slows your actual requests.
↓ async (non-blocking)
Redis Stream → Evaluator → LLM Judge → Score → DB
Evaluation latency: ~120ms. User-visible latency added: 0ms.
Evaluation Criteria
The judge scores every sampled response against three criteria, each rated 1–5 and normalized to 0–1. Each score comes with a one-sentence reason, which you can read for any request in the request log.
| Criterion | Weight | What the judge is asked |
|---|---|---|
| helpfulness | 0.5 | Does the response directly answer the question with specific, actionable information? |
| accuracy | 0.3 | Is the response factually correct and free from hallucinations? |
| clarity | 0.2 | Is the response clear, well organized and easy to follow? |
The Judge Model
Every judged request is scored by gpt-6-luna, the same judge for every account, so a score of 0.82 means the same thing in every rollout you run. The judge is independent of the models you are comparing: your baseline and candidate can be any provider and any model. It runs through the Vercel AI Gateway, so one vendor's outage or billing issue cannot stop judging.
Composite Scoring
The overall quality score is a weighted average of all criteria scores:
Auto-Rollback: How It Works
The Repath controller runs on a 30-second tick. On each tick, it queries the rolling 10-minute average quality score for the candidate version. If the score falls below the rollback threshold, it immediately sets candidate weight to 0%, writes a rollback decision to the audit log, and updates the routing config.
Timeline after a quality drop:
- Bad response evaluated by judge (~120ms after response)
- Score written to PostgreSQL
- Controller tick runs (max 30s wait)
- Rolling average computed, threshold exceeded
- Rollback decision written, config updated
- Gateway reads new config (within 5s via cache refresh)
- 100% traffic back to baseline
Total time from quality drop to full rollback: typically 35–60 seconds.
Rollback Configuration
Rollback is immediate: within one controller cycle the candidate gets 0% of traffic, and every rollback is recorded with the metrics that caused it. To be told when it happens, add a Slack webhook or email address in Settings → Notifications, or a signed webhook in Settings → Webhooks. Those apply to all of your rollouts.
Audit Trail
Every advance and rollback decision is stored in the decisions table with the exact scores that triggered it. View via the dashboard or API:
Provider Failover
When a provider returns 5xx errors or times out, Repath automatically retries once (after 300ms) then switches to the next provider in your fallback chain. Your app never sees the outage.
X-Repath-Bypass: true with a 503, rather than silently degrading your traffic. Handling that header to retry directly against your provider is a few lines in your client — a drop-in wrapper is on the roadmap.Failover Configuration
In Settings → Providers, save a key for each provider you want to fail over to, then order them in the failover chain (up to four). When your primary returns a 5xx or 429, Repath retries once, then walks the chain in order.
A fallback provider cannot serve the model you asked the primary for, so Repath picks the current model of the same size there. A nano request never starts billing at flagship rates, and a flagship request is never answered by a nano model:
| You asked for | Anthropic fallback | Gemini fallback | OpenAI fallback |
|---|---|---|---|
| A small model (mini, nano, lite, haiku) | claude-haiku-4-5 | gemini-3.5-flash-lite | gpt-5.4-mini |
| A standard model | claude-sonnet-5-5 | gemini-3.8-flash | gpt-5.4 |
| A flagship (pro, opus, astra) | claude-opus-5-5 | gemini-3.8-flash | gpt-5.5 |
OpenRouter and the Vercel AI Gateway need no mapping: Repath namespaces the model for them (gpt-5.4 becomes openai/gpt-5.4, and claude-sonnet-5-5 becomes anthropic/claude-sonnet-5.5, their spelling), which makes either a good last entry in the chain.
Circuit Breaker
The circuit breaker tracks error rates per provider per tenant. After 3 consecutive failures, it opens the circuit — all requests for that tenant bypass to the next provider in the chain. After a 5-second cooldown, one probe request is allowed through. If it succeeds, the circuit closes.
API Authentication
All management API endpoints require a Bearer token. Get yours from the dashboard under Settings → API Token.
/v1/*) does NOT require the API token — it uses your LLM provider key passed through from the request.Rollouts API
/api/v1/rolloutsList all rollouts/api/v1/rollouts/:idGet rollout detail + metrics/api/v1/rollouts/:id/metricsTime-series quality data (last 60 min)/api/v1/rollouts/:id/stepsStep list with status/api/v1/rollouts/:id/promoteManually promote to 100%/api/v1/rollouts/:id/rollbackImmediately roll back to baselineDecisions API
Webhooks
Repath can POST to your endpoint on rollout events. Configure in your rollout YAML or dashboard:
Webhook payload:
X-Repath-Signature header against your webhook secret to ensure authenticity.Last updated October 2026