Mirage Academy · LLM Application Engineering

LLM engineering course: build a service around the model call

LLM Application Engineering is rated advanced. Its audience is software engineers and technical product people building AI features. Ten chapters follow one request through a routed model call, a schema check and a recovery path, and you end by building a structured-output service with routing.

Open the courseSee the ten chapters

The loop

A request runs a loop of four steps: route, call, validate, recover

Start with the course's own video. Then follow one request around the loop.

Still from the intro video for the course LLM Application Engineering
Intro video, 1 min 4 s. Transcript below.
Read the transcript

You have a prompt that works in a demo, and now it has to run as a real service. This course is for engineers who must turn model calls into an application that behaves the same way every day. Compare the two. Your output becomes structured and validated. Your model choice becomes routing. Your failures meet retries and timeouts. Your cost meets caching. And shipping comes with logging and guardrails. Each request runs a loop. You route it to a suitable model, call the API, validate the answer against a schema, and recover when something fails, by retrying or falling back. In the capstone you build a structured-output service with routing. If you write LLM features for real users, start with the first chapter.

  1. Route

    Send the request to a model that suits it. Chapter 6 covers choosing by evidence, fixed rules and cascades.

  2. Call

    Call the model's API with messages and parameters, and stream the answer. Chapter 2 covers this.

  3. Validate

    Check the answer against a schema before anything else uses it. Chapter 4 covers this.

  4. Recover

    When a step fails, retry or fall back. Chapters 6 and 7 cover how.

The course video, then four stops in a ring: route, call, validate and recover. A dotted line leads from recover back to route.

The path

Ten chapters, in the order you would build the service

Each chapter has five lessons. The tenth chapter is the capstone.

Call and prompt

  1. Chapter 1: Anatomy of an LLM application

    Lessons: The Model Call vs. the Application Around It; Context Window and Token Budget; Latency: TTFT, Output Rate and Streaming; Cost per Request and per Day; Single Call, Workflow or Agent, and Where the Risks Sit.

  2. Chapter 2: Model APIs: messages, parameters and streaming

    Lessons: Messages and roles; Temperature and top-p; Stop conditions and finish reasons; Streaming; Usage accounting.

  3. Chapter 3: Prompt design that holds up in production

    Lessons: Parts of a prompt; Few-shot examples and their price; Templates and versions; Testing a prompt change; Untrusted text inside the prompt.

Output and tools

  1. Chapter 4: Structured outputs and validation

    Lessons: Schema as contract; Parsing before validating; Validate and retry; Constrained decoding; Business rules.

  2. Chapter 5: Tool and function calling

    Lessons: Defining a tool; The tool loop; Two kinds of error; Side effects and approval; Choosing among tools.

Routing, failure and cost

  1. Chapter 6: Model selection and routing

    Lessons: Choosing by evidence; Static routing rules; Cascades; Measuring a router; Providers, versions and fallbacks.

  2. Chapter 7: Errors, retries, timeouts and rate limits

    Lessons: Which errors to retry; Exponential backoff with jitter; Honoring Retry-After; Timeouts and deadlines; Rate limits and circuit breakers.

  3. Chapter 8: Caching, cost and latency

    Lessons: Exact response caching; Prompt prefix caching; Semantic caching; Batch work; Latency levers.

Ship it

  1. Chapter 9: Shipping safely: logging, privacy and guardrails

    Lessons: What to log; Redaction; Naming the risk; Least privilege; Budgets and abuse limits.

  2. Chapter 10: Capstone: a structured-output service with routing

    Lessons: Specify the service; Router and models; Validate, retry, escalate; Logging and limits; Run report.

A vertical rail with ten nodes in four bands: call and prompt, output and tools, routing and failure and cost, ship it. The last node is the capstone.

Structured output

Parse first, validate second, retry with the errors, then escalate

Chapter 4 and the capstone teach this loop. Here it is as a small service you can run. The example is made up for this page, and the limit of attempts is yours to set.

Run the example service

Example, not a course exercise

The example schema

  • category: billing, bug or question
  • urgency: a whole number from 1 to 5
  • summary: text, not empty
  • business rule: urgency 5 only for bugs
What the model sends back
Allowed attempts (Between 1 and 4)
  1. Attempt 1Passed all three checks

    Reply{"category":"billing","urgency":2,"summary":"Refund for a double charge"}

Accepted after 1 attempt

The rule: the whole reply must parse as one JSON object. If it does, the schema check lists all the wrong fields, and only a reply that passes the schema meets the business rule. A reply that passes all three is accepted. Any other reply goes back with its error list until the allowed attempts are used up, and then the request is escalated.

Accepted after 1 attempt. Passed all three checks.

An example service that checks a model's reply as a JSON support ticket. You pick one of five situations and the allowed attempts, and the page lists each attempt with the check that failed or passed.

Tools

Tool calling: the loop, the two kinds of error and the calls that need approval

Chapter 5 covers defining a tool, the tool loop, two kinds of error, side effects and approval, and choosing among tools.

  1. Defining a tool

    Defining a tool that the model can ask for.

  2. The tool loop

    The tool loop between the model, your code and the tool.

  3. Two kinds of error

    Two kinds of error in a tool loop.

  4. Side effects and approval

    Side effects, and approval before a call runs.

  5. Choosing among tools

    Choosing among several tools.

