CSE Roadmap

Specialist tier · about 5 hours · 4 parts

Part 2 of 4 · 15 min read

Definitions

Covers: Definitions; The pipeline; Results; Design rules; Interview questions, with the follow-ups; Common mistakes; What the example does not do.

Definitions

Open weights and open models

  • Open weights: the trained parameters can be downloaded. Open model: weights and training data are public.

Inference service and model API

  • Inference service: the system that hosts a model and answers queries. Model API: its interface.

Utilisation

  • Utilisation: the share of a paid GPU's capacity that actually serves requests. Self-hosting cost per token is inversely proportional to it.

Break-even volume

  • Break-even volume: the monthly token count above which a fixed self-hosting cost is lower than the API's per-token bill.

Router

  • Router: a component that picks which model or tool handles a request, often a small intent classifier.

Cascade

  • Cascade: call a cheap model first and escalate to a stronger one when a confidence signal says the first answer is unreliable.

Statistical power

  • Power: the chance a test detects a real difference of a given size. Paired test: compares two models on the same items using only the items where they disagree.

The pipeline

AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTo2MTczYWZkNy03YmExLTRlMmMtOGY2NS0xNGNhZGJhOTUwYWQAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaKAzHzyoAyzoEflfSIWOktkAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDpmY2E2ODY4Ny04Y2UyLTRiOTQtOTFhNy00ZTBmYTk2NDRmZTVscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNozpwfAMxMqLMnl3XWjfFfYwAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlc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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQCY658cJaZSFM8cpMBmgUNZSELNWbIDAmg3z+tvQzQ1R91/RTC6h0e2HFJX7j4FexYnXvCPOYPILzlzf0MLGEgI=Weights, devices and cost per million tokens (assumed hardware and prices)Weights in GB; green = fits with 20% headroom on: phone 8 GB, laptop 32 GB, 24 GB GPU, 80 GB GPU (cells left to right)paramsfp16int8int41B2 GB1 GB0.5 GB3B6 GB3 GB1.5 GB7B14 GB7 GB3.5 GB13B26 GB13 GB6.5 GB34B68 GB34 GB17 GB70B140 GB70 GB35 GBBatch-1 decode upper bound on the 24 GB GPU (1 TB/s assumed): 7B fp16 71 tokens/s, 7B int4 286 tokens/s, 13B int4 154 tokens/s (weights only; real speed is lower)Self-hosted cost per million generated tokens, 8B fp16 on a $2.50/h GPU (assumed), by utilisation; API assumed at $6 per millionbatch 1 (117 tok/s)$59.28 at 10%$19.76 at 30%$9.88 at 60%$5.93 at 100%batch 8 (651 tok/s)$10.67 at 10%$3.56 at 30%$1.78 at 60%$1.07 at 100%batch 32 (1271 tok/s)$5.46 at 10%$1.82 at 30%$0.91 at 60%$0.55 at 100%Break-even volume vs the API (monthly): GPU only 304 M tokens; plus $7.5k engineering 1554 M; plus $15k 2804 M.One GPU at batch 32 can serve about 3340 M tokens a month at full load, so the last two need 46% and 84% utilisation just to break even.
What fits, how fast, and what it costs (assumed hardware and prices).

Results

