Oluwa.io
All writing
·7 min readai product methodologyllm applicationsevalsengineering

From Prompt to Product: Turning LLMs Into Real Apps

A practitioner's methodology for building LLM applications: evals, guardrails, latency and cost budgets, human-in-the-loop, and knowing what not to automate.

By Vitor Lima

A prompt that works in a playground is a demo, not a product. The gap between the two is where most AI projects quietly die. Building LLM applications that survive real users has less to do with clever prompting than the demos suggest, and much more to do with ordinary software discipline. We have shipped enough of these — Youp, MadaiOps, and now Linea — to have opinions about what actually closes that gap. None of it is glamorous.

The trap is that the first version feels finished. You paste a clever prompt, the model returns something impressive, and it is tempting to wrap it in a UI and call it a launch. Then real users arrive with inputs you never imagined, the model does something confidently wrong, and you discover you have no way to tell whether your fix made things better or worse. This piece is about the scaffolding that turns that impressive demo into something you can run in production and sleep through the night.

Start with evals, not prompts

The highest-leverage thing you can build early is an evaluation set. Not a benchmark, not a leaderboard — a folder of real inputs paired with what a good output looks like. Twenty examples beats zero, and fifty curated ones beat a thousand scraped ones.

The reason is simple. Once you have evals, prompt engineering stops being vibes. You change a line, you run the set, you watch the number move. Without them, every tweak is a superstition. We have watched teams spend a week improving a prompt only to regress on cases they had solved months earlier, because nothing was measuring the cases they weren't looking at.

A few opinions we hold firmly:

  • Grade on outcomes, not wording. For anything structured — extraction, classification, routing — assert on the parsed result, not on string similarity. For open-ended text, an LLM-as-judge with a tight rubric is fine, but validate the judge against a handful of human labels first, or you are just measuring one model's taste.
  • Keep a regressions file. Every production failure becomes a permanent test case. This is how your eval set stays honest — it grows in exactly the directions reality pushes on it.
  • Version your evals with your prompts. A prompt without its eval set is an untested code change.

If you build one thing from this article, build this. Everything downstream depends on being able to answer: did that make it better?

Guardrails are cheaper than apologies

Models fail in ways ordinary software does not. They will invent an API that does not exist, agree with a user's false premise, or emit valid-looking JSON with a hallucinated field. Guardrails are the layer that catches this before it reaches a user or, worse, an execution step.

Think in three positions.

  • Input guardrails reject or sanitize before the model runs: prompt-injection screening, PII redaction, off-topic filtering.
  • Output guardrails validate what comes back: schema validation, citation-grounding checks, policy filters.
  • Action guardrails sit between the model and anything with side effects.

That third one is where the real risk lives. In Linea, our workflow-automation agents, the model can propose actions — call an API, move a record, send a message. The proposal and the execution are deliberately separate steps. Every consequential action passes through a typed contract and a policy check before anything runs, and destructive or irreversible actions require an explicit confirmation gate. An agent suggesting the wrong thing is a UX problem you can iterate on. An agent doing the wrong thing is an incident. Keep those two failure modes on opposite sides of a hard boundary.

The opinionated version: validate structured output against a schema and retry on failure rather than trusting the model to be consistent. And never let a model's raw output be the thing that triggers an irreversible action. Put a deterministic check in between, always.

Budget latency and cost like features

Latency and cost are not things you measure at the end. They are constraints you design against from the start, because they change the architecture, not just the bill.

Set explicit budgets per user-facing action: a p95 latency target and a per-call cost ceiling. Once those are written down, the design decisions get easier. Some patterns we reach for repeatedly:

  • Right-size the model per step. Most pipelines have one or two steps that genuinely need the frontier model and several that a smaller, faster one handles fine. Routing simple classification to a cheap model and reserving the expensive one for the hard reasoning step is the highest-return optimization available, and it usually improves latency too.
  • Stream the first token. For anything conversational, perceived latency is dominated by time-to-first-token. A streamed response that takes four seconds feels better than a blocking one that takes two.
  • Cache aggressively. Prompt caching on stable system context, ordinary result caching on repeated inputs. A meaningful fraction of production traffic is near-duplicate.

The tradeoff to hold in your head: bigger models reduce your engineering effort but raise your marginal cost and latency forever. Cheaper models push work onto you — more prompt care, more guardrails, more evals — but that work is a one-time cost against a permanent saving. For anything with volume, spend the engineering.

Keep humans in the loop, on purpose

"Human in the loop" gets said so often it has stopped meaning anything. Done well, it is not a fallback for when the AI fails — it is a designed division of labor. The question is not whether to include a human but where the human's judgment is worth more than the latency it adds.

The pattern that has served us best is confidence-gated escalation. The system handles the confident majority automatically and routes the uncertain minority to a person, with the model's reasoning attached so the human decides in seconds, not minutes. In MadaiOps, order operations within normal parameters flow through; anything anomalous surfaces to an operator with context rather than executing silently. The reviewer is not babysitting the machine. They are spending their attention only where it is scarce and valuable.

One more rule: instrument the human's corrections and feed them back into your eval set and your prompts. A human-in-the-loop system that does not learn from its humans is just paying twice for the same work.

Know what not to automate

The hardest judgment in this discipline is restraint. Not every task should be handed to a model, and maturity is knowing which ones to leave alone.

Our rough test: automate where the cost of a mistake is low, or the mistake is easy to detect and reverse. Drafting, summarizing, extracting, classifying, routing — good candidates. A wrong draft is edited; a wrong summary is caught on read. Be far more cautious where errors are expensive, hard to detect, or irreversible: anything that moves money, sends an irrevocable communication, or makes a legal or medical call. There, the model belongs in an assistive role — surfacing options, drafting for review — not in the driver's seat.

The line we hold: if you cannot describe how you would catch the model being wrong, you are not ready to automate that step. The ability to detect failure is the real prerequisite, more than accuracy is. A 95%-accurate step you can fully verify is safer to ship than a 99%-accurate one you cannot.

The shape of the work

Turning a prompt into a product is mostly the unglamorous part: evals so you can measure, guardrails so failures stay contained, budgets so it stays fast and affordable, humans placed where judgment matters, and the discipline to leave some things un-automated. The model is maybe twenty percent of the system. The other eighty percent is the engineering that makes its occasional brilliance safe to depend on.

The good news is that this is familiar work. It rewards the same instincts that make good software of any kind: measure before you change, contain your blast radius, respect your users' time. The model is new. The craft is not.