A board with three nodes: the model, your code and the tool. A call arrow goes right, a result arrow comes back, an approval gate sits before the tool, and an error strip runs underneath. Five numbered markers match the five lessons.

Agentic Engineering course: building and operating agents →

Routing

Choose the model per request: fixed rules, cascades and a router you measure

Chapter 6 treats routing as part of your application code. Routing for many teams and providers at once is the subject of the gateway course.

  1. Choosing by evidence

    Pick a model by how it does on your own test cases.

  2. Static routing rules

    Fixed rules that send a kind of request to a set model.

  3. Cascades

    Cascades from a cheaper model to a stronger one.

  4. Measuring a router

    How to tell whether a router picks the right model.

  5. Providers, versions and fallbacks

    Providers, model versions and fallbacks in a route.

A request enters a routing rule and fans out to three targets: a cheaper model, a stronger model and a fallback. A dotted arrow shows a cascade moving from the cheaper to the stronger model.

LLM gateway course: routing, budgets and accounting →

Failure and cost

Retries, timeouts and caches decide what a failure and a repeat cost

Chapters 7 and 8 cover what happens when a call fails, runs slow or repeats.

  1. Which errors to retry

    Deciding which errors are worth another try.

  2. Backoff with jitter

    Exponential backoff with jitter between tries.

  3. Honoring Retry-After

    Honoring the Retry-After value a provider sends.

  4. Deadlines and circuit breakers

    Timeouts and deadlines, rate limits and circuit breakers.

  5. Caching and batch work

    Exact response, prompt prefix and semantic caching, and batch work.

Left, a timeline of five tries with a wider gap before each one and a dotted spread around each gap. Right, three nested rings for three kinds of cache.

Shipping safely

Log enough to explain a request, and redact what must not be stored

Chapter 9 is about what leaves the service and what stays in its records.

Example record

route
support-triage
model
cheaper model
attempts
2
status
accepted
customer
redacted
email
redacted
  1. What to log

    What to log, as in the example record: route, model, attempts and status.

  2. Redaction

    Redaction of personal data in what is logged.

  3. Naming the risk

    Naming the risk of a feature.

  4. Least privilege

    Least privilege for the service.

  5. Budgets and abuse limits

    Budgets and abuse limits as a safeguard before shipping.

One log record of an example request as lines of key and value. Two values are covered with a mask because they hold personal data.

Capstone

The capstone: a structured-output service with routing

You build one service that uses the whole course, in five steps from the spec to the run report.

  1. Step 1

    Specify the service

    Write the specification of the service.

  2. Step 2

    Router and models

    Choose the models and the rule that sends each request to one of them.

    Chapter 6
  3. Step 3

    Validate, retry, escalate

    The loop from the structured-output chapter, with the retry rules from the failure chapter.

    Chapter 4Chapter 7
  4. Step 4

    Logging and limits

    Logging and limits for the service.

    Chapter 9
  5. Step 5

    Run report

    Run the service and write the run report.

A blueprint line with five steps: specify the service, router and models, validate retry escalate, logging and limits, run report. Chapter tags sit under the steps that use them.

Start

How the Academy teaches it

This course is in English.

In the Academy

  1. Lessons

    Each lesson pairs a short visual explainer with questions, a task and a quiz.

  2. Chapter checks

    The chapter assessments feed into the certificate rule.

  3. AI coach

    In a live voice session the coach asks you to explain what you learned and asks again where your answer is thin. It does not decide your certificate.

  4. Certificate

    The course comes with a certificate. A fixed rule decides it. It carries a verification code that anyone can check online, and it is Mirage's own statement, not a state-recognized degree.

Level and audience

  • Advanced
  • For software engineers and technical product people
Open the course: LLM Application Engineering
Lessons, chapter checks, the AI coach and the certificate as four stations, with the level and audience in a box beside them.

Read first: the path to becoming an AI engineer →

Questions about the LLM engineering course

  • What is the LLM Application Engineering course?

    An advanced course in the Mirage Academy catalog, with ten chapters of five lessons each. It covers the application around a model call: APIs, prompts, structured outputs, tools, routing, retries, caching and safe shipping.

  • Who is this LLM engineering course for?

    The catalog lists software engineers and technical product people who build AI features, and it rates the course advanced.

  • What is the LLM engineering capstone?

    A structured-output service with routing. The five steps are to specify the service, set up the router and models, validate, retry and escalate, add logging and limits, and write a run report.

  • How is this different from the guide on becoming an AI engineer?

    The guide answers the broad question of which skills an AI engineer needs and in which order to learn them. This page is about one course in that path, with its syllabus and its capstone.

  • Does the course cover tool calling and agents?

    It covers tool calling in full, and one lesson helps you choose between a single call, a workflow and an agent. Building and operating complete agents is the subject of the Agentic Engineering course.

  • Is routing across many providers part of this course?

    Chapter 6 teaches routing inside your application. Running routing, budgets and cost accounting as shared infrastructure is covered by the LLM gateway course, which this one pairs with.

  • Do I get a certificate?

    Yes. A fixed rule on your chapter checks grants the certificate, the AI coach has no part in that, and a verification code lets others check it online.