Inference, Serving & Production·Question 25 of 76IntermediateAI-75

Self-host an open-weights model or call a provider API - walk me through the decision.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Framework with six axes, then the math:

  1. Quality requirements: if the task needs the very best frontier capability, APIs are usually the only option - the strongest open-weight models trail the closed frontier, and the ones that come closest are very large MoEs that are expensive to self-host well. If an open model (possibly fine-tuned) clears your eval bar, self-hosting is on the table. Evals decide this, not vibes.
  2. Utilization economics: GPUs bill by the hour whether busy or idle; APIs bill per token. Self-hosting wins only with high, steady utilization. Sketch the math: an H100 at ~$2-4/hr serving a well-batched 70B-class model can produce on the order of a few thousand output tokens/sec aggregate - call it ~$0.10-0.50 per million tokens at good utilization, versus API prices often 5-20× that. But at 10% utilization your effective cost multiplies 10×, and spiky diurnal traffic makes sustained utilization genuinely hard. Include the hidden line items: engineers on-call, capacity headroom, evals/upgrades.
  3. Privacy/compliance/residency: hard requirements (regulated data, air-gapped, data-residency) can force self-hosting - or at least VPC-deployed provider offerings (Bedrock, Vertex, Azure) as a middle path.
  4. Latency control: self-hosting buys colocation with your services, no rate limits, control over the full tail. APIs give you someone else's multi-tenant P99.
  5. Customisation: heavy fine-tuning, custom decoding (grammars, spec decoding tricks), LoRA-per-tenant serving - much easier on your own stack.
  6. Team: running inference infra is a real ops commitment (GPU procurement, driver/kernel issues, engine upgrades, incident response). A two-person team shipping product should almost always start on APIs.
Full worked answer

Framework with six axes, then the math:

  1. Quality requirements: if the task needs the very best frontier capability, APIs are usually the only option - the strongest open-weight models trail the closed frontier, and the ones that come closest are very large MoEs that are expensive to self-host well. If an open model (possibly fine-tuned) clears your eval bar, self-hosting is on the table. Evals decide this, not vibes.
  2. Utilization economics: GPUs bill by the hour whether busy or idle; APIs bill per token. Self-hosting wins only with high, steady utilization. Sketch the math: an H100 at ~$2-4/hr serving a well-batched 70B-class model can produce on the order of a few thousand output tokens/sec aggregate - call it ~$0.10-0.50 per million tokens at good utilization, versus API prices often 5-20× that. But at 10% utilization your effective cost multiplies 10×, and spiky diurnal traffic makes sustained utilization genuinely hard. Include the hidden line items: engineers on-call, capacity headroom, evals/upgrades.
  3. Privacy/compliance/residency: hard requirements (regulated data, air-gapped, data-residency) can force self-hosting - or at least VPC-deployed provider offerings (Bedrock, Vertex, Azure) as a middle path.
  4. Latency control: self-hosting buys colocation with your services, no rate limits, control over the full tail. APIs give you someone else's multi-tenant P99.
  5. Customisation: heavy fine-tuning, custom decoding (grammars, spec decoding tricks), LoRA-per-tenant serving - much easier on your own stack.
  6. Team: running inference infra is a real ops commitment (GPU procurement, driver/kernel issues, engine upgrades, incident response). A two-person team shipping product should almost always start on APIs.

The mature answer is usually hybrid: frontier API for the hard, low-volume reasoning paths; self-hosted small models for high-volume narrow tasks (classification, extraction, embeddings); revisit quarterly as models and prices move. Start with APIs to find product-market fit, then in-source the workloads whose token bills exceed the fully-loaded cost of serving them.

What a good answer covers

  • Quality requirements: if the task needs the very best frontier capability, APIs are usually the only…
  • Utilization economics: GPUs bill by the hour whether busy or idle; APIs bill per token
  • Privacy/compliance/residency
  • Latency control: self-hosting buys colocation with your services, no rate limits, control over the full tail
  • Customisation: heavy fine-tuning, custom decoding (grammars, spec decoding tricks), LoRA-per-tenant…

Key terms: Quality requirements · Utilization economics · high, steady utilization · Privacy/compliance/residency · Latency control · Customisation · Team · hybrid

Interviewer follow-ups to expect

  1. What monthly token volume would make you re-evaluate?

  2. How do provisioned-throughput offerings change this calculus?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep