Katkat

Choosing a Model: Size, Open Weights and Cost

By the Katkat team · Updated · 9 min read

Quick overview

Learn how to choose an LLM: trade quality, latency and price, compare hosted APIs with open weights, check licences, and test properly before you switch.

Lesson 11 of 88 · AI Engineering Interview Course

After this lesson you will be able to explain how model size, latency and price pull against each other, and when a hosted API or an open-weights model is the better fit. You will also be able to work through a simple cost comparison with numbers, and describe how to test a candidate model before replacing the one in production. Interviewers use this topic to see whether you make decisions from measurements and arithmetic rather than from leaderboard rankings.

The three-way trade-off: quality, latency and price

Every model choice balances three things:

  • Quality: how often the model does your task correctly. This is specific to your task, not a general score.
  • Latency: time to first token (TTFT) and the speed of generation after that. See Streaming and Latency Metrics.
  • Price: dollars per request, or GPU-hours per request if you host the model yourself.

Larger models tend to be better at hard reasoning, long instructions and rare knowledge. They also cost more per token and respond more slowly. The reason is mechanical. Each generated token requires reading all of the model's active weights from GPU memory, so more parameters mean more bytes moved and more compute. Prefill, Decode and the KV Cache covers why prefill (reading your prompt) and decode (writing the answer) have different bottlenecks.

The three do not move together in a fixed way. A small model fine-tuned or well-prompted for a narrow task can match a large general model on that task at a fraction of the price and latency. The right question is therefore "what is the cheapest, fastest model that clears my quality bar?" and not "what is the best model?".

What model size actually buys you

Parameter count sets the memory footprint: weight memory is parameters times bytes per parameter.

ModelPrecisionBytes per parameterWeight memory
8BFP16/BF16216 GB
8BINT40.54 GB
70BFP16/BF162140 GB
70BINT8170 GB
70BINT40.535 GB

This excludes the KV cache and activations, which grow with context length and concurrent users. See Quantization for the quality cost of lower precision, and How Many GPUs Does It Take to Serve a 70B Model? for the full sizing exercise.

Size also bounds decode speed. At batch size 1, each token needs roughly one read of all the weights, so tokens per second is at most memory bandwidth divided by weight bytes. As an approximate example, take a GPU with about 2 TB/s of memory bandwidth (this varies by hardware):

  • 8B at FP16: 2,000 GB/s ÷ 16 GB ≈ 125 tokens/s upper bound.
  • 8B at INT4: 2,000 GB/s ÷ 4 GB ≈ 500 tokens/s upper bound.

Real numbers are lower because of the KV cache, kernel overheads and other work. Batching many requests shares each weight read across users, which raises total throughput but not the speed any single user sees.

Two refinements matter in interviews:

  • Mixture-of-experts (MoE) models have a large total parameter count but activate only a subset per token. Memory depends on total parameters (you must store them all), while compute per token depends on active parameters. They can be cheap to run per token but still need a lot of memory.
  • Reasoning-style models may generate many hidden or visible thinking tokens before answering. A model with a low per-token price can still cost more per task if it emits ten times as many output tokens. Compare cost per completed task, not per token.

Hosted APIs versus open weights

"Open weights" means you can download the trained parameters and run them yourself. It does not necessarily mean the training data, training code or an unrestricted licence are released, so avoid using "open source" as a synonym.

DimensionHosted APISelf-hosted open weights
Startup effortMinutes: get a key and call itDays to weeks: GPUs, serving stack, monitoring
Cost shapePay per token; zero when idlePay per GPU-hour; cost continues when idle
Cost at high steady loadGrows linearly with trafficCan be much cheaper if GPUs stay busy
Capability ceilingUsually the strongest available modelsOften a step behind the best hosted models; varies by task
Data controlData leaves your network; depends on vendor termsData can stay inside your infrastructure
CustomisationLimited to prompts, and sometimes vendor fine-tuningFull control: LoRA, full fine-tuning, quantization, custom decoding
Latency controlSubject to vendor load and rate limitsYou control batching, hardware and placement
Model changesVendor may update or retire versions on its scheduleYou pin a version indefinitely
Operational burdenLowHigh: scaling, failures, upgrades, security

Self-hosting is usually run with a serving engine such as vLLM, which uses continuous batching and paged KV-cache memory to keep GPUs busy (see Continuous Batching if you want the mechanism). Open weights also let you adapt a model cheaply with methods like LoRA.

Hosted wins when volume is low or spiky, when you need the strongest model, or when the team is small. Open weights win when data cannot leave your environment, volume is high and steady, you need deep customisation, or you must guarantee a fixed model version.

Licensing and terms

Licensing is a real selection criterion, not a footnote. Check these before building on a model:

  • Licence type: permissive licences (such as Apache 2.0 or MIT) place few limits on use. Many open-weights models instead use custom licences with their own conditions.
  • Usage restrictions: custom licences may restrict certain applications, set conditions for very large products, require attribution or naming, or forbid using the model's outputs to train competing models.
  • Derivative models: fine-tuned versions may inherit the base licence's terms.
  • Hosted API terms: check data retention, whether your data can be used for training, who owns outputs, regional processing, and any prohibited-use policy.
  • Deprecation policy: for hosted models, how much notice you get before a version is retired.

In an interview, say that you would involve legal or compliance staff for the final reading. Do not claim to give legal conclusions, but do show that you know which questions to ask.

