top of page

Building LLM Applications

Shawn West
Aug 5
6 min read

An LLM demo takes an afternoon. An LLM product takes everything the demo skipped. Building LLM applications is less about clever prompts and more about engineering discipline: choosing the right shape for the problem, grounding the model in real data, measuring quality you can't eyeball, and controlling cost before the invoice surprises you. This guide is the map — from your first API call to a feature that survives real production traffic.

Our bias, stated up front: the simplest design that works usually wins. Reach for an agent when a single structured call would do, and you buy yourself latency, cost, and failure modes you never needed. Most of the value in applied AI comes from getting the fundamentals right — retrieval quality, evaluation, cost discipline — not from the most elaborate architecture.

Start here

Foundations

Before you build, it helps to know what you're actually working with. A large language model is a next-token predictor trained on a vast amount of text — extraordinary at fluent language and pattern completion, and confidently wrong when you push it past what it knows. The failures that bite in production almost always trace back to treating the model as something it isn't.

Prompt engineering: clear thinking, made testable

Prompt engineering has a bad reputation as incantation-hunting. It isn't. At its core it's the skill of communicating precisely with a system that takes you literally — which is to say, it's clear thinking written down. The engineers who get reliable output aren't collecting magic phrases; they're building a small workspace where they can change one thing and measure whether it helped, instead of judging by vibes on a single example.

The Practical Prompt Engineering path builds exactly that discipline, from a scored test harness to structured outputs.

Your first LLM app: from API call to features

The gap between calling an API in a notebook and shipping a feature is where most of the real work lives. You need streaming so the interface doesn't feel broken, structured output so downstream code can trust the result, embeddings and retrieval so the model can answer from your data, and function calling so it can act. None of these is hard alone; the skill is assembling them into something dependable.

The Building with LLMs path walks the whole assembly, one working piece at a time.

RAG in production: retrieval is the hard part

Retrieval-augmented generation is the most common way to ground an LLM in real, current, private data — and the naive version is a great demo and a disappointing product. The model is only ever as good as the chunks retrieval hands it; feed it the wrong three passages and it will cite them with total confidence. Production RAG is mostly retrieval engineering: chunking, ranking, query rewriting, and knowing when the honest answer is "I don't have that."

Shapes, cost, and shipping

Most stalled LLM projects picked the wrong shape at the very start and then fought it for months. A chat interface where a single structured completion would do; an agent loop where retrieval was the whole job. The shape sets your cost, latency, and failure modes before you write a prompt — so choose it deliberately, then treat the leap from prototype to product as its own project, because that's where reliability, cost, and compliance actually get earned.

The LLM Application Engineering path covers this end to end.

Tool use and agents — when you actually need them

Giving a model tools is where these systems get genuinely powerful and genuinely dangerous in the same step. An agent that can call your API to help a user can also loop, burn budget, or take an action it was never authorized to take. Build them with bounds, iteration limits, and authorization enforced in code — and reach for one only when the task is genuinely open-ended. Protocols like MCP make connecting models to real systems cleaner, which makes the guardrails matter even more.

Evaluation: you can't ship what you can't measure

An LLM feature that gives a different answer every time can't be QA'd by clicking around. Without evals, every prompt change is a vibe — you tweak a word, it feels better on the one example you checked, and you ship a regression you won't find for a week. Evals turn "feels better" into a number you can defend, and wired into CI they turn a bad prompt into a failed build instead of a user complaint.

The AI Evaluation & Monitoring path builds this muscle.

AI-assisted coding

The other side of building with AI is building using it. Coding assistants are excellent at the mechanical and confidently wrong on the subtle, so the skill has shifted from writing every line to reviewing generated code as sharply as you'd review a junior's PR. Pick a tool that fits your workflow, prompt it with real context, and never let fluent-looking output reach production unread.

The AI-Assisted Coding path covers the full workflow.

Running models yourself

Sometimes the right answer is to run the model on your own hardware — for privacy, cost at scale, or control. Local and self-hosted inference has gotten genuinely practical, but "works on my laptop" and "serves my team" are different problems, and the hardware math matters.

Frequently asked questions

What does it take to build an LLM application? Less prompt magic than you'd think, and more engineering than the demos suggest: choosing the right shape (a single call, chat, RAG, or an agent), grounding the model in your data, evaluating output you can't judge by eye, and controlling cost and latency. The fundamentals carry most of the weight.

Do I need an agent? Usually not. Agents shine for open-ended, multi-step tasks, but they cost more and fail in more ways. A single structured completion or a RAG lookup handles the majority of real use cases. Start from the shapes and pick the simplest one that works.

What is RAG, and when do I need it? Retrieval-augmented generation retrieves relevant documents and feeds them to the model so answers come from real, current data instead of the model's guesses. You need it whenever answers must be grounded in your own knowledge base. Here's how the architecture fits together.

How do I know if my LLM app is any good? You build evals: a test set, clear metrics, and — because output is non-deterministic — often an LLM-as-judge, wired into CI so regressions fail the build. Start here.

Keep going

Every topic above has a full, hands-on learning path behind it. Pick the one closest to your problem — prompt engineering, building with LLMs, application engineering, agents, or evaluation — and work it end to end. Start simple, measure everything, and add complexity only when the numbers say you need it.

bottom of page