Research

Serving systems

The BiOS inference engine: serving as a cache-management problem

Abstract

BiOS Inference serves models in production. It is built on PyTorch[1] and designed for agentic work rather than for chat, which turns out to be a different problem with a different dominant cost.

An agent revisits the same material constantly: a system prompt, a codebase, a document, a video. That repetition is the largest single opportunity in the workload and most serving stacks leave it on the table. This paper sets out the cache tiers that exploit it, argues that exactness is what makes caching safe to leave on by default, and explains why running unchanged across accelerator generations is a requirement rather than a nicety.

Published
12 September 2026
Authors
Run BiOS engineering
Topic
Serving systems, caching
Companion
The BiOS training engine

01Agentic work has a different shape

A chat request is mostly new. An agent request is mostly old, and that difference decides where the cost goes.

An agent reading a codebase sends the same codebase on every step. A support workflow carries the same long standing instructions into every conversation. A document assistant re-reads the same document for the fortieth question about it. In each case the expensive part of the work was already done, often minutes ago, and a stack that treats every request as novel pays for it again.

In agentic work the interesting question is not how fast you can compute an answer. It is how much of it you should not be computing at all.

02Serving as a cache problem

Once you accept that framing, throughput becomes a memory-management question more than an arithmetic one[2], and attention performance is dominated by data movement rather than by the maths[3].

That is why kernels and cache tiers are first-class concerns in the design rather than optimisations bolted on later. Kernels sit behind one portable interface with a registry, so the engine can select the fastest implementation for whatever hardware it finds. Caching is layered, because the repetition happens at several different granularities at once.

Prefix cache

A shared prompt is computed once and reused by every request that begins the same way.

Context store

Content-addressed handles, so a client references a large document by id instead of re-uploading it.

Vision embeddings

A repeated image or video skips the vision encoder entirely on the second and later requests.

Frame decode

Video frames are decoded once, not on every request that mentions the same clip.

Figure 1Four tiers. Each removes work that has already been done once, at a different granularity: tokens, whole documents, encoded images, decoded video frames.

A property follows that inverts the usual relationship between scale and bill: cost per unit of work falls as reuse rises. The more an agent revisits the same material, the cheaper each visit becomes. For a workload built on a large shared context, that is the difference between a pilot and a system somebody can afford to run.

Request lifecycle and cache ownership are modelled as an explicit state machine, with the safety of reuse checked when the engine is compiled rather than hoped for at runtime. Caching bugs are the worst class of bug in a serving system precisely because they produce plausible output, so this is the right place to spend a type system.

03Why exactness matters

Every tier above is exact. A cached path and an uncached path produce the same output.

This sounds like a technical footnote and is actually the whole reason the caching is useful. Approximate caching forces a quality decision onto whoever configures the system, and a quality decision that saves money is one nobody can evaluate honestly under deadline. Exactness removes the decision: caching becomes a pure cost reduction, so it can be on by default rather than being a setting somebody has to justify in a review.

A cache that changes the answer is not a cache. It is a quality setting wearing a cost setting's clothes.

04One image, any generation

A single image runs across accelerator generations and selects the fastest kernel for whatever it finds at startup.

For a hosted service this is a convenience. For an on-premise customer it is a requirement, and it is the constraint most serving stacks quietly fail. An enterprise fleet is not uniform: it accumulated over several purchasing cycles, it contains more than one generation, and none of it is going to be replaced to suit a vendor's build matrix.

A stack that needs a different build per generation turns every hardware refresh into a software project, and turns any heterogeneity into a reason not to deploy. Detecting the hardware and choosing the right implementation is the difference between a product that can be installed where the customer actually lives and one that can only be installed where the vendor wishes they did.

05Why it pairs with training

Serving is where the traces come from, which makes it the first stage of the learning loop rather than the last stage of the pipeline.

Every answer this engine serves, and every human judgement attached to it, is the material the training engine consumes to produce the next version of the model. A model trained in one system and served by another has no path from a live answer back to itself. Owning both ends is what closes that path.

It also changes the economics in a direction the market is moving anyway. The price of general capability has fallen sharply while enterprise bills have risen[4], and spending on the model and platform layer is growing at more than sixty per cent a year[5]. That spend is going into volume rather than into advantage. A right-sized model, served on hardware the organisation already pays for, with the repeated parts of every request cached exactly, is a different cost structure, and it is only available to a vendor that controls both layers and the path between them.

RReferences

  1. [1]PyTorch The foundation BiOS Inference is built on.
  2. [2]Kwon et al., Efficient Memory Management for Large Language Model Serving with PagedAttention, 2023 Frames serving throughput as a cache-management problem, which is the premise the tiers below build on.
  3. [3]Dao et al., FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness, 2022 The argument that attention performance is a memory-movement problem, which is why kernels are a first-class concern rather than an optimisation.
  4. [4]AI.cc, 2026 AI API Infrastructure Report Blended price per million tokens fell from $18.40 to $6.07 in a year while average enterprise AI budgets rose from $1.2m to $7m.
  5. [5]Gartner, AI platforms and models market forecast, July 2026 The platform and model layer at $64.25bn in 2026, growing 63.4%.
Continue reading