Module 8: Capstone Project — Deployed AI System

1. Introduction: Integrative Project — Deployed AI System

Description

This is the opening capsule of Module 8, the last module of the Deployment & Cloud Infrastructure Guide. Here you don't learn new concepts — you apply EVERYTHING you built in modules 1 through 7. The result is an AI system deployed in real production, accessible from the internet, with professional documentation another engineer can use to operate the system.

Why it matters: Seven modules built individual skills: decision framework (M1), Docker Compose (M2), Lambda (M3), LocalStack (M4), AWS services (M5), migration patterns (M6), alternative platforms (M7). Now you integrate everything into an end-to-end production pipeline. It's not another exercise — it's a real deployment. The difficulty isn't in learning something new, it's in making all the pieces work together. This is exactly what happens in real production: problems appear at the interfaces between systems, not inside each system.

By the end of this module, you'll have the most valuable artifact of the whole guide: an AI system deployed in production, documented with a decision matrix that justifies every infrastructure decision, with an operational runbook for incidents, and automatic post-deploy validation. It's not a "class project" — it's infrastructure you can show in a job interview or use as the foundation for a real product.

This module is 90% execution, 10% new concepts.


Where Are We in the Guide?

Context

This guide has 8 modules organized into 3 phases:

Phase 1: Deployment Strategies (Modules 1-3)
├── Module 1: Understanding Deployment Options         ✅ Completed
├── Module 2: Local & Container Deployment             ✅ Completed
└── Module 3: Serverless & Lambda for AI               ✅ Completed

Phase 2: Cloud Infrastructure & Migration (Modules 4-6)
├── Module 4: LocalStack — AWS Local Development       ✅ Completed
├── Module 5: AWS Services for AI                      ✅ Completed
└── Module 6: Cloud Migration Patterns                 ✅ Completed

Phase 3: Alternatives & Production (Modules 7-8)
├── Module 7: Alternative Platforms                    ✅ Completed
└── Module 8: Integrative Project — Deployed AI System ← YOU ARE HERE

Total estimated duration: 1.5-2 hours (intensive execution).

What you integrate

Each previous module contributed a piece. This module connects them:

M1: Decision Matrix Framework
    → Documents WHY you chose this strategy and platform

M2: Docker Compose
    → Your local development environment works with docker compose up

M3: Serverless & Lambda
    → If your decision matrix indicates serverless, Lambda is part of the architecture

M4: LocalStack
    → Your testing environment for AWS services with no cost

M5: AWS Services
    → S3, Lambda, SageMaker can be your production backend

M6: Migration Patterns
    → The local → staging → production flow you run now

M7: Alternative Platforms
    → Render, Railway, Fly.io as the production destination

Integration is the skill. Knowing how to use Docker, Lambda, AWS individually is valuable. Knowing how to integrate them into an end-to-end pipeline is what employers look for.


Module Goal

By the end of this module you'll be able to:

  • ✅ Deploy a complete AI system on a real production platform (AWS, Render, Railway, or Fly.io), accessible from the internet
  • ✅ Integrate optimized Docker images with a CI/CD pipeline for automatic deployment from git push
  • ✅ Run automated post-deploy validation: health checks that verify the API responds AND that inference works
  • ✅ Document the applied decision matrix: which strategy you chose (M1), which platform you chose (M7), and why
  • ✅ Create an operational runbook: what to do when the service goes down, how to roll back a bad deploy
  • ✅ Establish a performance baseline: latency targets, cost monitoring, error rate targets
  • ✅ Produce a deployment guide another engineer can follow to replicate the setup from scratch

Professional goal

When you complete this module, you won't say "I know how to deploy." You'll say: "I have an AI system in production with a public URL, automated health checks, an operational runbook, and documentation of every infrastructure decision." That's what differentiates a developer who does tutorials from one who operates real systems.


Module Roadmap

Capsule map

#CapsuleWhat you'll doType
01Introduction (this one)Understand what you integrate, the execution plan, what you deliverIntro
02Architecture IntegrationConnect Docker + CI/CD + platform into a coherent flowTechnical
03Deployment AutomationAutomate deploy from git push, environment promotionTechnical
04Post-Deploy ValidationHealth checks + smoke tests that verify real inferenceTechnical
05Operational RunbookProcedures for incidents: outages, rollback, costsTechnical
06Final Decision MatrixIntegrate M1 + M7 into the applied decision with justificationTechnical
07Performance BaselineEstablish targets for latency, cost, error rateTechnical
08Project: Deployed Production AI SystemThe final deliverable: deployed system + documentationProject

Execution flow

The progression is deliberate. First you connect the architecture — how the pieces fit (capsule 02). Then you automate the deployment — from git push to production (capsule 03). Next you validate that it really works — not just 200 OK, but real inference (capsule 04). You create the runbook to operate the system (capsule 05). You document why you chose this configuration (capsule 06). You establish performance baselines (capsule 07). And finally you integrate everything into the final project (capsule 08).

