Hitesh Sahu
Hitesh SahuHitesh Sahu
  1. Home
  2. โ€บ
  3. posts
  4. โ€บ
  5. โ€ฆ

  6. โ€บ
  7. Agent DevOps

Loading โณ
Fetching content, this wonโ€™t take longโ€ฆ


๐Ÿ’ก Did you know?

๐Ÿฆฅ Sloths can hold their breath longer than dolphins ๐Ÿฌ.

๐Ÿช This website uses cookies

No personal data is stored on our servers however third party tools Google Analytics cookies to measure traffic and improve your website experience. Learn more

Loading โณ
Fetching content, this wonโ€™t take longโ€ฆ


๐Ÿ’ก Did you know?

๐Ÿฆˆ Sharks existed before trees ๐ŸŒณ.
AI-AgenticAI

    AI-AgenticAI
    • NVIDIA Agentic AI Professional Certification Path


    • Building Production-Ready Agentic AI Systems


    • Understanding Agentic AI Workflows


    • Understanding Agentic AI Memory


    • Evaluating Agentic AI Systems


    • Error Analysis in Agentic AI


    • Error Analysis for Agentic AI


    • Tool Use in Agentic AI


    • Code Execution in Agentic AI


    • Understanding the Model Context Protocol (MCP)


    • Optimizing Agentic AI Systems


    • Multi-Agent Systems in Agentic AI


    • Understanding Model Fusion in AI Systems


    • Deploying Agents at Scale


    • Deploying Agentic AI to Production


    • AI-AgenticAI Index


    AI-DeepLearning

    AI-GenAI

    AI-Infrastructure

    AI-Machine-Learning

    AI-Math

    AWS

    Azure

    kubernetes

    Management

    Programming

    Terraform

    Z_Appendix

Cover Image for Deploying Agentic AI to Production
AI-AgenticAI

Deploying Agentic AI to Production

Learn how to deploy Agentic AI systems to production using containerization, Kubernetes, inference services, observability, evaluation pipelines, guardrails, memory systems, and scalable orchestration. Explore best practices for reliability, fault tolerance, security, monitoring, and cost optimization when operating AI agents at scale.

Artificial Intelligence
Agentic AI
AI Agents
Production Deployment
MLOps
Kubernetes
โ† Previous

Deploying Agents at Scale

Next โ†’

NVIDIA Agentic AI Professional Certification Path

Deploying Agentic AI to Production

Deployment Strategies

1. Shadow Deployment ๐Ÿ‘ค

Deploy a new agent version alongside the production version and mirror real production traffic to it without exposing responses to users.

The shadow system receives the same requests as production but its responses are discarded.

Purpose:

  • Validate agent behavior on real traffic
  • Compare latency and cost
  • Detect hallucinations
  • Verify tool integrations
  • Measure reasoning quality
  • Test new prompts, models, or workflows safely

Architecture

flowchart TD

    User --> ProductionAgent

    User -. Mirrored Traffic .-> ShadowAgent

    ProductionAgent --> Response


    ProductionAgent --> Metrics
    ShadowAgent --> Metrics

    Metrics --> Dashboard

    ShadowAgent -. Discard Output .-> Trash[(Ignored)]

Benefits

  • Safe evaluation: Real-world testing with Zero user impact
  • Performance benchmarking across various models
  • Validation of tool integrations

Agentic AI Example

Current Production:

GPT-4.1 + ReAct

Shadow Deployment:

Llama Nemotron + ReWOO

Both receive identical requests.

Compare:

  • Task Success Rate
  • Hallucination Rate
  • Cost Per Request
  • Tool Usage Accuracy
  • Latency

Users only see production responses.

Shadow vs Canary

CanaryShadow
Real users see responsesUsers never see responses
Limited production exposureNo production exposure
Tests business impactTests technical behavior
Can affect usersZero user impact
Lower infrastructure costHigher infrastructure cost
Used before full rolloutUsed before canary

Production Flow

flowchart TD

    Code--> OfflineEvaluation --> ContainerBuild--> ShadowDeployment--> CanaryDeployment--> FullProduction

2. Canary Deployment ๐Ÿค

Gradually expose a new agent version to a small percentage of real users before rolling it out to everyone.

Unlike a shadow deployment, users actually receive responses from the new version.

The goal is to validate production behavior while limiting risk.

