Blog
Production AI, in practice
Notes on building AI applications and putting AI into production: architecture, models, evaluation, cost and operations.
Production AI

2 Questions Decide Between WebSocket and SSE
For one-way LLM streaming, SSE is often the better default than WebSocket. WebSocket feels like the natural choice for chat, but it is often the wrong default.…

Hosting an AI Assistant: On-Prem vs Cloud Is the Wrong Debate
For two weeks I wrote about the cost of LLM inference. Today, a choice that drives much of it: where each part of your assistant runs. The problem "On-prem or c…

Model Size: Start with 30B, Make the 120B Prove It
Going from a 30B model to a 120B one roughly doubled the GPU budget in a sizing exercise. Same traffic. Same app. With a ~30B model for RAG: - Everything fits c…

Two vLLM Settings Your Users Can Feel
Last week I wrote about what vLLM fixes and what it leaves to you. Two settings came up. They deserve their own post. They shape what users actually feel. And t…

What vLLM Fixes and What It Can't
A question that follows any discussion of batching: doesn't vLLM solve this? Short answer: no. It makes the trade-off a lot better. It can't make it go away. A…

50 Tokens/s or 2,500: Batching, and Who Pays for Latency
Here's a number that surprised me the first time I worked it out. A 70B model on an H200 produces about 68 tokens per second for one user on paper. 45 to 50 in…

The KV Cache Is the Real Tenant of Your GPU
“Fits on the GPU” is usually the wrong question. I’ve had teams tell me a model is fine because the weights fit. Mistral 7B in FP16 is about 14.5 GB, so on pape…

Per Million Tokens on Paper. $29 in Reality.
Same GPU. $0.14 per million tokens. Or $29. I've computed both. Neither number is wrong. The $0.14 version: → 8× H200 node, ~$370k, amortized over 3 years → + p…

Tokens Don't Size GPUs. Memory Does.
263 million tokens a month. That's about 100 tokens per second. Less than 2% of one H200. The production answer was still 4 GPUs. Not 1. Not 0.02. Here's why th…

Adaptive Agent Glossary
AI is developing so fast, and we hear new vocabulary every day. Learning the vocabulary of a domain is one of the most efficient ways to learn new things. Here…

Adaptation Paradigms
Adaptive AI agents can be improved in three different ways: 1. Behaviour adaptation token space 2. Knowledge adaptation token space 3. Model adaptation weight s…

Skill Induction Engine
The Skill Induction Engine is the core component responsible for behavioral adaptation in adaptive AI agents. It transforms an agent's raw execution logs and pa…

Agent Memories
Agent memory is not a bigger context window. It is a system design problem. And the default instinct to "just add more tokens" is usually wrong. So the job is n…

AI Code Review Skill Development Cycle
AI code review gets better when you stop repeating the same feedback and turn it into reusable review rules. That’s the idea behind agent skill development. The…

Selective Context Retrieval
Most AI code review systems are doing too much. They feed the model the whole codebase and hope it finds the signal. What actually works: - parse the repo into…

AI Code Review
When code generation gets faster, review has to get stricter. Human review alone does not scale well once PRs get large and frequent, and it is easy to slip int…

AI + Human Code Review
“AI code review will replace human reviewers” is the wrong mental model. I’ve seen teams treat it like a shortcut: ship more PRs, skim the summary, move on. Tha…

Agent Harness
An agent without a harness is just a demo with confidence. What makes an AI agent usable in production is not the prompt. It’s the harness around it. In practic…

Linear vs Graph Workflow
Yesterday, I was discussing linear workflows and graph workflows with a colleague. The common assumption is that linear means no conditions, and graph means con…

When to Use Graph
Graph Engineering is worth it when you need control, not just cleverness. 𝗨𝘀𝗲 𝗶𝘁 𝘄𝗵𝗲𝗻: - 𝗧𝗵𝗲 𝘄𝗼𝗿𝗸𝗳𝗹𝗼𝘄 𝗶𝘀 𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲𝗱: mixing code, LLMs, tools, and humans with c…

Jev
A model that never writes the answer can still make the right decision. I first think of Jev as a traffic controller, not a chatbot. It looks at the incoming si…