Model 16-bit 8-bit 4-bit Batch-1 decode bound at 1 TB/s, 4-bit (the 70B row does not fit that GPU)
3B 6 GB 3 GB 1.5 GB 667 tokens/s
7B 14 GB 7 GB 3.5 GB 286 tokens/s
13B 26 GB 13 GB 6.5 GB 154 tokens/s
34B 68 GB 34 GB 17 GB 59 tokens/s
70B 140 GB 70 GB 35 GB 29 tokens/s
Where it fits (20% headroom) 16-bit 8-bit 4-bit
7B laptop, 24 GB GPU, 80 GB GPU laptop, 24 GB GPU, 80 GB GPU also the 8 GB phone
13B 80 GB GPU only laptop, 24 GB GPU, 80 GB GPU laptop, 24 GB GPU, 80 GB GPU
70B none none 80 GB GPU only
8B model, sequence 2,048 Tokens/s $ per M tokens at 10% at 30% at 60% at 100%
Batch 1 117 59.28 19.76 9.88 5.93
Batch 8 651 10.67 3.56 1.78 1.07
Batch 32 1,271 5.46 1.82 0.91 0.55
Engineering cost per month Fixed cost per month Break-even tokens per month Utilisation needed (batch 32)
$0 $1,825 304 M 9%
$7,500 $9,325 1,554 M 47%
$15,000 $16,825 2,804 M 84%
AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQKiJxL2p9O6hNwKj+JkOwnwHaSI26X3/Tw6A14jVPKQcxogW1rLixXzgekloAya7vfAG+jK8PHKF0MoeoT0sgMk=Accuracy versus cost per call, and how many evaluation items a model switch needs (simulations)Accuracy against cost (small model cost 1, large model cost 20, both assumed)0.40.60.805101520average cost per requestrandom mixcascade, no signalcascade, signal 2cascade, signal 4difficulty router, noise 0.05Cost to come within 2 points of the large model (0.823): cascade signal 0 / 2 / 4: 20.2 / 16.0 / 13.1; router noise 0.05 / 0.2: 17.0 / 18.2; always large: 20.With a stronger small model (skill 0.7, accuracy 0.74) the cascade cost falls to 4.7.Chance a test detects a real 2-point gain (0.70 vs 0.72 skill)itemspaired testindependent-samples test30013%4%1,00030%13%3,00072%48%3,65179%59%6,18795%86%Items needed per model for 80% power (normal approximation):accuracy 0.7 to 0.73: 3,555accuracy 0.7 to 0.75: 1,252accuracy 0.7 to 0.8: 295The same-item (paired) design needed 3,651 items for a 2-point gap;the independent-samples design would need 6,187 per model.
Routing frontier and the number of evaluation items a model switch needs.
Strategy (small cost 1, large cost 20) Accuracy Cost
Always small 37.3% 1
Always large 84.3% 20
Random, 25% large 48.9% 5.74
Random, 50% large 60.9% 10.5
Random, 75% large 72.4% 15.2
Cost to come within 2 points of the large model Cost Saving vs always large
Cascade, no confidence signal 20.2 none (worse)
Cascade, signal strength 1 18.8 6%
Cascade, signal strength 2 16.0 20%
Cascade, signal strength 4 13.1 34%
Difficulty router, noise 0.05 / 0.2 / 0.5 17.0 / 18.2 / 18.9 15% / 9% / 6%
Small model skill (accuracy) Cascade (signal 2) cost Router (noise 0.05) cost
0.40 (37%) 16.0 17.0
0.55 (57%) 11.3 14.6
0.70 (74%) 4.7 9.1
Large model price ratio Always large Cascade (signal 2)
5x 5 4.8
20x 20 16.0
50x 50 38.6
Items Power, paired test Power, independent test on the same items
300 13% 4%
1,000 31% 13%
3,000 72% 48%
3,651 79% 59%
6,187 95% 86%
  1. Memory sets what runs where; quantisation moves a model down a device class.
  2. Self-host cost is mostly utilisation: the same GPU cost $0.55 or $59 per million tokens depending on batching and load.
  3. Break-even is a volume and staffing question, and may exceed what one GPU can serve.
  4. A cascade is only as good as its confidence signal, and a useless one costs more than not routing.
  5. Routing pays most when the small model is already decent and the price gap is large.
  6. Small accuracy gaps need thousands of items to detect.

Design rules

  • Write down the seven axes and which ones are hard constraints (privacy, region, on-device) before comparing models.
  • Read each licence for commercial use, user-count limits and output-use restrictions.
  • Size memory as weights plus cache, then check decode speed with a bandwidth bound before renting hardware.
  • Compute cost at realistic utilisation, not full load, and include engineering and on-call time.
  • Measure the small model on your own traffic before designing a router; the gain depends on it.
  • Make routers and confidence checks cheap and measure their own accuracy.
  • Keep an escape hatch: log escalations and sample the cheap path for review.
  • Use a paired comparison on a fixed evaluation set and plan the item count for the gap you care about.
  • Pin versions of open weights and record them with every evaluation.

Interview questions, with the follow-ups

Would you self-host a model or use an API?

"I start from hard constraints: data that cannot leave, regional rules, on-device needs. If none apply it is cost, quality and effort. In my toy an 8B model cost $0.55 per million tokens at full load and batch 32 but $59 at 10 percent load at batch 1, against an assumed $6 API price, so utilisation decides. Adding engineering time moved break-even from 304 million to 1.5 billion tokens a month." Follow-up: "What would change your mind?" Needing the strongest model, function calling or structured outputs out of the box, or low traffic.

How would you route between a small and a large model?

