Mirage Academy ยท AI infrastructure course

AI infrastructure course: deploy, monitor and scale an AI service

Your prototype runs on your machine. Then someone asks you to serve real users, keep the service up and say what it costs. This course takes an AI service from a prototype to production: build it, deploy it, watch it, scale it and price it. Watch the course in a minute, then size a service yourself below.

View the course pageSize a service

The course in a minute

Watch the road from prototype to service

Production AI Infrastructure & Deployment is about deploying, monitoring and scaling an AI service reliably and at a known cost.

Still from the intro video for the course Production AI Infrastructure & Deployment
Intro video, 1 min 9 s. Transcript below.
Read the transcript

Your AI prototype works on your machine. Then someone asks you to serve real users, keep it up, and say what it will cost each month. This course is for the engineer who has to answer. A prototype and a production service differ in a few ways. The build: a prototype runs where it was written, a service ships in a reproducible container. Visibility: you read traces, metrics and logs instead of guessing. Cost: you know it before the bill arrives. The course follows the loop you run in production. Deploy and configure the service. Observe it with traces and metrics. Scale it with queues and rate limits. Recover from incidents with a rollback, then deploy again. In the capstone you deploy and operate one AI service yourself, end to end. If you are the one who keeps an AI feature running, start with the first chapter.

  • Advanced levelThe course page rates it Advanced.
  • 9 chapters, 45 lessonsNine chapters of five lessons, and chapter 9 is the capstone.
  • Who it servesEngineers and technical product people behind AI features.
See the full course
The course's intro video with a play button, and under it a ribbon of three facts: level, size and audience.

Chapter 1

From prototype to production service

The first chapter covers what a prototype hides: targets for the service, a request path you can reason about and a gate before launch.

A general rule, drawn with example numbers
  1. Client
  2. Gateway
  3. Queue
  4. Model server
  • Client: Timeout of this hop
  • Gateway: Timeout of this hop
  • Queue: Timeout of this hop
  • Model server: Timeout of this hop

A caller that gives up first leaves work running that nobody waits for. So the inner timeout is shorter than the outer one, and a retry only happens inside the time that is left.

  1. Prototype to service: obligations and SLOsWhat a service owes its users, written as targets you can measure.
  2. The request path, timeouts and retriesWhere a request waits, where it can fail and what happens next.
  3. Code, configuration and secretsWhat ships in the image, what is set per environment and what stays out of both.
  4. Health checks and slow-starting model serversTelling the platform when a service is ready, even when loading takes a while.
  5. The launch gate and first-release mistakesA checklist before the first real traffic.
A request crosses four hops, from the client to the model server. Under them four bars, each shorter than the one before: every inner timeout must expire before the outer one does.

Chapter 2

Containers and reproducible builds

A container image is built in layers, and the order of the layers decides how much a small change costs you.

A general rule, drawn with an example stack
  1. Configuration set at startChanges often
  2. Application codeChanges often
  3. Model weightsChanges rarely
  4. System and language dependenciesChanges rarely
  5. Base image and runtimeChanges rarely

A build reuses a cached layer until something in it or below it changes. Then that layer and every layer above it are built again. Put what changes least at the bottom.

  1. Layer caching and build orderWhy the order of the steps in the build file matters.
  2. Multi-stage builds and small imagesBuild in one stage, ship only what runs.
  3. Reproducible buildsThe same inputs give the same image.
  4. Model weights and GPUs in containersChapter 2, lesson 5.
A stack of five image layers from the base at the bottom to the configuration at the top. The layers that change often are marked and sit above the ones that rarely do.

Chapter 3

Deploy and configure the service, then replace it safely

Chapter 3 deploys and configures AI services, including streaming ones, and ends on how a new version replaces the old one.

Illustration with eight replicas
  • RollingReplace replicas a few at a time.
    1. Start0 / 8 New version
    2. Midway4 / 8 New version
    3. End8 / 8 New version
  • Blue-greenRun both versions, then switch all traffic at once.
    1. Start0 / 8 New version
    2. Midway0 / 8 New version
    3. End8 / 8 New version
  • CanarySend a small share of traffic to the new version first.
    1. Start1 / 8 New version
    2. Midway1 / 8 New version
    3. End8 / 8 New version
  1. Deployments and rolling updatesDeclaring what should run and letting the platform get there.
  2. Requests, limits and schedulingHow much each replica asks for and where it can run.
  3. Configuration across environmentsThe same image, different settings.
  4. Exposing a streaming serviceLong answers that arrive in pieces.
  5. Rolling, blue-green and canaryThe three strategies in the drawing.
Three lanes of eight replica dots at three moments. Rolling swaps a few at a time, blue-green swaps all at once, canary starts with one.

Chapter 4

Observability: read a trace instead of guessing

Traces, metrics and logs are the three signals. A trace shows where one request spent its time, which is the first thing to read when an answer is slow.

Example trace with invented timings
  1. Handle request
  2. Check input
  3. Fetch context
  4. Model call
  5. Check output
  6. Send response
Time within one request