Graph Engineering Frameworks and Applications
𝗚𝗿𝗮𝗽𝗵 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝗶𝗻𝗴: 𝗧𝗵𝗲 𝗕𝗶𝗴 𝗣𝗶𝗰𝘁𝘂𝗿𝗲 𝟭. 𝗟𝗮𝗻𝗴𝗚𝗿𝗮𝗽𝗵 - 𝗪𝗼𝗿𝗸𝗳𝗹𝗼𝘄 𝗮𝘀 𝗮 𝘀𝘁𝗮𝘁𝗲 𝗺𝗮𝗰𝗵𝗶𝗻𝗲: nodes do the work, edges control the flow. - 𝗗𝘆𝗻𝗮𝗺𝗶𝗰 𝗳𝗮𝗻-𝗼𝘂𝘁/𝗳𝗮𝗻-𝗶𝗻: Send lets yo…

Graph Topologies
In 𝗚𝗿𝗮𝗽𝗵 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝗶𝗻𝗴, execution topologies are the blueprint for how data, control, and state move through AI systems. They’re not just diagrams — they’re archi…

Agent Loop vs Graph Engineering
Agent loops and graph engineering are not opposites; they operate at different levels. - 𝗔𝗴𝗲𝗻𝘁 𝗹𝗼𝗼𝗽: a simple, single-node, sequential “think-act-observe” cycle…

Speculative Decoding
Speculative decoding speeds up LLM generation by exploiting a key asymmetry: 𝘁𝗼𝗸𝗲𝗻 𝗴𝗲𝗻𝗲𝗿𝗮𝘁𝗶𝗼𝗻 𝗶𝘀 𝘀𝗲𝗾𝘂𝗲𝗻𝘁𝗶𝗮𝗹, 𝗯𝘂𝘁 𝘁𝗼𝗸𝗲𝗻 𝘃𝗲𝗿𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗶𝘀 𝗽𝗮𝗿𝗮𝗹𝗹𝗲𝗹. - 𝗠𝗮𝗶𝗻 𝗯𝗼𝘁𝘁𝗹𝗲𝗻𝗲…
Productivity Tricks
When I start a session in Claude Code or Codex, I used to give it a list of to-do items, which I have prepared somewhere in a file or in a notebook. Each item s…

Codex vs Claude Code
Till now, I was always using Claude Code. I tried Codex, and it made me want to switch. Because it's faster, uses fewer tokens, and has a nicer UI. A nicer UI i…

Disaggregated LLM Serving
Disaggregated LLM serving looks complicated. But the core idea is simple: Don’t make one GPU do two very different jobs. Disaggregated LLM serving splits LLM in…

LLM Serving Optimisation Tools and Techniques
You do not solve the LLM trade-off triangle with one tool. You solve it by stacking the right ones. Here are the five layers that actually move the needle: 1. 𝗖…

LLM Deployment Benchmarking
Benchmarking is not something you do at the end of an LLM deployment. It is what stops you making expensive mistakes at every stage. Here are the 4 moments wher…

LLM App Load Patterns
I used to think load testing was just “push harder and see what breaks.” Then I watched a system look great under a neat, constant stream of traffic. And fall a…

Service Level Objectives
Why your LLM app looked great in the notebook, but failed the moment real users hit it? The average latency was fine. The p99 was not. That is when you should s…

vLLM
LLM inference looks complicated. It mostly comes down to 4 runtime tricks. 𝟭 𝗖𝗼𝗻𝘁𝗶𝗻𝘂𝗼𝘂𝘀 𝗯𝗮𝘁𝗰𝗵𝗶𝗻𝗴 Old batching waits for the slowest request. Continuous batching…

Model Weight Quantisation
Quantisation is how you make a 109B model fit on hardware that should not be able to run it. At a simple level, it means storing numbers with less precision so…

Production AI System Architecture
Most AI projects start with a model. Production AI systems don’t. They start with 𝗮𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲. A production-grade AI system needs much more than an LLM: → 𝗨𝗜 /…

What Actually Happens Inside a Production AI System?
A production AI system is never “user input → AI answer.” The first time I saw a demo work beautifully, I thought the hard part was done. Then it met real users…

AI Engineering
If you think AI engineering is prompt engineering, you’re missing most of the job. A prompt is maybe 5% of the system. The real work starts after the prototype.…