A canary deployment minimizes blast radius.

flowchart TD

    Traffic
    AgentV1[Agent 1.0]
    AgentV2[Agent 2.0]
    User1["95% User <br/> ๐Ÿฆ Stable Model"]
    Users2["5% User <br/> ๐Ÿค Canary Model"]


    Traffic -->|95%| AgentV1
    Traffic -->|5%| AgentV2

    AgentV1 --> User1
    AgentV2 --> Users2

Performance Metrics

User Satisfaction & Reliability

  • Task Completion Rate
  • Tool Success Rate
  • Error Rate

Quality

  • Hallucination Rate
  • Answer Accuracy
  • Reasoning Quality

Performance

  • Latency
  • Throughput
  • GPU Utilization

Cost

  • Tokens Per Request
  • Inference Cost
  • Infrastructure Cost

A common exam scenario:

A company wants to test a new multi-agent workflow on 5% of users while monitoring hallucination rates and latency before a full rollout.

Answer: ๐Ÿค Canary Deployment

Automated Promotion

Many production systems automatically promote a canary when metrics pass thresholds.

flowchart TD

    A[Canary Deployment]

    B{Metrics Healthy?}

    C[Increase Traffic]

    D[Rollback]

    A --> B

    B -->|Yes| C
    B -->|No| D

Example:

Latency < 2 seconds

Hallucination Rate <= Production

Success Rate >= Production

Promote automatically.

Automated Rollback

If problems appear:

Latency Spike
Hallucination Increase
Tool Failures

Traffic immediately returns to the previous version.

flowchart TD

    Traffic --> Canary

    Canary --> Failure

    Failure --> Rollback

    Rollback --> StableVersion

Examples

  • Model Canary: GPT-4.1 --> GPT-5
  • Prompt Canary: Prompt V1 --> Prompt V2
  • RAG Canary: Old Retrieval Pipeline --> New Retrieval Pipeline
  • Agent Architecture Canary : ReAct --> ReWOO

3. ๐Ÿงช A/B Testing

An experimentation technique used to compare variants.

Purpose:

  • Measure user behavior
  • Compare outcomes
  • Optimize conversions
  • Validate hypotheses
flowchart TD
    Request --> Split{"Experiment <br/>Group?"}

    VariantA[Variant A<br/>Agent GPT-4.1]
    VariantB[Variant B<br/>Agent GPT-5]

    Split -->|50%| VariantA 
    Split -->|50%| VariantB

A/B testing is not a subtype of Canary.

Think of them as siblings:

    Traffic Splitting
    โ”‚
    โ”œโ”€โ”€ ๐Ÿค Canary Deployment
    โ”‚   โ””โ”€โ”€ Risk Reduction
    โ”‚
    โ””โ”€โ”€ ๐Ÿงช A/B Testing
        โ””โ”€โ”€ Experimentation

Canary vs A/B testing

AspectCanary DeploymentA/B Testing
GoalReduce deployment riskCompare alternatives
Traffic SplitUsually unequal (95/5, 90/10)Usually equal (50/50, 30/30/40)
Success CriteriaStability, latency, errorsBusiness or quality metrics
End ResultPromote or rollbackChoose best variant
FocusRelease strategyExperimentation strategy

Feature Flag ๐Ÿšฉ

Feature flags are often used to implement A/B testing.

We can hide an unstable/ new feature from user and

  • Measure user behavior
  • Compare outcomes
  • Optimize conversions
  • Validate hypotheses

Flow

flowchart TD

    PromptV1["New App UI"]
    PromptV2["Legacy App UI"]

    Testing[Staging Env]
    Production[Production Env]
    

    Flag{"Feature <br/> Flag enable ๐Ÿšฉ"}
    User --> Flag

    Flag -->|No| Production--> PromptV2
    Flag -->|yes| Testing-->PromptV1

Help with developing a new feature.


4. Blue-Green Deployment ๐Ÿ”ต๐ŸŸข

Maintain two identical production environments and switch traffic between them during releases.

Only one environment serves users at a time.

๐Ÿ”ต Blue  = Current Production ๐Ÿš€
๐ŸŸข Green = New Release Standby โ›”

Release 1
๐ŸŸข Green  = Current Production ๐Ÿš€
๐Ÿ”ต Blue = New Release Standby โ›”