The progression is: architecture → automation → validation → operation → decision → performance → project.

This is not a reading module. It's a doing module.


What You Deliver at the End

Two deliverables of equal weight

Deliverable 1: Deployed system

An AI system accessible from the internet:
├── Working public URL (e.g.: https://your-app.railway.app)
├── Health check endpoint that responds ✅
├── Inference endpoint that processes real prompts
├── CI/CD: git push → automatic deploy
└── Multi-environment: local → staging → production

Deliverable 2: Operational documentation

Documentation another engineer can use:
├── Decision Matrix v_final (strategy + platform + justification)
├── Operational runbook (what to do when something fails)
├── Deployment guide (how to replicate the setup from scratch)
├── Performance baseline (latency, cost, error rate targets)
└── Post-deploy validation report (health checks + smoke tests)

A system without documentation isn't production-ready — it's a prototype that works today and nobody knows how to operate tomorrow. Both deliverables carry the same weight.


Platform: Choose Yours

This module is platform-agnostic

Your decision matrix from modules 1 and 7 determined where you deploy. This module works with any of them:

PlatformFree TierDeploy from GitSetup time
RenderYes (750 hrs/month)Yes~15 min
RailwayYes ($5 credit/month)Yes~10 min
Fly.ioYes (3 shared VMs)With the CLI~20 min
AWS (Lambda + API GW)Yes (1M req/month)With GitHub Actions~45 min

All platforms have free tiers that make a real deployment possible at no cost. There's no excuse to "simulate" a deploy.


Connection with the Project

This module IS the integrative project

The final project of this guide — Deployed Production AI System — integrates all the previous mini-projects:

Module 1: Decision Matrix → framework to decide
    ↓
Module 2: Docker Compose → working local environment
    ↓
Module 3: Lambda → if it applies per your decision matrix
    ↓
Module 4: LocalStack → AWS testing at no cost
    ↓
Module 5: AWS Services → production backend (if you chose AWS)
    ↓
Module 6: Migration → local → staging → production flow
    ↓
Module 7: Platform Choice → chosen production destination
    ↓
Module 8: EVERYTHING INTEGRATED → deployed system + documentation

Connection with guide #18 (Monitoring & Observability)

This is the last module of this guide. On completing it, you're ready for guide #18, which takes the system deployed in production and adds observability: metrics, structured logs, tracing, alerts, and dashboards. The natural transition: "You have an AI system in production → now you need to see what happens inside it."


Prerequisites

What you must already have

To run this module you need concrete artifacts from previous modules:

From moduleArtifactWhy you need it
M1Decision matrix v1Base for your strategy justification
M2Dockerfile + docker-compose.ymlYour containerized AI app
M7Decision matrix v2 (with platforms)Decision on where to deploy
#15Docker knowledgeBuild and push images
#16Basic CI/CD pipelineGitHub Actions to automate

Verified tools

# Docker and Docker Compose
docker --version        # 24.0+
docker compose version  # v2.20+

# Python
python --version        # 3.10+

# Git and GitHub CLI
git --version
gh --version            # To create releases (optional)

# Your AI app working locally
docker compose up -d
curl http://localhost:8000/health  # Must respond OK

Expected file structure

your-ai-project/
├── Dockerfile                 # Optimized image (M2)
├── docker-compose.yml         # Multi-container local (M2)
├── .github/
│   └── workflows/
│       └── deploy.yml         # CI/CD pipeline (this module)
├── src/
│   └── main.py                # Your FastAPI app
├── tests/
│   └── test_smoke.py          # Smoke tests (this module)
├── docs/
│   ├── decision-matrix.md     # Decision matrix v_final (this module)
│   ├── runbook.md             # Operational runbook (this module)
│   └── deployment-guide.md    # Deployment guide (this module)
├── scripts/
│   └── validate-deploy.sh     # Post-deploy validation (this module)
├── .env.example               # Environment variable template
└── README.md                  # Project documentation

Mindset for This Module: Integration > Individual Tools

The skill with the most value

Knowing how to use Docker is valuable. Knowing how to configure GitHub Actions is valuable. Knowing how to deploy on Railway is valuable. But knowing how to make Docker + GitHub Actions + Railway work together in a coherent pipeline is what employers really look for.

Integration is hard because the problems don't appear inside each tool — they appear at the interfaces between tools:

Problems INSIDE a tool:                     INTEGRATION problems:
├── Dockerfile syntax error                 ├── Docker build works locally, fails in CI
├── Invalid GitHub Actions YAML             ├── CI/CD passes but the deploy doesn't trigger
├── Incorrect Railway config                ├── Deploy works but the health check fails
└── Easy to diagnose and resolve            ├── Everything works but the env vars aren't passed
                                            └── Hard to diagnose, requires understanding the flow

This module trains you to diagnose and resolve integration problems. It's the skill you apply most in real production.

The difference between "works on my machine" and "works in production"

"Works on my machine":
├── Docker compose up → works ✅
├── .env loaded locally
├── Ports accessible on localhost
├── No SSL, no public domain
└── Only you can use it

"Works in production":
├── Public URL with HTTPS
├── Secrets managed by the platform
├── Automatic health checks
├── CI/CD deploys without intervention
├── Documentation so ANOTHER engineer can operate it
├── External monitoring detects if it goes down
└── A runbook defines what to do when it fails

The gap between these two realities is what this module's capsules cover.

The errors that only appear in production

There's a category of errors you never see in local development:

  • Cold starts: Your app takes 10 seconds to respond to the first request because the platform put the container to sleep
  • Memory limits: Your app uses 2GB of RAM locally without problems, but the platform only allocates 512MB
  • Network latency: The call to OpenAI takes 1s locally, 2.5s in production due to routing
  • Secret rotation: Your API key expires and nobody notices until the app stops working
  • Concurrent requests: 10 simultaneous requests work locally, but in production 100 simultaneous ones crash your single-threaded server

The only way to discover these errors is by deploying for real. That's why this module requires a real deployment, not a simulated one.


How to Approach This Module

The execution strategy

This module is 90% execution. The optimal strategy:

1. Read capsule 01 (this one) completely — understand the plan (15 min)
2. For each capsule 02-07:
   a. Read the theory section (5 min)
   b. Run the code / create the artifact (20-30 min)
   c. Verify that it works (5 min)
3. Capsule 08: integrate everything into the final project (45-60 min)
4. Verify with the completeness checklist

Don't read all the capsules first and execute later. Read one, execute, read the next. The learning is in the execution, not in the reading.

What you must have before starting

# Verify this NOW, not when you're in capsule 03:

# 1. Your AI app works locally
docker compose up -d
curl http://localhost:8000/health
# Must respond 200

# 2. Your repo is on GitHub
git remote -v
# Must show a GitHub remote

# 3. You have an account on your chosen platform
# Railway: railway.app (login with GitHub)
# Render: render.com (login with GitHub)
# Fly.io: fly.io (registration + CLI)

# 4. You have an OpenAI API key (or your LLM provider's)
echo $OPENAI_API_KEY | head -c 10
# Must show "sk-..."

If any of these fail, resolve it before continuing.


Limits: What This Module Does NOT Cover

  • Kubernetes — Advanced orchestration is out of this guide's scope
  • Terraform / Infrastructure as Code — Enterprise-level infra automation
  • Advanced monitoring — That's guide #18 (Monitoring & Observability)
  • Advanced auto-scaling — Configuring scaling policies and load balancers
  • Multi-region deployment — A single deployment in one region is enough
  • Advanced networking — VPCs, subnets, load balancers are mentioned but not configured
  • Production databases — PostgreSQL, Redis as managed services are out of scope
  • Custom domains — Working with the platform's subdomain (*.railway.app) is enough

Evidence of Success

By the end of this module, you'll know you succeeded if:

  • ✅ You have a public URL that responds to requests from any browser
  • ✅ An automated health check verifies that the system is alive
  • ✅ A smoke test sends a real prompt and verifies that inference works
  • ✅ A git push triggers build → test → deploy automatically
  • ✅ Your decision matrix documents WHY you chose this strategy and platform
  • ✅ Your runbook has procedures for at least 4 incident scenarios
  • ✅ Another engineer can replicate your setup following your deployment guide
  • ✅ You have documented latency and cost baselines

Quick self-assessment test

If you can answer these questions, you're ready:

  1. What is the URL of your deployed AI system?
  2. What happens when you git push to main?
  3. How do you verify that inference works after a deploy?
  4. What do you do if the service goes down at 3am?
  5. Why did you choose this platform and not another?

Summary

  • This module is 90% execution, 10% new concepts — you apply what you built in M1-M7
  • Two deliverables of equal weight: deployed system + operational documentation
  • The deployment must be real: public URL, accessible from the internet, with free tiers
  • The difficulty is the integration: Docker + CI/CD + platform + validation
  • The documentation isn't "extra" — it's production: decision matrix, runbook, deployment guide
  • This is your portfolio piece: the most valuable artifact of the whole guide
  • It works with any platform: AWS, Render, Railway, Fly.io
  • After this module → guide #18 (Monitoring & Observability)

You've just reached the last module. What comes next is putting your AI system into production — this is real.


Additional Resources

  1. The Twelve-Factor App — Principles for production-ready apps
  2. AWS Well-Architected Framework — Architecture evaluation framework
  3. Architecture Decision Records (ADR) — Standard format for documenting decisions
  4. Render Documentation — Render docs for deployment
  5. Railway Documentation — Railway docs
  6. Fly.io Documentation — Fly.io docs
  7. GitHub Actions Documentation — CI/CD with GitHub Actions