FDE Academy

Module 3 · Inference engineering · Chapter 20 · Free

Why run models yourself? Inference engineering for FDEs

16 min1 decision tree1 stack diagram1 break-even calculator3 checks
The problem A regional insurer wants an assistant that reads claim files. Their security team has one rule: claim text may not leave their cloud account. Meanwhile finance has seen the pilot's API bill and asks whether it will still make sense at ten times the traffic. The customer turns to you and says, "Can we just run the model ourselves?" Your answer needs to be neither "yes, obviously" nor "no, use the API". It needs numbers, trade-offs and a plan.

Two ways to get tokens

Up to now this course treated the model as a service you call. A managed API (a hosted model from a provider) means someone else owns the hardware, the software that runs the model and the pager. You send text, you get text, you pay per token.

The alternative is self-hosting an open-weight model. "Open-weight" means the trained model file (its weights) is published so you can download and run it. You rent or own GPUs, run the model on them, and expose your own endpoint. Running a model to answer requests is called inference, and doing it well on purpose is inference engineering. Note that open-weight is not always the same as open source: the license still sets rules, which Chapter 22 covers.

Neither is better in general. They are two different bundles of responsibility. This chapter helps you see which bundle fits a given customer, and why the answer often changes as the customer grows.

Why customers ask for it

What you take on

Every reason above has a matching bill in engineering time. If you self-host you now own:

The honest summary: a managed API sells you a result. Self-hosting sells you control, and control has to be staffed.

Decide with the customer

You will rarely be asked to pick for yourself; you will be asked to help a customer pick. Walk this tree with their real answers. The "why not the others" line under each result is the part to say out loud in the meeting.

The three layers

"Run the model" hides a lot. It helps to split inference engineering into three layers, from the metal up to the workflow. Step through the stack.

The three layers of inference engineering A customer application sends requests down through a tooling layer, an infrastructure layer and a runtime layer that executes the model on GPUs. Customer app and traffic Layer 3: Toolingdeploys, monitoring, evals, cost reports Layer 2: Infrastructureautoscaling, routing, regions, GPU supply Layer 1: Runtimethe model and engine on one GPU or node
  1. Real users send prompts of varying length, at varying times. Everything below exists to serve this traffic at the speed and price the product needs.
  2. The runtime is the part that actually runs the model on a GPU: the model weights, the serving engine and the speed techniques inside it. It decides how fast one copy of the model answers and how many requests it handles at once. Most of Module 6 lives here.
  3. One fast copy is not a service. Infrastructure adds many copies, load balancing, scaling up and down with demand, multiple regions and a supply of GPUs. It is what keeps latency steady when traffic doubles.
  4. The layer people feel day to day: how you deploy a new model version, watch latency and errors, run evals before shipping, and see what each request cost.
  5. A fast runtime on thin infrastructure still gives users slow tails. Great infrastructure with no tooling means nobody notices a quality regression. When you scope a self-host project, ask who owns each layer.
CustomerToolingInfrastructureRuntime

Why scale and specialization change the answer

Two forces push customers from API to self-hosted.

Scale. A managed API price includes the provider's margin and the cost of idle capacity they hold for everyone. When your volume is large and predictable, you can keep your own GPUs busy and that bundle gets less attractive. It also becomes worth spending engineer-weeks on speed-ups, because a 20% gain on a big bill pays for the work.

Specialization. A general frontier model is built to be good at everything. Many products need one narrow job done well: classify tickets, extract fields, answer from a product manual. A smaller model tuned to that job (Chapters 16 and 22) can match a large one on the task, answer faster and cost far less to run. Smaller specialised models are cheap to self-host and often are not offered as a managed product at all.

Both forces apply to the insurer: steady claim volume and one narrow, well-defined reading task.

Workload shape matters

Ask for three numbers early: requests per day, typical prompt and answer length, and how much of the day is busy. Chapter 21 shows how to measure these properly.

Calculator: when does it break even?

Enter your own numbers. This page contains no provider prices, on purpose: use the customer's real quote and your real GPU bill. The values pre-filled are placeholders, not market data. Everything runs in your browser and nothing is sent anywhere.

Model: self-host cost = GPU cost + engineering cost, treated as fixed. API cost = volume x price. Break-even volume = fixed cost / price. Real life adds idle time, scaling steps, discounts and quality differences, so treat the result as a first filter, not a quote.

Recap

In the field A composite example: a team moved a steady classification workload onto its own GPUs because the pilot bill looked high. Six weeks later average GPU usage was low, because most requests arrived during business hours and the cluster was sized for the busiest minute. The fix was not a faster model. They moved the overnight batch work onto the same GPUs, kept the API for rare long requests, and the effective cost per token dropped. Look at the shape of the day, not just the monthly total.
Go deeper This chapter follows the scope of the book Inference Engineering by Philip Kiely (Baseten Books, 2026): Chapter 0, section 1.1 Scale and Specialization, and section 1.2 About Your App. Find it at baseten.co/inference-engineering. This is independent course material, not endorsed by the author or Baseten. For the serving software itself, start with the vLLM documentation and the Hugging Face model card guide (what to read on a model's page, including its license).

Chapter quiz

Four questions. Score 70% or more to mark this chapter complete.

Review