Release 2
๐Ÿ”ต Blue  = Current Production ๐Ÿš€
๐ŸŸข Green = New Release Standby โ›”

Release 3
๐ŸŸข Green  = Current Production ๐Ÿš€
๐Ÿ”ต Blue = New Release Standby โ›”

flowchart TD

    BlueProd["๐Ÿ”ต Blue  = Production ๐Ÿš€"]
    BlueStand["๐Ÿ”ต Blue  = Standby โ›”"]


    GreenProd["๐ŸŸข Green   = Production ๐Ÿš€"]
    GreenStand["๐ŸŸข Green   = Standby โ›”"]

     BlueProd -->|SwitchTraffic| BlueStand --> |Green Deployment| GreenProd

    GreenProd-->|SwitchTraffic| GreenStand--> |Blue Deployment| BlueProd



When the new version is ready:

  1. Deploy to Green
  2. Validate functionality
  3. Switch traffic
  4. Monitor
  5. Roll back instantly if needed

Architecture

flowchart TD

    A[๐Ÿ”ต Blue Live]

     B[Deploy New Version to ๐ŸŸข Green]

    B --> C[Validation & Smoke Tests]

    C --> D[Switch Traffic]

    D --> E[๐ŸŸข Green Live]

    E --> F{Issue Detected?}

    F -->|Yes| G[Switch Back to ๐Ÿ”ต Blue]
    
    G --> A

    F -->|No| H[Keep Green Live]

Loop

flowchart TD

    A[๐Ÿ”ต Blue Live]

    A --> B[Deploy New Version to ๐ŸŸข Green]

    B --> C[Validate]

    C --> D[Switch Traffic]

    D --> E[๐ŸŸข Green Live]

    E --> F{Healthy?}

    F -->|No| G[Switch Back to Blue]
    G --> A

    F -->|Yes| H[Green Becomes Blue]

    H --> J[Deploy Next Version to Idle Environment]

    J --> C

Benefits

  • Near-zero downtime
  • Simple rollback
  • Full production validation
  • Easy version comparison
  • Predictable deployment process

Drawbacks

  • Double infrastructure cost
  • Duplicate databases may be needed
  • More operational complexity
  • Not ideal for validating unseen production traffic patterns

Blue-Green vs Canary vs Shadow

StrategyUser ExposureTraffic DistributionRollback SpeedPrimary Goal
๐Ÿ”ต๐ŸŸข Blue-Green100% after switchAll traffic to one environmentInstantSafe release
๐Ÿค CanarySmall percentageSplit trafficFastGradual rollout
๐Ÿ‘ค ShadowNoneMirrored trafficNot neededValidation

Final Words

Full Rollout

โ†’ All users

Shadow Deployment

  • โ†’ No user exposure
  • โ†’ Mirrored production traffic: Real traffic
  • โ†’ Responses discarded

Canary Deployment

  • โ†’ Real traffic
  • โ†’ Small percentage of users
  • โ†’ Gradual rollout

Blue-Green

  • โ†’ Two identical environments
  • โ†’ Full traffic switch
  • โ†’ Instant rollback

Related Posts

  • Deploying Agents at Scale โ€” the deployment step this ongoing operations practice follows
  • CI/CD Pipelines: From Commit to Production โ€” the general CI/CD pipeline concepts this agent-specific DevOps builds on
Hitesh Sahu
Written by Hitesh Sahu, a passionate developer and blogger.

Sun Jun 07 2026

Share This on

โ† Previous

Deploying Agents at Scale

Next โ†’

NVIDIA Agentic AI Professional Certification Path

AI-AgenticAI/Agent-DevOps
Let's work together
hiteshkrsahu@gmail.com
Munich ๐Ÿฅจ, Germany ๐Ÿ‡ฉ๐Ÿ‡ช, EU
Playstore
Hitesh Sahu's apps on Google Play Store
Need Help?
Let's Connect
Navigation
ย  Home/About
ย  Skills
ย  Work/Projects
ย  Lab/Experiments
ย  Contribution
ย  Awards
ย  Art/Sketches
ย  Thoughts
ย  Contact
Links
ย  Sitemap
ย  Legal Notice
ย  Privacy Policy

Made with

NextJS logo

NextJS by

hitesh Sahu

| ยฉ 2026 All rights reserved.