Phase 6 — Go live
Time: ~30 minutes (cutover) + monitoring period
Prerequisites: Phase 5 complete (resolve, routes, policies, and UI all working with the feature flag on in development)
You'll need: Access to your deployment pipeline, monitoring/logging, the Dashboard
This phase moves your Restormel Keys integration from development into production traffic. The strategy is conservative: parallel run, phased traffic shift, verify, then cut over fully. By the end, your production app resolves through Restormel and the legacy routing code is retired.
Step 6.1 — Pre-cutover checklist
Before enabling the feature flag in production, verify everything works in a staging or preview environment.
| Check | How to verify | Pass? |
|---|---|---|
| Resolve works | USE_RESTORMEL_KEYS=true in staging; make AI requests; confirm correct provider/model | ☐ |
| Fallback works | Remove a provider credential in dashboard; confirm resolve returns next step | ☐ |
| Policy enforcement works | Request a blocked model; confirm it's rejected or falls through | ☐ |
| Error fallback works | Set invalid Gateway Key; confirm legacy routing takes over | ☐ |
| ModelSelector renders | Open settings page; confirm component loads and selection works | ☐ |
| (If BYOK) KeyManager works | Add/remove a test key; confirm callbacks fire | ☐ |
keys doctor passes | Run npx @restormel/doctor in the staging env | ☐ |
keys validate passes | Run npx @restormel/validate to re-check stored keys | ☐ |
| No secrets committed | Run scripts/check-secrets.sh or git log --diff-filter=A -- '*.env' | ☐ |
| Dashboard logs show requests | Check the project's usage/logs section in the dashboard | ☐ |
| Observed model matches actual route | Verify/learn/extract metadata reflects the resolved model, not a hardcoded label | ☐ |
Step 6.2 — Enable the flag for a small percentage (parallel run)
If your app supports percentage-based rollout (e.g. via LaunchDarkly, Vercel Edge Config, Cloudflare Workers, or a simple random check), start with a small percentage of traffic using Restormel.
const RESTORMEL_ROLLOUT_PERCENT = parseInt(
process.env.RESTORMEL_ROLLOUT_PERCENT ?? '0',
10
);
export const USE_RESTORMEL_KEYS =
process.env.USE_RESTORMEL_KEYS === 'true' ||
(RESTORMEL_ROLLOUT_PERCENT > 0 && Math.random() * 100 < RESTORMEL_ROLLOUT_PERCENT);Rollout sequence:
| Step | RESTORMEL_ROLLOUT_PERCENT | What to watch |
|---|---|---|
| 1 | 5 | Errors in logs, latency increase, correct provider in responses |
| 2 | 25 | Same, at higher volume |
| 3 | 50 | Compare Restormel path vs legacy path outcomes |
| 4 | 100 | Full traffic through Restormel |
If you don't have percentage-based rollout, use the boolean flag: USE_RESTORMEL_KEYS=true for the full cutover (Step 6.3).
You'll see
A mix of requests going through Restormel (your app logs include providerType / modelId from resolve) and legacy. The ratio roughly matches your rollout percentage.
How to test
Check your application logs. Requests that went through Restormel log the resolved provider and source. Requests that went through legacy log the legacy provider. Both succeed without user-facing errors.
Step 6.3 — Full cutover
When you're confident from the parallel run, enable Restormel for all traffic:
# In your production environment variables
USE_RESTORMEL_KEYS=true
RESTORMEL_ROLLOUT_PERCENT=100 # if using percentage-based rolloutDeploy the env change. Monitor for 15–30 minutes.
You'll see
All AI requests resolve through Restormel. Your logs show the resolved providerType / modelId for every request. The dashboard shows request volume in the project's usage section.
How to test
Verify no requests are going through legacy (e.g. grep -c '"source":"legacy"' /path/to/your/app.log — expected 0). Check the dashboard: Projects → your project → Usage. Request counts match your expected traffic.
false and instantly restore the old behaviour.Step 6.4 — Post-cutover verification
Run a comprehensive check within the first hour after cutover.
CLI checks:
npx @restormel/doctor
npx @restormel/validateDashboard checks: Usage (request count non-zero and growing, no error spikes); Routes (traffic against configured routes); Policies (no unexpected violations); Provider credentials (all show "valid").
Application checks: Make a request through each major code path; confirm correct provider and model. Test fallback (temporarily remove a provider credential, confirm next step is used, restore). Test a policy block (request a model not on the allowlist). Check latency; resolve adds a network round-trip (typically <100ms).
Smoke test script: Create a script that (1) calls the resolve endpoint and prints provider, model, explanation; (2) calls the policy evaluate endpoint for an allowed model; (3) runs keys doctor. Use RESTORMEL_GATEWAY_KEY from the environment; never hardcode secrets.
Implementors: See “Agent prompts for this phase” below for a ready-to-run smoke-test prompt.
Step 6.5 — Remove legacy routing code
Once you're confident Restormel is handling all traffic correctly (at least one full release cycle with the flag at 100%), clean up:
- Remove the feature flag. The Restormel path is now the only path.
- Remove the legacy resolve function. The legacy fallback in your resolve module is no longer needed.
- Remove the inventory items marked "REMOVE" in Phase 0. Custom router, hardcoded model lists, custom fallback chains, custom model picker UI.
- Remove unused env vars. Any
DEFAULT_MODEL,AI_PROVIDER, or provider-specific routing env vars that Restormel replaces. - Keep the error fallback to a sensible default. Your resolve wrapper should still handle Restormel errors gracefully (e.g. return a hardcoded default or a user-facing error).
Implementors: See “Agent prompts for this phase” below for a post-burn-in cleanup prompt.
Prompts for this phase
These are optional and collapsed by default. Use them if you're implementing Phase 6 with a coding agent.
Checkpoint checklist: mark each step complete as you finish it.
Checklist
Checkpoint
You now have: production traffic resolving through Restormel Keys; a smoke test script for ongoing verification; (after Step 6.5) legacy routing code removed and Restormel as the single source of truth; the dashboard showing live traffic, route usage, and policy enforcement.
Your integration is complete. For ongoing operations, see Verification strategy.