"Measure the small model on real traffic first. Then either a cheap difficulty or intent classifier before the call, or a cascade that escalates on a confidence signal. In my simulation a cascade with a good signal came within 2 points of the large model at 16 against 20, a useless signal cost 20.2, and a stronger small model cut it to 4.7. Random mixing only moves along the straight line." Follow-up: "How do you know the router is not hurting?" Sample cheap-path answers for review and track accuracy by route.

Will a 13B model run on my 24 GB GPU, and how fast?

"In 16-bit the weights are 26 GB, so no; in 8-bit they are 13 GB and fit with room for the cache. Decode is bandwidth-bound: bandwidth divided by weight bytes gives an upper bound, about 77 tokens per second for 8-bit at an assumed 1 TB/s, before the cache and overhead." Follow-up: "What else limits you?" The KV cache and batch size (module 6).

How many evaluation items do you need to switch to a cheaper model?

"It depends on the gap I must detect. In my simulation a 2-point difference needed about 3,650 items with a paired test, and 300 items gave only 13 percent power. If the cheaper model is only worse by 10 points, a few hundred are enough; for 2 points I need thousands, or I accept a pre-agreed margin and test non-inferiority." Follow-up: "Why paired?" Both models see the same items, so only the disagreements carry information.

Common mistakes

  • Comparing price per token without utilisation and staffing.
  • Assuming a model fits because the weights do, ignoring the cache.
  • Routing before measuring the small model.
  • A confidence signal nobody has evaluated.
  • Ignoring licence terms on output use or user counts.
  • Switching models on 100 test items.
  • Not pinning the open-weight version or the API model version.
  • Quoting vendor benchmark gaps as if they applied to your task.

What the example does not do

  • No real model: correctness is a sigmoid of skill minus difficulty; real errors are structured and correlated with the confidence signal in messier ways.
  • Assumed prices and hardware: only the 2 TB/s A100 bandwidth is a published figure; GPU rental, API price, device bandwidths and engineering cost are mine.
  • Throughput is a bytes-over-bandwidth model with a multi-head cache layout; it ignores compute, scheduling, prefill and network time.
  • Router and confidence signal are simulated, not trained on text.
  • The power calculation uses a normal approximation and one family of models; it does not cover multiple metrics or multiple comparisons.
  • No safety, privacy-compliance or licensing analysis beyond the three licence questions in the exercises.
  • Optional real experiment (I did not run this): take 500 real requests from your agent, run them through a small open model (for example with llama.cpp or vLLM) and a hosted model, score both with the same judge and compute the paired differences and the share of requests where a cheap confidence check agrees with the judge.

Check yourself

Why can an idle self-hosted GPU cost more than the API? (You pay for the hour whether tokens flow or not. In my model batch 32 at full load cost $0.55 per million tokens but $5.46 at 10 percent utilisation, against an assumed $6 API price.)

For the curious Router quality is everything

A cascade with an informative confidence signal came within 2 points of the large model at cost 16.0, against 20 for always using the large model. With no signal it cost 20.2, worse than always using the large model, because the small call was wasted. The saving shrinks as the price ratio shrinks (about 5 percent at 5x, 20 percent at 20x). A few hundred test items cannot show a 2-point difference: the paired test needed about 3,651. Prices, hardware and the correctness model are assumed; no real model was served.

What you will use daily at work

Practice What it looks like
Size memory before you choose Weights = parameters x bytes, plus the KV cache.
Compute cost per token at real utilisation Include engineering time.
Route only after measuring the small model On your own traffic and your own eval.
Read the licence for each model Commercial use, restrictions, output use.

Draft: confirm current licence terms, GPU rental prices and the serving stack you would use before relying on any figure here.

