Jon Moshier / Notes / ML Infrastructure Stack Below the API seedling
Note · From the Notebook

ML Infrastructure Stack Below the API

What actually runs beneath a model API call: the inference and training layers most application engineers never touch, and a weekend project to build real intuition for them.

Most engineers who work with AI live above a single line: client.messages.create(...). That line hides an enormous amount of systems engineering. This note maps the layer below the API call, and ends with a concrete weekend project to turn reading into intuition.

The reason to care: “I use LLMs in my product” and “I build ML infrastructure” are different jobs with different markets. The first is the application layer. The second is the machinery that makes the first possible: serving models under load, and training them in the first place. Knowing the difference, and which one you actually want to do, is worth a weekend of hands-on work.

The inference layer (serving)

This is what turns weights on disk into tokens over the wire, fast and cheap.

The training layer

This is what produces the weights the inference layer serves.

Why the layers feel invisible

The whole point of a good API is to hide this. That is a feature for product work and a blind spot for a career. If your goal is to lead or build at this layer, the abstraction you rely on daily is exactly the knowledge you are missing. The fix is not more reading. It is touching the machinery once. Related: Hidden Technical Debt in Machine Learning Systems.

The weekend project

Three weekends, roughly zero dollars (a rented GPU hour or a free Colab tier). The goal is not a product. It is to feel the two layers and find out whether the day-to-day is something you want more of.

  1. Fine-tune. Take a small open model (a 1B to 8B class model). LoRA-tune it on a tiny dataset. Watch a training loop actually run: loss curve, a run that fails, a hyperparameter that matters.
  2. Serve. Stand the result up behind vLLM. Send it real concurrent traffic, not one request at a time.
  3. Benchmark and improve. Measure tokens/sec and p99 latency under load. Then change one thing (quantize the weights, change batch settings, resize the KV-cache) and measure again. Make one number better on purpose.

What the project actually tells you: whether OOM errors, throughput graphs, and config-tuning read as satisfying or as toil. That answer is worth more than any job description, and it costs a weekend instead of a career pivot.

Where to go deeper

← All notes Read recent essays →