Contextual Agentic

Lab

Open-weight economics

Size the cluster, see where the money actually goes, and find the volume at which self-hosting an open-weight model stops losing money against a hosted API.

Runs in the browserAdvanced

20 minutes to size one workload; longer if you argue with the defaults, which you should·Chapter 15 — AI sovereignty and data residency; Chapter 20 — The enterprise model portfolio

What actually operates

These controls run for real. They are the point.

  • Memory sizing — Weights are parameters times bytes at the chosen quantisation. The KV cache is two caches across every layer, for every token, for every sequence in the batch. The device count is what it takes to hold both.
  • Decode throughput — Each decode step reads the whole weight matrix once, plus the KV for every sequence. Tokens per second is bandwidth divided by that, which is why batching changes the economics and why bandwidth matters more than FLOPS.
  • Prefill throughput — Roughly two floating-point operations per parameter per token, against the accelerator's dense tensor throughput and a stated utilisation factor.
  • Capacity economics — Cost is capacity divided by what you serve, not a price per token. Idle time is billed and is shown separately.
  • The barriers — Staffing, re-evaluation, environments, patching and licence review are priced as line items and included in every per-token figure.

What is simulated

Stand-ins. Nothing here touches a real system.

  • The accelerators and prices — Round profiles that stand in for real hardware. Vendor specifications and prices change; substitute your own before any figure here reaches a decision.
  • The model shapes — Typical published dense decoder shapes at three sizes. No specific model is named, recommended or benchmarked.
  • The serving stack — Continuous batching, paged attention, speculative decoding and tensor-parallel overheads are not modelled. A real stack will beat the simple figures in places and miss them in others.
  • The timings in the journey — The animation's pacing is readable, not real. The numbers beside it are computed; the seconds you watch are not.
Boundaries
  • Nothing here is a quote, a benchmark, a recommendation or procurement advice.
  • No model, vendor or accelerator is endorsed, and none is named.
  • Several open-weight licences are not open-source licences. Read the acceptable-use and redistribution terms before you plan on them.

One token, all the way down

Follow a single request from the application through the deterministic shell, into device memory, across the weights and back. Every dimension in the scene is a number from the model below it: change an input and the picture changes shape.

The interactive journey is not here yet

The animated walk from the application through device memory and across the weights is still being built. Everything it will show is already on this page as tables: what has to fit in memory, how fast each phase runs, what the capacity costs, and what the deterministic shell adds beside it.

What has to fit, what it costs, and what it is not

These tables are the same arithmetic the scene draws, at the defaults. They are here so the page still works without JavaScript, and so the figures can be checked.

Accelerator profiles. Round, illustrative figures — substitute the specification and price you actually hold.
ProfileMemory BandwidthDense fp16Per hour
Top-tier datacentre GPU80 GB 3.3 TB/s750 TFLOPS $3.50
Previous-generation datacentre GPU80 GB 2.0 TB/s310 TFLOPS $1.80
Mid-range inference GPU48 GB 0.9 TB/s180 TFLOPS $0.85
Model shapes. Grouped-query attention is what keeps the KV cache affordable at long context.
ModelParametersLayers KV headsHead dim
Small open-weight (~8B)8B32 8128
Mid open-weight (~70B)70B80 8128
Large open-weight (~405B)405B126 16128

What a per-token price already includes, and self-hosting does not

This is where open-weight business cases are usually decided, and it is the part a token calculator never shows.

CostQuantity Each, monthlyWhy it exists
Platform and MLOps engineering1.5 FTE $14,000Serving stack, autoscaling, upgrades, capacity planning.
On-call and incident cover0.5 FTE $14,000An endpoint you own is an endpoint you carry at 3am.
Re-evaluation per model version2 runs/month $3,200Every weight change, quantisation change and serving-stack upgrade re-opens the suite.
Non-production environments2 environments $2,600You cannot test a serving change in production.
Patching and supply-chain review0.2 FTE $14,000Serving runtimes, CUDA stacks and model provenance.
Licence and compliance review1 one-off amortised $900Several open-weight licences are not open-source licences. Acceptable-use terms and redistribution limits need reading.

The deterministic shell, priced beside the model it guards

Every control that makes an agent safe to run is ordinary code on ordinary CPU. The forward pass is the expensive part, and it is the part that is not deterministic.

StepTypicalDeterminism
Admission and identity120 µs Deterministic — same inputs, same result, replayable
Context Contract assembly2400 µs Deterministic — same inputs, same result, replayable
Policy and authority check300 µs Deterministic — same inputs, same result, replayable
Typed capability call850 µs Deterministic — same inputs, same result, replayable
Evidence record write1600 µs Deterministic — same inputs, same result, replayable
Forward pass through the weightssee the model Probabilistic — sampled, and not reproducible without the seed and the same stack
An illustrative model, not a quote

Every figure here is an estimate produced from the numbers you enter, with defaults last reviewed on 2026-09-26. They are not pricing, financial, legal or procurement advice, and no product or vendor is endorsed or recommended. Model prices, service names and platform capabilities change constantly — use your own contract pricing before deciding anything.

Everything runs in your browser: nothing you type is sent anywhere, stored, or seen by anyone, and reloading the page discards it. The full terms for these tools.

Most comparisons between hosted and self-hosted models argue about the price of a token. That is the wrong unit. When you host the weights yourself you do not buy tokens — you buy capacity, by the hour, and you pay for it whether or not anything is using it.

So this lab answers three questions in order, because the third one has no meaning until the first two are settled.

What has to fit? Weights are parameters times bytes per parameter, which quantisation changes. The KV cache is two caches across every layer, for every token of context, for every sequence in the batch — and it grows while the request is being served. If the two together exceed the device, you are buying another one.

How fast does it run? Prefill is compute-bound: reading a 9,000-token prompt is arithmetic, and it scales with tensor throughput. Decode is memory-bandwidth-bound: every single output token requires reading the entire weight matrix out of device memory again. That is why batching matters so much — the batch shares that one read — and why the interesting specification is bandwidth, not FLOPS.

What does it cost? Capacity divided by what you actually serve. At the defaults on this page that works out at around one-sixth utilisation, which means five-sixths of the bill buys nothing. The break-even figure the calculator reports is not a per-token comparison; it is the daily volume below which a hosted API is simply cheaper, and it is usually a multiple of what a pilot runs.

The part that carries the architecture

The journey above is split into two halves, and they cost very different amounts.

The deterministic shell — identity, the Context Contract, the policy and authority check, the typed capability call, the evidence write — is ordinary code on ordinary CPU. It runs in microseconds and costs a rounding error. It is reproducible: the same inputs give the same result, and a decision made three months ago can be replayed.

The forward pass is neither. It is the expensive part of the journey by several orders of magnitude, and it is the part that is sampled rather than computed. The scene draws that gap to scale because the gap is the argument: the controls that make an agent safe to run in an enterprise are close to free beside the model call they guard. Nobody is choosing between governance and cost.

That is also why the answer to “can we make this cost-effective?” is rarely “use a cheaper model”. It is: raise utilisation, batch harder, cut the prompt, cache what repeats, and move every decision you can out of the probabilistic half and into the deterministic one — where it is faster, cheaper, testable and provable.