Gateway

What Is Blue-Green Deployment?

A gateway release pattern that swaps traffic between stable and candidate LLM paths after the candidate passes quality and health gates.

What Is Blue-Green Deployment?

Blue-green deployment for LLM systems is a gateway release pattern that keeps two complete production-ready paths: blue for the current model, prompt, tools, routing policy, and guardrails, green for the candidate version. Traffic stays on blue until green passes production-like checks, then the gateway swaps requests to green. FutureAGI treats it as a controlled Agent Command Center route change, backed by trace fields, eval gates, latency and cost thresholds, and a clear rollback path.

Why it matters in production LLM/agent systems

LLM releases fail differently from standard service deploys. A new model can return HTTP 200 while changing tool arguments, breaking JSON shape, increasing token use, or lowering task completion for one customer workflow. A blue-green release limits that risk by making the candidate path fully prepared before users move.

The production pain usually shows up as silent quality drift, not a crash. Developers see more parser errors, failed function calls, and retries. SREs see p99 latency climb because the green model reasons longer or a new prompt expands context. Product teams see thumbs-down rate and escalation rate rise after the switch. Compliance teams care when the green path changes post-guardrail behavior, logging policy, or PII handling.

This matters more for 2026-era agentic systems because one user request can contain planning, retrieval, tool selection, multiple model calls, and a final answer. Swapping only the model is not enough if the prompt version, tool schema, semantic-cache policy, and guardrail thresholds also changed. Blue-green deployment gives engineers an environment-level boundary: blue and green can each carry a complete gateway route, model version, prompt template, cache mode, and guardrail chain.

Unlike canary deployment, blue-green is not mainly about gradual exposure. It is about fast, reversible environment selection. Unlike traffic mirroring, the green response eventually serves users. The release is safe only if the gateway switch, observability filters, and rollback rule are defined before traffic moves.

How FutureAGI handles blue-green deployment

FutureAGI handles blue-green deployment through Agent Command Center routing policies, traceAI instrumentation, and regression evals. The gateway surface is gateway:*: a team creates a blue route for the current provider, model, prompt version, pre-guardrail, post-guardrail, semantic-cache setting, and model fallback chain, then creates a green route with the candidate stack.

A realistic workflow starts with traffic-mirroring from blue to green. The green path receives a sample of production prompts but does not return responses to users. Engineers compare blue and green outputs with TaskCompletion for agent outcomes, JSONValidation for structured responses, and Groundedness for RAG-backed answers. This is similar in spirit to LangSmith dataset comparison, but the switch decision in FutureAGI is tied to the live gateway route, not only an offline experiment run.

When green clears the regression gate, Agent Command Center changes the active routing policy from blue to green. FutureAGI records the route version, gen_ai.request.model, gen_ai.response.model, llm.token_count.prompt, fallback reason, cache hit state, latency, and eval result on the trace. If p99 latency, token-cost-per-trace, eval-fail-rate-by-cohort, or fallback count crosses the rollback threshold, the engineer flips the active route back to blue or uses model fallback for the affected segment.

FutureAGI’s approach is to make the release boundary observable. Blue and green are not just colors in CI; they are trace-filterable gateway paths with measurable quality, cost, latency, safety, and rollback evidence.

How to measure or detect it

Measure blue-green deployment as a route switch with prewritten acceptance and rollback criteria:

  • Route version and active color — every trace should carry the gateway route, policy version, and whether blue or green served the response.
  • Quality gate — compare green against blue using TaskCompletion, Groundedness, JSONValidation, or a custom rubric on mirrored or replayed traffic.
  • Gateway health — track p99 latency, timeout rate, retry rate, fallback count, and cache hit rate for the green route.
  • Cost drift — inspect llm.token_count.prompt, completion tokens, and token-cost-per-trace before keeping green active.
  • User impact proxy — watch thumbs-down rate, escalation rate, abandoned tasks, and manual overrides after the swap.
from fi.evals import TaskCompletion

metric = TaskCompletion()
result = metric.evaluate(
    input=trace.input,
    output=green_trace.output,
    expected=trace.expected_outcome,
)

A healthy green release passes the same eval threshold as blue and stays inside the latency, cost, safety, and fallback budgets for the served cohort.

Common mistakes

Most blue-green failures come from treating the swap as infrastructure-only.

  • Swapping the model but leaving prompt, tool schema, cache, or guardrail versions mixed across blue and green.
  • Calling green healthy because it returns HTTP 200. Check TaskCompletion, JSONValidation, latency, and token cost.
  • Running traffic mirroring without storing route version. The comparison becomes unusable when multiple experiments share traces.
  • Forgetting provider quota. A full green cutover can hit rate limits that a 1% canary never exposed.
  • Rolling back the model but not the prompt or guardrail. The old path must be a complete gateway route.

Frequently Asked Questions

What is blue-green deployment for LLM systems?

Blue-green deployment keeps two production-ready LLM paths: blue as the stable route and green as the candidate route. The gateway sends traffic to blue until green passes checks, then swaps traffic to green with a defined rollback path.

How is blue-green deployment different from canary deployment?

Canary deployment gradually exposes a small live cohort to the candidate route. Blue-green deployment prepares a full candidate environment and then switches traffic in one controlled gateway change.

How do you measure blue-green deployment?

Measure it with Agent Command Center route versions, trace fields such as gen_ai.request.model and llm.token_count.prompt, and eval gates such as TaskCompletion, Groundedness, and JSONValidation. Roll back when the green path breaches quality, latency, cost, or safety thresholds.