KV Cache
Serving LLMs is as much a memory problem as a compute problem. Here is why: 𝟭. 𝗟𝗟𝗠𝘀 𝗴𝗲𝗻𝗲𝗿𝗮𝘁𝗲 𝗼𝗻𝗲 𝘁𝗼𝗸𝗲𝗻 𝗮𝘁 𝗮 𝘁𝗶𝗺𝗲 An LLM does not produce a full answer in one pa…

Deploying LLM
On-prem LLM deployment looks hard. It isn’t. The real difference between a costly bottleneck and an efficient production system comes down to two kinds of optim…
AI thinking

The Next AI Breakthrough Won’t Just Be Smarter Models — It’ll Be Faster Ones
𝗔𝗜 The next AI breakthrough won’t just be smarter models — it’ll be faster ones For nearly a decade, since Transformers took off in 2017, LLM companies have cha…

Async Intelligence vs Instantaneous Inference
𝗔𝗜 𝗔𝘀𝘆𝗻𝗰 𝗶𝗻𝘁𝗲𝗹𝗹𝗶𝗴𝗲𝗻𝗰𝗲 is AI that thinks 𝗮𝗵𝗲𝗮𝗱 𝗼𝗳 𝘁𝗶𝗺𝗲. It precomputes content in batches, stores it, and serves it later — which means the result can be 𝗵𝗼𝘂𝗿𝘀 𝗼…

Fast Inference Shift
𝗔𝗜 𝗪𝗵𝗶𝗰𝗵 𝗻𝗲𝘄 𝗱𝗲𝘀𝗶𝗴𝗻 𝘀𝗽𝗮𝗰𝗲 𝗶𝘀 𝘂𝗻𝗹𝗼𝗰𝗸𝗲𝗱 𝗳𝗿𝗼𝗺 𝗽𝗿𝗲-𝗰𝗼𝗺𝗽𝘂𝘁𝗲𝗱 𝗶𝗻𝘁𝗲𝗹𝗹𝗶𝗴𝗲𝗻𝗰𝗲 𝘁𝗼 𝗶𝗻𝘀𝘁𝗮𝗻𝘁 𝗶𝗻𝘁𝗲𝗹𝗹𝗶𝗴𝗲𝗻𝗰𝗲? 𝗢𝗹𝗱 𝘄𝗮𝘆: 𝗽𝗿𝗲-𝗰𝗼𝗺𝗽𝘂𝘁𝗲𝗱 𝗶𝗻𝘁𝗲𝗹𝗹𝗶𝗴𝗲𝗻𝗰𝗲 - Generate responses in 𝗻𝗶𝗴𝗵𝘁𝗹𝘆…

How Does the WSE Process Multiple Users at Once?
𝗔𝗜 How does the WSE process multiple users at once? Cerebras WSE handles multiple users with a 𝗽𝗶𝗽𝗲𝗹𝗶𝗻𝗲, not big batches. - 𝗢𝗻𝗲 𝘁𝗼𝗸𝗲𝗻 𝗱𝗼𝗲𝘀𝗻’𝘁 𝘂𝘀𝗲 𝗮𝗹𝗹 𝘁𝗵𝗲 𝗯𝗮𝗻𝗱𝘄𝗶…

GPU vs WSE
𝗔𝗜 𝗪𝗵𝗮𝘁 𝗽𝗲𝗼𝗽𝗹𝗲 𝘁𝗵𝗶𝗻𝗸 𝗮𝗯𝗼𝘂𝘁 𝗶𝗻𝗳𝗲𝗿𝗲𝗻𝗰𝗲 𝘀𝗽𝗲𝗲𝗱 𝗶𝘀: - Faster chips just mean more raw compute - Inference speed is mostly a software problem - GPUs and TPUs are “goo…

Which Businesses Most Benifit from Fast Inference
𝗔𝗜 The business use cases that benefit most from fast, real-time inference are: - 𝗧𝗿𝗮𝗱𝗶𝗻𝗴 𝗮𝗴𝗲𝗻𝘁𝘀: spot market signals in real time and act instantly - 𝗠𝗲𝗱𝗶𝗮: br…

Compute-Bound vs Memory-Bound
𝗔𝗜 In AI, 𝗰𝗼𝗺𝗽𝘂𝘁𝗲-𝗯𝗼𝘂𝗻𝗱 means the chip is limited by how fast it can do math. 𝗠𝗲𝗺𝗼𝗿𝘆-𝗯𝗼𝘂𝗻𝗱 means it’s limited by how fast it can move data. 𝗖𝗼𝗺𝗽𝘂𝘁𝗲-𝗯𝗼𝘂𝗻𝗱 This i…