Worked example: hosted large, hosted small, or self-hosted

The prices below are hypothetical, chosen to make the arithmetic clear. Real prices vary by vendor and change over time.

Workload: 1,000,000 requests per month, each with 2,000 input tokens and 300 output tokens.

  • Total input: 1,000,000 × 2,000 = 2,000 million tokens.
  • Total output: 1,000,000 × 300 = 300 million tokens.

Hosted large model: $3 per million input tokens, $15 per million output tokens.

  • Input: 2,000 × $3 = $6,000.
  • Output: 300 × $15 = $4,500.
  • Total: $10,500 per month, or $0.0105 per request.

Hosted small model: $0.25 per million input, $1.25 per million output.

  • Input: 2,000 × $0.25 = $500.
  • Output: 300 × $1.25 = $375.
  • Total: $875 per month, or $0.000875 per request. That is 12 times cheaper than the large model.

Self-hosted small open-weights model: assume a GPU costs $2.50 per hour and a month is 730 hours, so $1,825 per GPU per month. Use two GPUs for redundancy: $3,650 per month.

Check the load first. A 30-day month has 30 × 86,400 = 2,592,000 seconds. Average output is 300 million ÷ 2.592 million ≈ 116 tokens/s, which a batched small model on one GPU can plausibly handle, though you should confirm it with a load test that includes peaks.

Break-even against the hosted small model: $3,650 ÷ $0.000875 ≈ 4.17 million requests per month, or about 1.6 requests per second on average. Below that volume, hosted is cheaper. Above it, self-hosting can win only if the two GPUs can actually serve that load and the team's engineering and on-call time is not counted against the saving.

The lesson from the numbers: price differences between model tiers can be larger than the difference between hosting options, so try a smaller model before you try to self-host. Model Routing and Fallbacks shows how to send easy requests to the cheap model and hard ones to the expensive one.

Evaluate before you switch

Never swap models based on a public benchmark alone. Benchmarks measure general ability, not your prompts, your data or your output format. A safe process:

  1. Build a test set from real traffic, including hard cases and known past failures. Even a few hundred well-chosen examples are useful.
  2. Define pass criteria for your task: correctness, format validity, refusal behaviour, tone, and any safety checks. LLM Evaluation and LLM-as-a-Judge covers how to score these and the biases of model judges.
  3. Re-tune the prompt for the candidate. A prompt written for one model often underperforms on another. Compare each model with its own best prompt, or the test is unfair.
  4. Measure latency as a distribution: p50 and p95 TTFT and total time, under realistic load, not a single quiet call.
  5. Compute cost per successful task, including retries and longer outputs. Token counts differ between models because tokenizers differ, so the same text can cost a different amount (see Tokenization).
  6. Roll out gradually: shadow traffic, then a small A/B slice, with a quick way to roll back. See Online Evaluation and A/B Tests.

A practical selection process

When asked "which model would you use?", a structured answer works well:

  • Start with requirements: quality bar, latency target, monthly volume, data sensitivity and budget.
  • Try the strongest available model first to see whether the task is feasible at all.
  • Move down to cheaper and smaller models until quality falls below your bar. The last model above the bar is your candidate.
  • Consider routing, caching and shorter prompts before considering a migration to self-hosting.
  • Re-run the comparison when new models or prices appear, because the best choice changes over time.

How does this come up in interviews?

1. Your team uses a large hosted model and the bill is too high. What do you do? Measure where tokens go (input versus output, which features), then test whether a smaller model passes your eval set for the easy requests. Add routing, caching and shorter prompts before considering self-hosting. Report the result as cost per successful task, with the quality delta.

2. When would you choose an open-weights model over a hosted API? When data must stay in your environment, when volume is high and steady enough that busy GPUs beat per-token pricing, or when you need fine-tuning or version pinning. Hosted is better at low or spiky volume or when you need the strongest model. Mention the operational burden and that you would compute the break-even volume.

3. A new model tops a public leaderboard. Should we switch? Not on that evidence alone. Run it on your own test set with a prompt tuned for it, compare p95 latency and cost per successful task, check the licence or API terms, then roll it out through shadow traffic or an A/B test with a rollback path.

4. Why can a model with a lower price per token cost more per task? It may generate more output tokens (for example through long reasoning), need longer prompts, require more retries, or use a tokenizer that produces more tokens for your text. Compare total cost per completed task, not the list price.

5. Can you estimate the memory needed to host a 70B model? Weights are parameters times bytes: 70B × 2 bytes is 140 GB at FP16, 70 GB at INT8 and 35 GB at INT4. Add KV cache for context length and concurrency, plus overhead, and then decide on GPU count and parallelism.

Common mistakes

  • Choosing by leaderboard rank without testing on your own data and prompts.
  • Comparing models with the same prompt, which favours the model the prompt was written for.
  • Comparing price per token and ignoring output length, retries and tokenizer differences.
  • Treating "open weights" as "open source" or "free to use for anything" without reading the licence.
  • Self-hosting at low volume and ignoring idle GPU cost, redundancy and engineering time.
  • Quoting latency as an average and ignoring p95 and behaviour under load.
  • Switching all traffic at once with no shadow test, A/B test or rollback plan.
  • Forgetting that hosted model versions can change or be retired, and not pinning a version or monitoring quality.

Sources and further reading