Put a small language model behind a gateway that admits, budgets, routes and measures every request; load it until it breaks and read what the numbers say; set service level objectives and alert on how fast the error budget burns; decide with evidence whether a cheaper model file is good enough; and move traffic to it in steps you can undo. Everything runs on one Docker host with a CPU.
Inference Engineer. Advanced.
For engineers who write Python, use Docker Compose and HTTP APIs, and want to serve a language model within measured latency and cost targets: admission control, SLOs with burn-rate alerts, quantization evidence and canary rollouts.
This project runs a language model on your own machine and surrounds it with the parts a serving team adds before anyone depends on it. Nothing leaves the machine, nothing costs money, and nothing is permanent, but the lab does hold a few gigabytes of memory and disk while it runs, and it is honest about what it assumes you know. This page covers four things: what you should already be able to do and what the project teaches; the machine, tools and downloads the lab needs; wh
ClaimSense is small enough to hold in one picture and rich enough to show every decision an inference service has to make. This page follows a claim note from a handler's screen to the last streamed token, then follows a model-file change from the evaluation gate to a promoted canary, and finishes with what happens when things go wrong. Each section names the file that implements it; the lessons teach the concepts in depth and the file guides explain the code block by block.
Every number in this project, from the SLO targets to the cost per million tokens, follows from how a language model produces text. This lesson explains that process well enough to predict what the service will do before you measure it: why the first token takes longer when the prompt is longer, why four requests at once do not take four times as long, and why a request that asks for twice the answer costs twice the time. Nothing here is specific to llama.cpp or to Qwen; the
The last lesson said that generating a token means reading every weight once. This one turns that into bytes and seconds for the model Larkmoor runs: what a GGUF file is, what the quantization in its name means, how much memory a runtime needs for its weights and its caches, and why the runtime is given three threads. By the end you can read the two numbers in compose.yaml that the gateway depends on, --ctx-size 8192 and --parallel 4, and say where they came from.
llama-server is the program that executes the model. The lab runs it from llama.cpp's official container image, pinned by digest, twice: once per model file. This lesson explains what the server does with the flags in compose.yaml, what its endpoints return, and which of its metrics the dashboards and rules read. Everything the gateway asks of a runtime is here.
"How fast is it?" has no answer without "under what load, measured how?" This lesson is about the second half of that sentence: the two ways to load a service and why only one of them can show overload, what a percentile is and which ones matter, how a histogram turns requests into a service level indicator, and one equation that tells you whether your measurement can be trusted. It ends with the report from the baseline milestone, read line by line.
The runtime has four slots. Everything the gateway does with the fifth request at a busy moment is admission control, and it is the part of the design that answers the storm-week failure directly: not "make the model faster" but "decide, quickly and visibly, what happens to work the service cannot do right now". This lesson explains the policy, reads the code that implements it, replays the storm, and compares two settings.
Admission control decides whether a request may use a slot. Two stages before it decide whether the request needs one at all: the response cache, which answers a repeated deterministic request without the runtime, and the token budget, which refuses a request that could not fit a slot. Both are cheap, which is why they run first. A third mechanism lives inside the runtime, the prompt cache, and the gateway's job there is to make its effect visible. This lesson covers all thre
The second storm-week failure was not about speed: a model-file upgrade silently renamed two fields in the claim record and broke downstream reports for a day. This lesson is about the two mechanisms that make that impossible to repeat, one at request time and one before a model file is allowed to serve: schema-constrained output, which makes the record's shape the gateway's decision rather than the model's, and the evaluation gate, which scores a model file on sixty notes wi
A service level objective is a promise written as a number: "95% of interactive requests get their first token within two seconds." This lesson shows how the gateway's histograms become that number in Prometheus, how the number becomes an error budget, how the rate at which the budget is spent becomes an alert that fires during a storm and stays quiet during a blip, and why the lab's rule file and a production rule file differ only in their constants.
A model file is a deployment. The storm-week upgrade treated it as a file copy: all traffic, at once, with nobody watching the numbers that would have shown the change. This lesson is the alternative: weighted routing so that a share of traffic can go to a new file, pinning so that checks can target it, a procedure that moves the share in steps with a measured check between each, and a rollback that is one command. The script that does it reads the same metrics the dashboards
"How many handlers can this machine serve?" and "what does a million tokens cost us?" are the two questions an inference engineer is asked most, and both have the same honest answer: measure, then divide, and show the division. This lesson finds the knee of the capacity curve with a rate sweep, turns it into handlers per machine with explicit assumptions, prices a million tokens from a machine's hourly cost, compares the two model files on that basis, and says what changes wh
This runbook takes the lab from an empty folder to a promoted model file in eight milestones, then cleanup removes everything it created. Every command runs on your own machine; nothing here touches a cloud account. Each section says what exists before it, what it creates, where the command runs, what a good result looks like and what to check when yours differs. Output shown in this page is an example of the shape to expect, not a recording of your run: your numbers will dif
Every lesson so far named a mechanism: prefill and decode, slots and the prompt cache, the scheduler's three rejections, the budget, the two caches, the grammar, the burn rate, the weight. Troubleshooting is the skill of going the other way, from a symptom a handler or a dashboard reports to the mechanism that produced it, with evidence at each step. The scenarios practise that in the form an interviewer uses: a symptom, what has been observed, and the question "what would yo
An inference engineer is asked to explain decisions, not to recite tools: why a gateway, why two classes, why those SLO windows, why that check in the rollout, and what would change if a constraint moved. The twenty questions are written the way an interviewer asks them, around this project's design and every technology it uses, with model answers grounded in the code you have run.
The lab created containers, a network, two volumes, one local image and 1.17 GB of model files. This page removes them in that order, says what is kept on purpose, and checks that nothing is left. There is no cloud resource to delete and nothing here costs money to leave running, but a runtime left up holds 0.7 GB of memory and three CPUs' worth of limits, and the lesson is a clean host.
Before a single container runs, three things have to be true: the model files on disk are the ones the lab was built with, the secrets exist and are yours, and the gateway image was built from the reviewed lock. This milestone makes each of those true and checks it, and nothing in it can be undone badly: every step is repeatable.
One command starts four containers in dependency order and returns when all of them are healthy; one script sends a request of each kind and shows you the headers and timings that the rest of the project is about. This milestone ends with a working service and your first look at what the gateway measures.
Nothing about a service's capacity can be known from its configuration. This milestone sends a quiet afternoon's traffic for two minutes, reads the report, and checks the SLO targets against what the service actually does when nothing is wrong. Every later milestone compares against this run.
The week that started this project, replayed in three minutes: a minute of arrivals at five times the quiet rate between two quiet periods. You watch the queue fill, the scheduler start rejecting, and the burn-rate alert fire, then read a report that shows the storm as outcomes rather than as missing data.
Two numbers in config/gateway.yaml decide how a storm feels to a handler: how many requests may wait, and how long. This milestone changes them, replays the same storm, and puts the two reports side by side. The lesson is not which setting is right but how to argue for one.
The cheaper model file, Q4_K_M, is 27% smaller than the current Q8_0 and generates faster. Whether it is good enough for Larkmoor's claim records is a question with a method behind it: sixty notes with exact answers, scored field by field, against floors and against the current model. This milestone starts the second runtime and asks that question.
Moving traffic to a new model file is where the storm-week upgrade went wrong: all at once, with nobody watching the right numbers. This milestone moves it in three steps with a measured check between each, and rolls back on the first check that fails. The script that does it reads the same metrics the rollout dashboard shows, so you can watch its reasoning.
"How many handlers can this machine serve?" and "what does a million tokens cost?" are the two questions a serving team is asked most, and both have the same answer: measure, then divide. This milestone sweeps the arrival rate to find where the service stops meeting its objectives, and turns the measured throughput into a cost per million tokens from a price you supply.
The lab created containers, a network, two volumes, an image and 1.17 GB of model files, all on your machine. Removing them is one command plus a check, and the check is the habit worth keeping: a cleanup that is not verified is a guess.
Learning Access: INR 199 plus 18% GST. Source Pack: INR 399 plus 18% GST. 90 days of online access. No auto-renewal.
There is no cloud cost: every component runs in containers on your own machine, and the only downloads are two Apache-2.0 model files (1.17 GB) and pinned container images. Electricity is the running cost. If you choose to run the lab on a rented virtual machine you pay that provider's hourly price and must stop the machine afterwards; the capacity lesson uses such a price only as an input to the cost arithmetic and names no provider. This is a learning reference, not a hosted lab or a production-readiness guarantee.
Vectametric Project Source Licence (2026-09-27): lawfully obtained source may be copied, modified and deployed for personal learning and interview preparation, including personal portfolio demonstrations with attribution. These permissions continue after online access expires. Do not resell or redistribute the Source Pack or its original source files, unchanged or modified. Commercial or client production use requires separate written permission. Third-party components, such as llama.cpp, Qwen2.5-0.5B-Instruct, FastAPI, Uvicorn, httpx, prometheus_client, pydantic, PyYAML, pytest, ruff, Prometheus and Grafana, retain their own licences; the model files are downloaded by the learner and are not part of the Source Pack. See LICENSE.txt and the Project Source Licence section of the site Terms for the full rules.
You can read the project material without deploying it. Running a cloud build requires the accounts, permissions and tools listed in that project's prerequisites. Deployment runs in your environment, not in a hosted Vectametric lab.
Yes. Learning Access includes the online source-file browser and explanations. The Source Pack adds the downloadable reference repository where available. The project's licence governs use of the source.
No. Cloud and CI usage are separate. Read the project's cost notice, set a budget and stop deadline, and follow its destruction and leftover-resource checks.
The project curriculum lists the available scenarios and interview topics. These focus on understanding the architecture and explaining decisions; they are not a promise of particular interview questions or a job.
The project page and checkout show the online access period for your selected plan. Access does not auto-renew. Downloaded source remains subject to its licence; future releases are not automatically included.
Review the Terms and No-Refund Policy before confirming access. All sales are final; Vectametric does not offer refunds.
Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy