Lattice
Skip to content

16 essays

Notes on building AI systems that hold up.

The index tells you what exists. These essays cover the decisions behind it — what to reach for first, what looks like an optimisation and is actually a rewrite, and where the failure modes live.

  1. Continuous batching, from first principles

    A GPU decoding one request is mostly waiting on memory, not arithmetic. Batching spends the idle arithmetic. Everything a modern runtime does is in service of keeping that batch full.8 minInference
  2. When you don't need LLM evals (and when you do)

    Skip evals while nothing depends on the output. The day a prompt change can break something a user relies on, you need them, and twenty cases is enough to start.6 minEvalsPrompts
  3. When not to use an agent framework

    If you can draw the steps before the model runs, you are writing a workflow, not an agent. Workflows do not need an agent framework.7 minAgentsWorkflows
  4. Do you need an AI gateway?

    Every team needs one place where model calls go through. Not every team needs a gateway product to be that place, yet.6 minRoutingEvals
  5. When not to use a vector database

    Bad retrieval is usually a ranking or chunking problem wearing a database costume. Fix those first, and the store you already run often turns out to be enough.7 minRetrievalEvals
  6. Choosing an inference runtime

    The wrong runtime costs you throughput you never knew you were leaving on the table. The right one is usually decided by traffic shape, not model size.7 minInference
  7. The gateway is the product

    The interesting engineering is not calling a model. It is deciding which model, failing over safely, and staying inside a budget while you do it.8 minRouting
  8. Fix the ranking, not the prompt

    When a RAG system gives a bad answer, the instinct is to rewrite the prompt. Nine times out of ten the prompt is fine and the context was never there.9 minRetrievalEvals
  9. Evals are the asset, not the logging

    Traces tell you what happened. Evals tell you whether it got better. Most teams build the first and mistake it for the second.8 minEvals
  10. Agents need a durable host

    The loop is a weekend project. The part where it keeps working at three in the morning is the actual product, and almost nobody budgets for it.8 minWorkflowsAgents
  11. Prompt, or fine-tune?

    Almost every 'the model does not know this' problem is a retrieval problem wearing a hat. Here is how to tell the difference before you spend a week on a training run.7 minTrainingPrompts
  12. Where guardrails belong

    Safety is not a layer you add. It is a set of controls at specific points in a request's path, and each one catches a different class of failure.8 minGuardrails
  13. Context is a budget, not a container

    The instinct is to keep everything in case it is needed. The models are not filing systems, and past a certain length the middle of your context is doing nothing but costing money.7 minInferencePrompts
  14. Build a cost model before you optimise

    Teams optimise the thing they can see in the dashboard. The dashboard shows tokens. The number that matters is cost per successful outcome, and nobody is measuring it.7 minRoutingEvals
  15. Choosing a model is a routing problem

    There is no best model. There is a best model for a task, at a quality bar, within a latency and cost budget, and that decision is a routing policy, not a benchmark.8 minRoutingInference
  16. Observability is not logging

    A log line with a status code is not a trace. The difference is whether it can reconstruct a decision after the model that made it has been replaced twice.7 minEvals

Rules of thumb

  • Read the essay for the layer you are about to change. Depth on one decision beats breadth on fifty.
  • Trust claims that come with measurements you can rerun. Everything else is a hypothesis.
  • Advice about models ages in months. Check the date before you act on it.

Quick answers

What do these essays cover?
Decisions inside the AI stack: when to self-host, how to evaluate, what breaks in production. Each one links to the tools and comparisons it discusses.

Ask an AI about this page

Opens the assistant with this page’s link and a question already filled in.