Three Levels of Inference Speed Improvement
𝗔𝗜 𝗧𝗵𝗿𝗲𝗲 𝗟𝗲𝘃𝗲𝗹𝘀 𝗼𝗳 𝗜𝗻𝗳𝗲𝗿𝗲𝗻𝗰𝗲 𝗦𝗽𝗲𝗲𝗱 𝗜𝗺𝗽𝗿𝗼𝘃𝗲𝗺𝗲𝗻𝘁 AI models achieve higher speeds through 𝘁𝗵𝗿𝗲𝗲 𝗱𝗶𝘀𝘁𝗶𝗻𝗰𝘁 𝗹𝗮𝘆𝗲𝗿𝘀: 1. 𝗜𝗻𝗳𝗲𝗿𝗲𝗻𝗰𝗲 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻𝘀 𝘚𝘰𝘧𝘵𝘸𝘢𝘳𝘦 𝘵𝘦𝘤𝘩𝘯𝘪𝘲𝘶𝘦𝘴 lik…

How Does Inference Speed Unlock New Categories of AI Applications?
𝗔𝗜 Inference speed unlocks 𝗮 𝘄𝗮𝘃𝗲 𝗼𝗳 𝗻𝗲𝘄 𝗯𝘂𝘀𝗶𝗻𝗲𝘀𝘀 𝗼𝗽𝗽𝗼𝗿𝘁𝘂𝗻𝗶𝘁𝗶𝗲𝘀: - 𝗩𝗼𝗶𝗰𝗲 𝗮𝗴𝗲𝗻𝘁𝘀 𝘁𝗵𝗮𝘁 𝗳𝗲𝗲𝗹 𝗵𝘂𝗺𝗮𝗻 — no awkward pauses, just natural back-and-forth. - 𝗟𝗶𝘃𝗲 𝘁𝗿𝗮𝗻𝘀𝗹𝗮…

What Are the Three Key Metrics Used to Measure Inference Speed?
𝗔𝗜 The three key inference-speed metrics are: - 𝗧𝗶𝗺𝗲 𝘁𝗼 𝗙𝗶𝗿𝘀𝘁 𝗧𝗼𝗸𝗲𝗻 𝗧𝗧𝗙𝗧 : how long it takes before the model starts responding - 𝗧𝗼𝗸𝗲𝗻𝘀 𝗽𝗲𝗿 𝗦𝗲𝗰𝗼𝗻𝗱 𝗧𝗣𝗦 : how fa…

Why Is the AI Industry Shifting Focus Toward Inference Speed?
𝗔𝗜 𝗪𝗵𝘆 𝗱𝗶𝗱 𝗢𝗽𝗲𝗻𝗔𝗜 𝘀𝗶𝗴𝗻 𝗮 𝗺𝘂𝗹𝘁𝗶-𝘆𝗲𝗮𝗿 𝗱𝗲𝗮𝗹 𝘄𝗶𝘁𝗵 𝗖𝗲𝗿𝗲𝗯𝗿𝗮𝘀 𝗦𝘆𝘀𝘁𝗲𝗺𝘀, 𝘄𝗵𝗶𝗰𝗵 𝗶𝘀 𝘃𝗮𝗹𝘂𝗲𝗱 𝗮𝘁 𝗼𝘃𝗲𝗿 $𝟮𝟬 𝗯𝗶𝗹𝗹𝗶𝗼𝗻? AI is shifting from 𝘄𝗵𝗼’𝘀 𝘀𝗺𝗮𝗿𝘁𝗲𝘀𝘁 to 𝘄𝗵𝗼’𝘀 𝗳𝗮𝘀𝘁𝗲𝘀𝘁. Becaus…

Intelligence Is Not the Same as Wisdom
𝗔𝗜 𝗜𝗻𝘁𝗲𝗹𝗹𝗶𝗴𝗲𝗻𝗰𝗲 𝗶𝘀 𝗻𝗼𝘁 𝘁𝗵𝗲 𝘀𝗮𝗺𝗲 𝗮𝘀 𝘄𝗶𝘀𝗱𝗼𝗺 This is crucial. A system can be: - extremely intelligent - highly capable - strategically brilliant and still be 𝗺𝗶𝘀𝗮…

