Level 10 · Production
LLMOps: From Development to Production
LLMOps means the habits that keep a model feature from silently getting worse after you ship it: version the prompt, test before release, and watch it after. This level teaches those habits on a retrieval app and an agent, from pinned settings and scored changes to containers, a cloud run, and a practised undo. You need it because a demo that looks finished can still drift the next day when a prompt, a model, or a document index changes without a code edit.
Assumes You should already be able to call a model from a small retrieval app and a small agent, score both on a fixed list of questions, and name a few ways user text can trick a model. · 23 study sessions · 10 modules
Ship it
Capstone: LLMOps Project
Take either the retrieval app or the agent through the habits that keep a model feature from silently getting worse after you ship it. In one folder you will version the prompt, score changes before they go out, block bad inputs, run the app in containers, and practise one undo. Finish one app. A second half-built app does not count.
Work in notes and local files first. Use a free chat window if you need sample answers. Skip any cloud click you cannot do, and write the substitute you used plus what it fails to prove. Done means a stranger can see a failed score, a logged block, a streaming sketch or a real stream, and one undo that returns a signal to normal.
1. One app, the whole lifecycle
1. Open README.txt and choose one app: the retrieval app or the agent. Write that choice in the first line and do not add a second product.
2. List the stages you will actually do: config, traces, prompt versions, a score gate, guards, containers, a deploy sketch, a board, and a runbook.
3. If a stage needs a cloud account you do not have, write the paper substitute and the sentence "this does not prove a live machine."
4. Done when the README names one app, every stage is listed, and any substitute is labeled as a substitute.2. Versioned prompts & tracked runs
1. Create a prompts folder with reply-v1.txt and reply-v2.txt. Keep v1 after you edit v2.
2. In labels.txt point production at v1 and write that a packed fallback copy lives beside the app.
3. Create run-baseline.txt with the parameters, one score, and the name of the prompt file used before later edits.
4. Done when a stranger can open the baseline note and read the text that produced the score without asking you.3. A CI gate that blocks a regression
1. Put at least five questions in cases.json with an expected behavior for each.
2. Write check.txt with a numeric floor for one metric, and a rule that the check runs before any image is "pushed."
3. Weaken reply-v2.txt on purpose, run the check by hand or with a small script, and save the failed result that names the metric.
4. Restore the prompt and show the next result passing.
5. Done when you still have the failed result and the later pass side by side.4. Guardrails with logged blocks
1. In guards.txt write two input rules, two output rules, and, if you chose the agent, a step cap or a spend cap.
2. For each rule, include one example that blocks and the reason code.
3. Write two log lines that include a rule id and a request id. Do not include a real secret.
4. Count how many of five fair requests your rules would block, and write that count.
5. Done when the log lines and the false-block count are both visible.5. A streaming stack in Compose
1. Write api.txt describing POST /answer that streams tokens, plus the cancel rule if the caller leaves.
2. Write page.txt with one text box that only calls that route and contains no prompt strings.
3. Write compose.txt with api, page, and a vector database, secrets passed at start, and not baked into the image.
4. If Docker is installed, run the stack and confirm tokens appear before the answer finishes. If not, say so and point at the frame order in stream notes.
5. Done when a clean reading of the notes shows tokens arriving before the answer finishes, or a real stream does that on your machine.6. CI/CD to EC2 via CodeDeploy
1. In ship.txt write the order: tests, quality gate, then an image tag that includes a commit id. Say the push happens only after the gate.
2. Sketch the machines: a role instead of a key on disk, a secrets store, a balancer, and a scaling group with a floor and a ceiling.
3. Document the idle limit you would set for streams and the metric you scale on. It must not be CPU alone.
4. If you cannot click a cloud console, label the sketch "not deployed" and list what a real deploy would still need to prove.
5. Done when the tag, the idle limit, and the scale metric are written and any missing cloud step is labeled honestly.7. Dashboards, alerts & traces
1. In board.txt list panels for host health, latency, errors, and token spend, plus one alert that would page a person.
2. Sketch one trace with separate spans for retrieval or tools, the model call, and cost.
3. Point at one expensive request and explain the tokens in a sentence.
4. Done when the board, the alert, and the expensive span explanation can be read without opening a chat log.8. A rollback & a runbook
1. Show one undo in rollback.txt: either move the live prompt label back, or name the previous image tag you would redeploy.
2. Write the signal that returns to normal, such as the metric rising above its floor or the log showing the old prompt id.
3. Write a one-page runbook for one incident type with the detector, the first action, and the person who decides.
4. Time the undo once, even on paper, and write the minutes.
5. Done when the signal, the runbook, and the time are all present and the undo is a procedure rather than a hope.