What you must be able to say (one page)

  • "Open" is a spectrum. A common distinction separates open weights (you can download the model) from open models (the training data is public too). "Open source" is often used loosely for any public-weight model, though most are open-weight only. Licences differ model by model; ask: does it allow commercial use, are there restrictions (the Llama licences require a special licence above 700 million monthly active users), and may you use its outputs to train other models (Llama 2 forbade it; later Llama versions relaxed this with conditions, which shows why you must read the current text). I did not check any current licence text.
  • Seven axes for self-host versus API: data privacy, data lineage, performance, functionality, cost, control, on-device. In short: self-hosting keeps data in-house, gives logprobs and the ability to fine-tune and freeze a version; APIs give the strongest models, scaling, function calling and structured outputs out of the box. Providers tend to keep their best models behind APIs, so open models often lag the frontier, while for many uses they suffice.
  • Will it fit, and how fast? Weights = parameters x bytes (16-bit 2, 8-bit 1, 4-bit 0.5). With 20 percent headroom: a 7B model needs 14 GB in 16-bit (fits a 32 GB laptop or a 24 GB GPU, not an 8 GB phone) and 3.5 GB in 4-bit (fits the phone); 13B in 16-bit (26 GB) fits only the 80 GB GPU; 70B in 4-bit (35 GB) fits the 80 GB GPU, in 16-bit (140 GB) fits none of my four devices. Decode speed is bounded by bandwidth / weight bytes: on a 1 TB/s GPU (assumed) a 7B model gives at most 71 tokens/s in 16-bit and 286 in 4-bit at batch 1; 13B 4-bit gives 154. These are upper bounds that ignore the KV cache and overhead (module 6).
  • Self-host economics are about utilisation. My model (8B 16-bit, $2.50 per GPU-hour assumed, about 2 TB/s for an A100-80GB): batch 1 gives 117 tokens/s, batch 8 651, batch 32 1,271. Cost per million tokens at batch 32: $0.55 at full load, $0.91 at 60 percent, $1.82 at 30 percent, $5.46 at 10 percent; at batch 1 it is $5.93 at full load and $59 at 10 percent. Against an assumed $6 per million API price, an idle GPU loses; a busy, batched one wins by a wide margin. API cost per token barely changes with scale, while self-hosted cost falls as you fill a fixed cluster.
  • Break-even needs volume and engineering time. Monthly fixed cost = GPU hours + the people. GPU only ($1,825): break-even at 304 M tokens a month (9 percent of one GPU's 3,340 M capacity at batch 32). Add $7,500 of engineering (assumed): 1,554 M tokens, 47 percent utilisation. Add $15,000: 2,804 M, 84 percent. Engineering time can cost more than the API bill it saves.
  • Routing and cascades (routers and cascades are common ways to mix models). My simulation: small model cost 1, large cost 20 (assumed), correctness = sigmoid(10 x (skill - difficulty)); small skill 0.4 gets 37.3 percent, large (0.8) gets 84.3 percent. A random mix only moves along the straight line between them (25 percent large: 48.9 percent at cost 5.74). A cascade (ask small, escalate when a confidence signal is low) with an informative signal beats the line: the cost to come within 2 points of the large model is 16.0 with a signal of strength 2 and 13.1 with strength 4, but 20.2 (worse than always using the large model) with no signal, because you paid for the small call too.
  • The savings depend on how good the small model is. Cost to match the large model within 2 points with a cascade of signal strength 2: 16.0 when the small model scores 37 percent, 11.3 at 57 percent, 4.7 at 74 percent. A difficulty-predicting router with noise 0.05 got 17.0, 14.6 and 9.1; with noise 0.2 it got 18.2 (small skill 0.4); with noise 0.5, 18.9. Router quality is everything. A verifier that costs 1 or 3 per call raised the cascade cost from 16.0 to 17.0 and 19.0.
  • The price ratio sets the prize. With the large model at 5x, 20x and 50x the small one, the cascade cost to match it was 4.8, 16.0 and 38.6: a saving of about 5, 20 and 23 percent. Routers should be small and cheap, for example an intent classifier built on a small language model or an even smaller classifier.
  • Switching models is a statistical decision. To detect a 2-point accuracy gain between two models on the same items, my paired test needed about 3,651 items for 80 percent power; an independent-samples test would need 6,187 per model. In simulation power at 3,000 items was 72 percent (paired) and 48 percent (independent test applied to the shared items, which is conservative). A gap from 70 to 80 percent needs about 295 per model; from 70 to 73 percent 3,555. A few hundred items cannot show a small difference, either way.
  • Why teams pick open models (an a16z enterprise survey, from memory): control and customisability; and you can freeze a version, whereas commercial models change, sometimes silently.
  • What to say in an interview: "I decide on seven axes: privacy, lineage, quality, features, cost, control and where it runs. I size by weights = parameters x bytes plus the KV cache, estimate decode speed from bandwidth, and compute cost per token at the utilisation I will actually achieve, including engineering time. I route or cascade only after measuring the small model on my own traffic, and I decide a switch with enough items to see the gap."
  • Honest limits: every price, GPU rental rate, bandwidth other than the published A100 figure, and the correctness model are assumptions; no real small model was served or evaluated; the router and confidence signal are simulated, not trained.