Read it from the top: the parent span covers everything below it.

  1. Three signalsTraces, metrics and logs, and what each one is good for.
  2. Reading a traceFind the span that makes the request slow.
  3. Metrics and percentilesChapter 4, lesson 3.
  4. Telemetry for LLM callsWhat to record for a model call.
  5. Alerts and burn rateChapter 4, lesson 5.
A waterfall of six spans for one request. Each bar starts when its step starts and ends when it ends; the longest step inside it, the model call, is drawn in the accent color.

Try it: capacity

How many replicas does this load need?

Chapter 5 begins with capacity from the arrival rate. Change the load below and see how many replicas it asks for.

A steady load on one service

Example, not the course's numbers

A steady load on one service

Replicas needed

Requests in flight
48
Replicas needed
9
Load on each replica
67%

With one fewer replica (8): 75%, above the target load, with little room for bursts.

12 requests per second at 4 seconds each puts 48 requests in flight. You need 9 replicas. Each runs at 67%.

The rule, in words

  1. Requests in flight equal the arrival rate times the seconds each request takes. This is Little's law.
  2. One replica holds a fixed number of requests at once. Running it at only part of that leaves room for bursts.
  3. Replicas needed equal the requests in flight divided by (requests per replica times the target load), rounded up to a whole replica.
  4. With fewer replicas than the load needs at 100 percent, requests arrive faster than they leave and the queue grows.

A model for a steady load. Real traffic comes in bursts, requests differ in length and real systems add warm-up time and limits.

  1. Capacity from arrival rateSize the service from the load, not from a guess.
  2. AutoscalingLet the replica count follow the load.
  3. Queues and async jobsAbsorb bursts and move slow work out of the request.
  4. Rate limitsRefuse excess requests early.
  5. Retries, breakers and sheddingKeep a struggling service from taking everything down with it.
Four controls and a row of replica bars. The bars fill to the load each replica carries, and the numbers show requests in flight and replicas needed.

Chapters 6 and 7

Serving models and knowing the cost

Chapter 6 opens the model server: memory for the weights, the KV cache, batching and where the latency goes. Chapter 7 turns that into unit economics, caching, routing and budgets.

Example shares, not measurements

Where the time of one answer goes

  • Waiting in the queue12%
  • Reading the prompt18%
  • Writing the answer62%
  • Network8%

Where the tokens of one request go

  • Fixed instructions20%
  • Retrieved context45%
  • Conversation so far25%
  • The answer10%
  1. The KV cacheThe memory a model keeps for the text it has already read.
  2. BatchingServe several requests together to use the hardware well.
  3. Where the tokens goChapter 7, lesson 2.
  4. Budgets and alertsSet a limit and hear about it before the invoice.
Two bars cut into parts. The first shows where the time of one answer can go, the second where the tokens of one request can go. The widest part of each is drawn in the accent color.

Watching the cost in depth: the observability course โ†’

Chapters 8 and 9

Run the incident, then deploy and operate your own service

Chapter 8 covers what goes wrong: incidents, rollbacks, graceful degradation and postmortems. The capstone then puts everything into one AI service you deploy and operate yourself.

  1. Brief to SLOsTurn the brief into targets you can check.
  2. Package and configureA reproducible image and its settings.
  3. Instrument and diagnoseAdd traces and metrics, then find a fault with them.
  4. Scale and cost the planSize the service and put a number on the month.
  5. Launch gate and incident reviewDecide whether to launch, and review what went wrong.Launch gate

Chapter 8: incidents and reliability

  • Incident lifecycle
  • What to roll back
  • Graceful degradation
  • Postmortems and budget policy
  • Testing reliability
Open the course
Five capstone stations on a rail, from the brief to the launch gate and incident review. The last station is a gate with a raised bar. Beside the rail, chapter 8's lessons as tags.

Before you deploy: Local Development, Docker, CI/CD & Release Engineering โ†’The wider path: become an AI engineer โ†’

Questions about the AI infrastructure course

  • What does the infrastructure capstone produce?

    The capstone is to deploy and operate an AI service. You turn a brief into targets, package and configure the service, instrument and diagnose it, scale and cost the plan, then run a launch gate and an incident review.

  • How is the course organized?

    It has 9 chapters and 45 lessons, five lessons in each chapter. The chapters run from prototype to production through containers, deployment, observability, scaling, model serving, cost and incidents to the capstone.

  • Does the course cover cost?

    Yes. One chapter covers cost management: unit economics, where the tokens go, caching, routing and batch work, budgets and alerts.

  • How does it differ from the Docker and CI/CD course?

    The Docker and CI/CD course follows a local stack to automated, safe releases. Here the starting point is a real service, and the chapters go through deploying, observing, scaling, pricing and recovering it.

  • Is the capacity planner the formula from the course?

    No. It is a small example written for this page. It applies Little's law to a steady load and rounds up to whole replicas, so you can see how the numbers fit together.

  • Does it end with a certificate?

    Yes, we offer certificates. They carry a verification code and come from Mirage, not from a state body.

  • Is there an AI coach?

    The Academy's AI coach is a feature of the platform: after a lesson you explain in your own words what you learned, and the coach responds.

  • Can I take the infrastructure course in German?

    The course language is English. Around it, the Academy site comes in German and English.