Skip to content
aiqbenchAI & Quantum Intelligence
NewsInsightsBenchmarksSkillsAsk AILearnAbout
...Loading your session
NewsInsightsBenchmarksSkillsAsk AILearnAbout
  1. Future Jobs
  2. ›
  3. AI Inference & Efficiency Engineer
  4. ›
  5. Lesson 8 of 8

Capstone: Serve a Small Model Two Ways and Write the Report

Advanced¶ Read · 5 min⚑ Mission · 75 min◆ Test · 5 questions✓ Checked Nov 23, 2026

You'll be able to:

You can download an open-weight model, serve it with two different stacks or precisions on your own machine, benchmark both with a fixed workload, check that quality survived, and turn the numbers into a one-page cost-and-latency report with a recommendation and its caveats.

The capstone: one model, two configurations, one honest page

Everything in this track converges on a short report that a decision-maker can read in five minutes and an engineer could reproduce in an afternoon. This lesson is the procedure for producing it on hardware you already own, with no account and no paid tool. The absolute numbers matter less than the discipline — your laptop is not a production server: fixed workload, stated metrics, quality check, cost derivation, caveats.

Choosing the model and the two configurations

Pick a small open-weight instruction-tuned model, in the 0.5B–1.5B range, in GGUF format from Hugging Face; many are published by the model's own authors and download without a login. Small is deliberate: it fits in under about a gigabyte at 4-bit, runs at usable speed on a CPU, and allows several benchmark runs within the time box.

Then choose a pair of configurations that differ in one thing you have studied:

  • Precision: the same model at Q8_0 and at Q4_K_M in llama.cpp. This isolates module 2's trade-off — bytes per weight against quality.
  • Runtime: PyTorch Transformers (16-bit or whatever your machine supports) against llama.cpp. This isolates kernel and memory-layout differences from module 5.
  • If you have a CUDA GPU with enough memory, vLLM against llama.cpp is the production-relevant pair; the vLLM quickstart gets a server up in minutes, but it is optional, not required.

The llama.cpp server README shows how to start an OpenAI-compatible HTTP endpoint with a given GGUF and context size; the llama-bench README documents the tool that measures prompt-processing and generation speed for one model under several settings and prints a table. The Hugging Face guide "Optimizing LLMs for Speed and Memory" is the reference for the Transformers side: loading in lower precision, enabling the fast attention path, and understanding the KV cache that the generate loop keeps.

The procedure

  1. Fix the workload. Write 30 prompts in a text file: ten short questions, ten that include a 400–800-word passage to summarise or answer from, ten that ask for structured output (a list, JSON, a table). Set max output tokens to 150 for all. Same file for every run.
  2. Warm up and run. Discard the first three requests of each run; models and kernels are slower while memory is first touched. Then run all 30 prompts at concurrency 1, recording per request: time to first token, total time, prompt tokens, output tokens. Repeat at concurrency 4 using the server's HTTP endpoint and a small script (or a load tool) that fires four requests at once and keeps four in flight.
  3. Compute the metrics from module 6. Per configuration and concurrency: median and p99 TTFT, median and p99 end-to-end latency, per-request decode tokens/s (output tokens ÷ (total − TTFT)), and aggregate output tokens/s over the whole run. Percentiles from all 27 kept samples, not averages of averages.
  4. Check quality. Save every output. For ten prompts (pick before looking at results), place the two configurations' answers side by side and mark each: equivalent, slightly worse, clearly worse. Count. If one configuration produces broken JSON or repetition loops the others do not, that is a finding more important than any speed number.
  5. Derive cost. Pick an hourly price you can defend — a public cloud listing for a machine like yours, or an amortised estimate for your own hardware — and state it. Cost per million output tokens = price ÷ (aggregate output tokens/s × 3,600). Compute it at concurrency 4, which is the closer approximation to a server, and show the arithmetic.
  6. Write the page. One results table (rows: configuration × concurrency; columns: the metrics above and cost), one quality tally, one paragraph of recommendation, and two or three caveats.

What to expect, and what to be suspicious of