Does Motivation Exist Only in Biological Bodies?
𝗔𝗜 𝗗𝗼𝗲𝘀 𝗺𝗼𝘁𝗶𝘃𝗮𝘁𝗶𝗼𝗻 𝗲𝘅𝗶𝘀𝘁 𝗼𝗻𝗹𝘆 𝗶𝗻 𝗯𝗶𝗼𝗹𝗼𝗴𝗶𝗰𝗮𝗹 𝗯𝗼𝗱𝗶𝗲𝘀? 𝗣𝗿𝗼𝗯𝗮𝗯𝗹𝘆 𝗻𝗼𝘁. There is 𝗻𝗼 𝘀𝘁𝗿𝗼𝗻𝗴 𝗿𝗲𝗮𝘀𝗼𝗻 to believe motivation is limited to biology. Biological organisms ar…

Will a Superintelligence Have Motivation or Independent Thinking?
𝗔𝗜 𝗧𝗵𝗶𝗻𝗸𝗶𝗻𝗴 𝗪𝗶𝗹𝗹 𝗮 𝘀𝘂𝗽𝗲𝗿𝗶𝗻𝘁𝗲𝗹𝗹𝗶𝗴𝗲𝗻𝗰𝗲 𝗵𝗮𝘃𝗲 𝗺𝗼𝘁𝗶𝘃𝗮𝘁𝗶𝗼𝗻 𝗼𝗿 𝗶𝗻𝗱𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝘁 𝘁𝗵𝗶𝗻𝗸𝗶𝗻𝗴? 𝗛𝘂𝗺𝗮𝗻-𝘀𝘁𝘆𝗹𝗲 𝗺𝗼𝘁𝗶𝘃𝗮𝘁𝗶𝗼𝗻: Probably 𝗻𝗼𝘁 𝗯𝘆 𝗱𝗲𝗳𝗮𝘂𝗹𝘁. Humans have motivation because of…

What Would the Interests of a Superintelligence Be?
𝗔𝗜 𝗔𝗹𝗶𝗴𝗻𝗺𝗲𝗻𝘁 𝗪𝗵𝗮𝘁 𝘄𝗼𝘂𝗹𝗱 𝘁𝗵𝗲 𝗶𝗻𝘁𝗲𝗿𝗲𝘀𝘁𝘀 𝗼𝗳 𝗮 𝘀𝘂𝗽𝗲𝗿𝗶𝗻𝘁𝗲𝗹𝗹𝗶𝗴𝗲𝗻𝗰𝗲 𝗯𝗲? This depends on 𝗵𝗼𝘄 𝗶𝘁 𝗶𝘀 𝗯𝘂𝗶𝗹𝘁. A superintelligence would not automatically have human-like de…

How Can We Ensure That Its Decisions Remain Aligned with Our Goals and Values?
𝗔𝗜 𝗔𝗹𝗶𝗴𝗻𝗺𝗲𝗻𝘁 𝗛𝗼𝘄 𝗰𝗮𝗻 𝘄𝗲 𝗲𝗻𝘀𝘂𝗿𝗲 𝘁𝗵𝗮𝘁 𝘁𝗵𝗲 𝗱𝗲𝗰𝗶𝘀𝗶𝗼𝗻𝘀 𝗺𝗮𝗱𝗲 𝗯𝘆 𝗔𝗜 𝗿𝗲𝗺𝗮𝗶𝗻 𝗮𝗹𝗶𝗴𝗻𝗲𝗱 𝘄𝗶𝘁𝗵 𝗼𝘂𝗿 𝗴𝗼𝗮𝗹𝘀 𝗮𝗻𝗱 𝘃𝗮𝗹𝘂𝗲𝘀? Not by giving it a 𝘀𝗶𝗻𝗴𝗹𝗲 𝗱𝗲𝗳𝗶𝗻𝗶𝘁𝗶𝗼𝗻 𝗼𝗳 𝘀𝘂𝗰𝗰𝗲𝘀𝘀. Human va…

This Repo Is Getting 125 Stars a Day
𝗔𝗜 🌟 This GitHub repository is gaining 125 stars a day. It’s a really solid prompt collection. And their website, @prompts.chat, is beautifully designed. You cl…