Expect the 4-bit model to decode faster than the 8-bit one by somewhat less than 2×: Q4_K_M actually stores about 4.9 bits per weight against Q8_0's 8.5 (a ratio near 1.75×), and the KV cache and per-step overheads do not shrink; module 1 predicted this. Expect llama.cpp on CPU to beat unoptimised Transformers by a large margin that is mostly kernel quality. Expect concurrency 4 to raise aggregate tokens/s by less than 4× on a laptop, since memory bandwidth saturates quickly — and note whether per-request latency at concurrency 4 would still be acceptable to a user.

Be suspicious if TTFT is near zero on long prompts (prefix caching may be on — state it or disable it), if tokens/s is identical across configurations (you are probably measuring your script, not the model), or if the quality tally is perfect (check that max tokens did not truncate everything before the differences appear).

Writing the caveats like an engineer

The recommendation is where most reports lose credibility, in both directions. "Q4 is 1.7× faster and quality was equivalent on 10 of 10 prompts, so ship Q4" is defensible if the table backs it. Add the caveats a reader would otherwise raise: a laptop's bandwidth and thermal behaviour are nothing like a server GPU; ten prompts is a smoke test, not an evaluation; concurrency 4 is not concurrency 64; a 1B model's sensitivity to quantization is not a 70B model's. Naming the limits of your evidence makes the claims you do make believable.

What is still unsettled

There is no agreed standard for local inference benchmarks: every tool defines prompt-processing and generation speed slightly differently, and GGUF quantization types evolve. One more reason to publish your exact commands and versions, so the next person can reproduce rather than trust.

What to remember

  • Change one variable between configurations; keep the model, workload, max tokens and hardware fixed.
  • Warm up, record per-request timings, and report percentiles from the full sample at each concurrency.
  • A side-by-side quality tally on a pre-chosen subset is mandatory; speed without quality is not a result.
  • Show the cost arithmetic and the assumed price, then write the caveats before the reader does.

Curated Materials

1.6h

The deep work happens here — the lesson is your briefing.

  • llama.cpp server: OpenAI-compatible HTTP server READMEDocs· 30 min
  • llama-bench: performance testing tool README (llama.cpp)Docs· 20 min
  • Optimizing LLMs for Speed and Memory (Hugging Face Transformers guide)Tutorial· 45 min

Live on aiqbench

This lesson's subject on the rest of the site, today.

In the news, last 30 days

  • GPU decoder keeps pace with a superconducting qubit clock on a continuous stream, with NVIDIA NVQLink interconnectAlice & Bob · Dec 1
  • DeepSeek Opens Source Production-Level Ascend Inference Code36Kr · Dec 1
  • NVIDIA and Cerebras Partner to Accelerate AI Agent Inference with Two-Stage Compute Architecture36Kr · Dec 1
More news on this subject →

Go further

  • Which model is worth it?Price, speed and hardware next to capability.
  • Ask AI about this lessonOpens Ask AI with a question about this lesson, answered from the news archive with sources.
  • Agent skills for this workReady-made skills for AI coding agents, checked and rated.

Test your knowledge

5 questions in 100 seconds, on a page of its own. Read everything above first.

Test your knowledge →

Module Mission

60–90 min

Serve one small open-weight instruct model (for example a 0.5B–1.5B GGUF from Hugging Face, which needs no account) two ways on your own machine: llama.cpp at Q8_0 and at Q4_K_M, or PyTorch Transformers versus llama.cpp. Run the same 30 prompts through both at concurrency 1 and 4 using llama-bench or a short script, record TTFT, decode tokens/s and p50/p99 latency, and compare the outputs on ten prompts for obvious quality loss. Write a one-page report: a results table, cost per million output tokens at an assumed machine price, which configuration you would ship, and two caveats about how your laptop numbers would not transfer to production.

Loading your work…

← Previous lesson7. Caching, Routing and the Small-vs-Large Model DecisionAfter the last lesson →Final check and certificate
aiqbench
AI & Quantum Intelligence© aiqbench. All rights reserved.

Feeds:RSS·JSON Feed

LanguageEnglish·Românăbeta
NewsAI & TechQuantumInsights
ExploreBenchmarksLearn
CompanyAboutTrustLegal noticeTerms of ServicePrivacy PolicyCopyright noticesData erasureReport content

The aiqbench take, the insights, the daily digest and Ask answers are written by AI models from the sources shown, without editorial review before publication. They may contain errors — check the source. How the model is used →

  • News
  • Insights
  • Ask AI
  • Benchmarks
  • Account