A visual overview for researchers · About 30 minutes

Local AIFrom Model Weights
to Useful Agents

Start with a chat. Understand the model, make it run locally, and give it tools for work you can review.

Read the guide

Using AI Agents for Research · 20-minute group meeting

Part 1 · Follow one request1 / 36

What happens after Send?

Send passes the question and its chat history to the model.

What happens after Send? A detailed desktop chat interface shows composing and submitting a research question about social attraction versus a shared food patch. The final pieces food, patch and ? remain visible as the prompt enters tokenization. Two animals feed together. Is one following the other?Send passes the question and its chat history to the model.
  1. 1Two animals share a food patch. Is one following the other?
  2. 2Send the question and its chat history.

You ask: “How can I distinguish social attraction from animals responding to the same food patch?” The chat application submits the message with its roles and surrounding context. We follow three pieces at the end of the question—food, patch and ?—into the model.

Technical notes, examples & sources

The full request includes role markers, instructions and the prompt. The next scenes use a small numerical decoder to make each operation visible. It illustrates mechanisms shared by the models in this talk.

Primary sources · checked 2026-11-18

Part 1 · Follow one request2 / 36

From words to vectors

Colors show positive and negative values.

From words to vectors The final pieces food, patch and ? leave the chat, select embedding rows and become token vectors. A single five-cell value key shows negative, zero and positive numbers, with equal magnitudes equally strong. Matrices remain color-only, and zero is visually neutral. Split the text into vocabulary pieces.Each piece selects a learned vector.Signed values become the model’s input.
  1. 1Split text into tokens.
  2. 2Look up a vector for each token.
  3. 3Input matrix · one row per token

The submitted words remain in the chat window. The tokenizer turns the formatted text into vocabulary pieces. Each token selects a learned vector from an embedding table. An ordered matrix of numerical vectors enters the transformer.

Technical notes, examples & sources

Three selected prompt pieces and four illustrative features keep the diagram small. Real tokenizers may split words differently and include special tokens. A single value key shows −0.80, −0.20, 0.00, +0.20 and +0.80. Coral encodes negative values, the component hue encodes positive values, and zero is neutral. Strength increases with magnitude on a shared −1 to +1 display range; values outside that range saturate. Hovering a matrix cell reveals its illustrative value. The complete question remains part of the request. Position information is supplied but its internals are omitted.

Primary sources · checked 2026-11-18

Part 1 · Follow one request3 / 36

Which earlier words matter?

Values V supply the information; the mixture updates the token representation.

Which earlier words matter? One token-representation matrix H branches into three explicit learned matrix multiplications. Labeled equations Q = H W_Q, K = H W_K and V = H W_V connect the shared input to the computed query, key and value matrices. Q and K feed a masked attention map; its final row mixes V to produce an updated feature vector. H, projection weights and computed vectors remain visible throughout. Q, K and V are three projections of the same input H.Q and K determine how strongly tokens attend.Use those attention weights to mix values V.Each token now carries information from its context.
  1. 1Project each token into a query, key and value.
  2. 2Compare each query with current and earlier keys.
  3. 3Mix the values using attention weights.
  4. 4Update each token’s features.

At this layer, H is the matrix of current token representations: one row per token. Multiplying the same H by three different learned weight matrices produces Q = H W_Q, K = H W_K and V = H W_V. A query is compared with the available keys; masking and softmax turn those scores into attention weights. Those weights mix the value vectors into a context-dependent update.

Technical notes, examples & sources

Q, K and V are computed projections of the same H at this layer, not separate inputs and not copies of the learned weights. W_Q, W_K and W_V are model parameters that stay fixed during inference. Each row of H uses the same projection matrix, so each token produces its own query, key and value. The illustrative calculation is softmax(mask(QKᵀ / sqrt(4)))V. Matrix products use the existing full-precision numerical trace; cell colors show the computed values. Each allowed attention row sums to one and future-token weights are zero. The highlighted final row mixes values for the final shown prompt position. This is one head; real models combine heads and project the output, and positional transformations are omitted here.

Primary sources · checked 2026-11-18

Part 1 · Follow one request4 / 36

How a layer transforms token features

These learned matrices are also model weights.

How a layer transforms token features A single horizontal centerline connects token features, the expansion weight matrix W_up, the activated features, the projection weight matrix W_down, and updated H. Both learned matrices have explicit dimensions and aligned headings; a residual path returns below. The matrix values and mathematical operations are unchanged. Attention mixed positions; now transform the features.Expand, activate, project—using learned weights.
  1. 1Attention mixes information across positions.
  2. 2Expand, activate and project each token’s features.

Attention’s output projection and residual addition update the token features. A learned matrix expands each position into a longer feature vector. A nonlinear activation transforms those expanded features. A second learned matrix restores the width; a residual addition gives the layer output.

Technical notes, examples & sources

This is a conventional two-matrix ReLU feed-forward network, applied independently with the same weights at every position. The trace computes attention output projection, residual addition, expansion, ReLU, projection and another residual addition. Normalization and positional internals are omitted. This is an explanatory vanilla design, not a Qwen implementation.

Primary sources · checked 2026-11-18

Part 1 · Follow one request5 / 36

Model weights and the conversation cache

Every chat uses the same learned weights. Each conversation builds its own cache of keys and values.

The next token can use what the model already computed for earlier tokens.

Model weights and the conversation cache The learned matrices stay inside the decoder layer as its computed keys and values move into the conversation cache. The layer and cache repeat down a stack. The final frame pairs billions of fixed model parameters with a growing per-conversation KV cache, illustrated at 16 GiB for 8,192 tokens across 32 full-attention layers at FP32. One decoder layer computes attention and transforms token features.Model weights stay fixed. Saved keys and values belong to this chat.Billions of parameters · example KV cache of 16 GiB at 8,192 tokens
  1. 1One decoder layer · attention and a feed-forward network
  2. 2Model weights · billions of learned parameters shared across chats
  3. 3KV cache · keys and values saved by each attention layer
  4. 4Example cache · 16 GiB for 8,192 tokens across 32 layers at FP32

Each decoder layer applies learned weights to the incoming token representations. The model has billions of these parameters, shared across conversations and fixed during inference. Attention also produces a key and a value for each token. During decoding, each layer reuses the keys and values it has saved for this conversation and appends the new token’s pair. In the illustrated model, 8,192 cached tokens occupy 16 GiB across all 32 layers at FP32 precision.

Technical notes, examples & sources

The cache size here is a worked example. Across 32 full-attention layers, each token stores a key and a value with 64 KV heads and 128 values per head. With four bytes per value, this is 2 MiB per token, or 16 GiB for 8,192 tokens. Other architectures, cache precisions and context lengths give different sizes. The later memory-budget slide uses this same hypothetical dense model. It has hidden width 8192, feed-forward width 32768 and separate input and output embeddings. The small matrices in the animation illustrate how values move.

Primary sources · checked 2026-11-18

Part 1 · Follow one request6 / 36

Predicting the next token

The new text goes through the same process again.

Predicting the next token The final representation and output weights produce probability bars. A subtle sampled marker identifies the selected token. Compare moves into the chat and remains in place while the separate token observed joins it. The original question uses the same native text layout as the opening. Scores become a distribution over the vocabulary.Sample a token and append it.Feed that token back in to predict the next.
  1. 1Turn vocabulary scores into probabilities.
  2. 2Sample and append one token.
  3. 3Use that token to predict the next.

The final position is projected to one score for each vocabulary entry. The scores become a probability distribution over the next token. A decoding rule selects a token; it returns to the growing chat reply. The selected token becomes the next input, and the model predicts again.

Technical notes, examples & sources

An eight-entry illustrative vocabulary uses probabilities computed from the small numerical trace. The reply begins “Compare observed…”. The selected continuation is illustrative sampling, not scientific advice or measured output from a trained model. Real vocabularies and the full prompt are much larger.

Primary sources · checked 2026-11-18

Part 1 · Follow one request7 / 36

How much space do model weights take?

GPT-1 fits in a fraction of a gigabyte. At the same precision, the largest models need terabytes.

Where do the models you can run locally sit on this scale?

How much space do model weights take? Release month against estimated 16-bit weight storage on a logarithmic scale. The chart highlights three reference models: Qwen3.8-27B at 54 GB, Muse Glimmer at 59.2 GB, and Qwen3.8-Flash-Next at 360 GB. The reading notes cover recent GPT and Claude models. GPT-1 · 234 MB → GPT-2 · 3 GB → GPT-3 · 350 GBLlama 3.1 405B · 810 GB. DeepSeek-V4-Pro · 3,200 GB.Qwen3.8-27B · 54 GB. Muse Glimmer 30B · 59.2 GB. Qwen3.8-Flash-Next · 360 GB.
  1. 1GPT-1 · 234 MB → GPT-2 · 3 GB → GPT-3 · 350 GB
  2. 2Llama 3.1 405B · 810 GB. DeepSeek-V4-Pro · 3,200 GB.
  3. 3Qwen3.8-27B · 54 GB. Muse Glimmer 30B · 59.2 GB. Qwen3.8-Flash-Next · 360 GB.

Each horizontal line is ten times the weight storage of the line below it. GPT-3 would take 350 GB at two bytes per parameter. The three highlighted reference models came out in August 2026. Qwen3.8-27B and Muse Glimmer cluster near 60 GB. Qwen3.8-Flash-Next reaches about 360 GB with its additional embedding table and prediction module.

Technical notes, examples & sources

The comparison multiplies published parameter counts by two bytes. GB means a billion bytes. The reference uses release months, reported counts, and hypothetical 16-bit storage. Actual downloads vary with precision, packaging, and optional components. Qwen3.8-27B uses the published language-model count. Muse Glimmer’s 29.6B includes its vision encoder. Flash-Next totals about 180B across the 125B main model, 51B n-gram embeddings, and 4B multi-token prediction module. The 125B main model activates about 6B parameters per token. OpenAI and Anthropic do not publish parameter counts for the frontier models in the reading table. Public analyses of GPT-5.6 Sol put it near 1.9T using recall probes and near 3.1T using a model of benchmarks, pricing, and other public signals. The 1.9T figure has a reported 90% interval of 0.56T–6.7T. Both are estimates of equivalent capacity with no verified weight count. The original GPT-5 launch also described a system routing requests across multiple models.

How much space do model weights take?
ReleaseModelParametersWeights at 16 bits
2018-06GPT-1117M0.234 GB
2019-02GPT-21.5B3 GB
2020-05GPT-3175B350 GB
2024-07Llama 3.1 405B405B810 GB
2026-04DeepSeek-V4-Pro1.6T3,200 GB
2026-07GPT-5.6 Sol1.93T equivalent (estimate)3.86 TB equivalent (90% interval 1.118–13.4 TB)
2026-08Qwen3.8-27B27B54 GB
2026-08Muse Glimmer 30B29.6B59.2 GB
2026-08Qwen3.8-Flash-Next180B360 GB
2026-09Claude Opus 5.5Unpublished—
2026-09GPT-6 SolUnpublished—
2026-11Claude Fable 5.2Unpublished—

Primary sources · checked 2026-11-18

Part 1 · Follow one request8 / 36

Choosing a local model

Four options for coding, visual assistance and tool use across different memory budgets.

Benchmark the model and precision you can actually run.

Choosing a local model Four model profiles show parameter counts, strengths, and typical tasks. Dense Qwen covers coding and analysis. Muse Glimmer has a small cache and is suited to everyday search, email and visual reasoning. Inkling 2 Mini reuses layer weights while retaining a separate cache for each pass. Its reveal compares estimated Q8_0 KV memory for a 64K session across Muse, Inkling and Qwen3.8-27B. Flash-Next uses a sparse backbone for larger coding tasks.
  1. 1Qwen3.8-27B is the coding and analysis option.
  2. 2Muse Glimmer · fast assistant for search, email, and visual reasoning · small KV cache
  3. 364K session with Q8_0 KV · Muse 0.47 GiB · Inkling 2 Mini 1.15 GiB · Qwen 27B 2.125 GiB
  4. 4Flash-Next activates a subset of its expert weights for each token.

Alibaba’s Qwen3.8-27B is my dense model for coding and analysis. Meta’s Muse Glimmer is my pick for a fast everyday assistant with a small KV cache and good visual reasoning. It can search, draft emails, and send them through connected tools with permission. Thinking Machines Lab’s Inkling 2 Mini is an option for coding, vision and tool use. Its middle layers reuse weights over three passes. For one 64K agent session with Q8_0 keys and values, Inkling’s estimated cache is 1.15 GiB, between Muse at 0.47 GiB and Qwen3.8-27B at 2.125 GiB. These figures assume the runtime keeps sliding windows compact. Alibaba’s Qwen3.8-Flash-Next is the larger mixture-of-experts option for demanding coding tasks.

Technical notes, examples & sources

Search and sending email require a harness with the relevant tools and permissions. Muse accepts image inputs. Its windowed layers and grouped-query attention help keep the KV cache small. Actual speed depends on the runtime, quantization, and hardware. The use cases reflect the presenter’s workflow, not universal performance rankings. Qwen3.8-27B combines recurrent state and full attention. Muse Glimmer combines windowed and full attention; it can also code and reason, and is not limited to assistant work. Flash-Next uses selected feed-forward experts per token. Its 125B main model excludes the 51B n-gram embedding component and approximately 4B MTP module reported by the model card; deployment memory must include the components actually loaded. Sparse activation reduces work per token, not total stored weights. Inkling has 26.4B total parameters. The model card distinguishes 3.4B active parameters from 5.4B effective active per token when repeated passes are counted. Each loop pass keeps separate state. For a single text session, eight full-attention and forty sliding-window layer visits each store eight KV heads of width 128. At two bytes each for K and V, that is 4 KiB per token per layer visit. With 1,024-token windows the KV estimate is 4 KiB × [8 × tokens + 40 × min(tokens, 1,024)]. At 65,536 tokens the FP16 KV payload is 2.15625 GiB. In llama.cpp, a Q8_0 block holds 32 values and an FP16 scale in 34 bytes. Quantizing both keys and values retains 34/64 of the FP16 payload. At 131,072 tokens the estimates are 4.16 GiB for FP16 or 2.21 GiB for Q8_0. The table compares one text sequence with compact windows for Inkling and Muse. It excludes weights, convolution and recurrent state, and runtime buffers. Qwen also uses about 144 MiB for FP32 recurrent matrices in the example. Measure peak memory and prefill speed on the chosen build; quantized KV can change which attention kernel Inkling uses.

Choosing a local model
ModelFP16 KV at 64KQ8_0 KV at 64K
Muse Glimmer0.89 GiB0.47 GiB
Inkling 2 Mini2.16 GiB1.15 GiB
Qwen3.8-27B4.00 GiB2.125 GiB

Primary sources · checked 2026-11-21

Part 1 · Follow one request9 / 36

One reply has two phases

Prompt tokens can be processed together. New tokens are generated in sequence.

One reply has two phases A position-by-position schedule follows one reply. Prefill processes the known prompt and predicts the first token. Each decode pass reads cached positions, processes one new position and predicts the next token. Prompt tokens can be processed together. New tokens are generated in sequence.
  1. 1Prefill · process the prompt and predict the first token
  2. 2Decode · reuse cached history for each new token

A request begins with known input tokens. Prefill processes those positions in batches and builds their retained keys and values. Decode then repeats a sequential step: use the retained history, predict a token, append it, and process that new position.

Technical notes, examples & sources

The two phases use the same learned model weights. Prompt positions can be processed together under the causal mask; the generated continuation is sequential because each new token depends on the previous output. Prompt caching can reuse an existing prefix, so not every repeated request recomputes its entire prompt. The next two scenes show the cache operations separately.

Primary sources · checked 2026-11-16

Part 1 · Follow one request10 / 36

Prefill: process the prompt

The input is known, so many prompt positions can be processed together.

Prefill: process the prompt Selected prompt positions pass through learned projections. Their K/V vectors enter the cache as colored cells. The first reply token Compare is predicted but has no cache row until it is processed. Process the initial prompt in parallel batches.Compute each prompt position’s K and V from the learned weights.Retain K and V as each layer processes those positions.
  1. 1Process the known prompt in batches.
  2. 2Compute a key and value at each position.
  3. 3Save the keys and values for decoding.

All prompt positions are known before generation starts. Prefill processes their vectors through each layer. Each attention layer retains its computed keys and values. The final prompt position predicts “Compare”; that new token has no K/V entry yet.

Technical notes, examples & sources

This example starts without a reused prefix. Known prompt positions permit parallel work within a layer; layers still execute in sequence. The retained K/V rows show the same color patterns as the earlier computed representations. Every attention layer has its own K/V. Compare is predicted only after processing the prompt; its K/V appears when that generated token is processed next.

Primary sources · checked 2026-11-18

Part 1 · Follow one request11 / 36

Decode: stream the response

Generate one token, append it, then process that new position.

Decode: stream the response Earlier K/V rows stay at exactly the same positions with unchanged values. One new input vector produces one new pair of rows, which enters the cache from the projection area. Start with the prompt’s cached keys and values.Process the new token and reuse the previous K/V.Append the new position’s K/V, then predict the next token.
  1. 1Start with the prompt’s cached keys and values.
  2. 2Reuse the cache for the new position.
  3. 3Append its key and value, then predict the next token.

The prompt’s K/V rows are already available in memory. Only the new token goes through the layers; attention reads the retained history. The new token’s K/V are appended, leaving the earlier rows unchanged. Its output predicts the next token. This repeats as the reply grows.

Technical notes, examples & sources

Causal masking makes earlier representations independent of future tokens, so their keys and values can be reused instead of recomputed. The current query still reads previous keys and values; caching does not remove attention to history. The cache contains processed input and generated positions, not newly learned weights or a textual summary. The four-position trace leaves the first three K/V rows exactly unchanged.

Primary sources · checked 2026-11-18

Part 1 · Follow one request12 / 36

Memory for weights and conversation

The model occupies memory as soon as it loads. The chat adds its own history.

Memory for weights and conversation A fixed violet weight allocation sits beside a teal cache allocation that grows on the same scale. Exact combined retained payloads lead to the question of running these computations locally. Our example dense model has 26.84B weights. At four bytes each, that is 100 GiB.At 8K tokens, the chat adds 16 GiB of keys and values.At 128K tokens, this example needs 356 GiB on a workstation or MacBook.
  1. 1Our example dense model has 26.84B weights. At four bytes each, that is 100 GiB.
  2. 2At 8K tokens, the chat adds 16 GiB of keys and values.
  3. 3At 128K tokens, this example needs 356 GiB on a workstation or MacBook.

The hypothetical model’s fixed FP32 weights occupy exactly 100 GiB. At 8K tokens, 16 GiB of K/V brings retained payload to 116 GiB. At 128K, 256 GiB of K/V brings it to 356 GiB, before workspace and overhead. How does this fit on a workstation or MacBook?

Technical notes, examples & sources

All terms use the same hypothetical architecture and FP32 baseline: weights = 26,843,545,600 × 4 bytes = 100 GiB, cache = 16 GiB at 8K or 256 GiB at 128K. Totals = 116 and 356 GiB before temporary workspace, runtime overhead and other applications. 100 GiB is 107.374 decimal GB; the rounded 27B estimate is about 108 GB. This is an explanatory budget, not a real model fit recommendation or a benchmark.

Primary sources · checked 2026-11-18

Part 2 · Make the model fit13 / 36

A 32 GiB memory budget

The example model needs 100 GiB for its weights before the first token is cached.

A 32 GiB memory budget The original FP32 allocations shrink into a detailed compute and memory panel beside a reconstructed native chat window. The chat and computation stay in place while the deployment boundary changes from a remote service to a shared local computer. Request and response connectors remain short and horizontal. A ruler compares the example’s 100 GiB of weights and 256 GiB of cache with a fixed 32 GiB allowance. The example uses 100 GiB for weights and 256 GiB for its cache at 128K tokens.Suppose 32 GiB is available locally. The weights alone take 100 GiB.
  1. 1Example at 128K · 100 GiB weights + 256 GiB cache
  2. 2Available locally · 32 GiB

The model we just traced uses 100 GiB for its full-precision weights and 256 GiB for 128K tokens of conversation history. Suppose your machine has 32 GiB available after reserving memory for the system and working buffers. Which parts of that 356 GiB budget can we shrink?

Technical notes, examples & sources

The first beat deliberately retains the preceding example’s 100 GiB of FP32 weights and 256 GiB of FP32 K/V at 128K tokens. Moving that workload onto a local computer does not make it fit; the following scenes reduce its requirements. The computer and service are generic, not a personal setup. A local model need not consume a hosted inference quota, but its throughput is bounded by hardware. Local inference alone does not keep all application data local: cloud models, web searches, telemetry and tool integrations can make external requests. Ollama documents a local-only mode. The 32 GiB line is an illustrative allowance after reserving other memory, rather than the installed capacity of a particular device.

A 32 GiB memory budget
CriterionLocalFrontier cloud
CapabilityModel and hardware dependentMay excel on difficult tasks
ConvenienceYou manage the runtimeManaged service and integrations
PrivacyInspect the entire tool chainInspect product and contract
CostHardware, energy, maintenancePlan or API charges
AvailabilityInstalled resources; local failuresNetwork, quotas, service availability
LatencyPlacement and workload dependentNetwork and service dependent
ContextArchitecture and memory limitsModel and product limits

Primary sources · checked 2026-11-18

Part 2 · Make the model fit14 / 36

Rounding the weights

Fewer bits shrink the model file. The chat still needs its cache.

Rounding the weights Original, stored and rounding-error matrices accompany five dots that snap to representable values. FP32 and FP16 levels form an unresolved band; 8, 4 and 2 bits show 256, 16 and 4 uniform levels. The weight allocation shrinks while the cache stays fixed. Start with the same weights. Each number occupies four bytes.FP16 halves weight storage to 50 GiB. The dots barely move.At 8 bits, each example weight rounds to one of 256 levels.At 4 bits, the weights take 12.5 GiB. The cache still takes 256 GiB.Two bits give each weight four possible levels.
  1. 1FP32 · four bytes per weight
  2. 2FP16 · 50 GiB of weights
  3. 38 bits · 256 possible levels
  4. 44 bits · 12.5 GiB of weights
  5. 52 bits · four possible levels

The same weight matrix is represented at FP32, FP16, 8, 4 and 2 bits. Original and stored values share a color scale. The error panel uses one fixed ±0.333 scale across every precision, with the maximum absolute error printed alongside. Five values move to their nearest stored level. Follow the violet weight allocation against the 32 GiB line. Even at 2 bits the teal cache alone exceeds the allowance.

Technical notes, examples & sources

FP32 and FP16 use IEEE round-to-nearest, ties-to-even. Their representable levels are not uniformly spaced and are visually unresolved on the full −1 to +1 line. The 8/4/2-bit example uses a uniform 256/16/4-level quantizer over that range, not the codebooks of GGUF IQ types. The error view is stored minus original, with one fixed ±0.333 scale; FP32/FP16 differences are too small to see at that range, so the numerical maximum is also shown. Number-line labels are rounded for display. Weight payloads continue the hypothetical 26.84B-parameter model: 100, 50, 25, 12.5 and 6.25 GiB. Real files add block scales, metadata and mixed precision. The FP32 KV allocation is held fixed here to isolate weight storage.

Primary sources · checked 2026-11-18

Part 2 · Make the model fit15 / 36

Making room for longer context

Keep the tokens. Change what each layer stores, then how many bits each value needs.

How do other architectures keep their history small?

Making room for longer context Each column is 8K token positions. The first eight of 64 layers stand for the repeating layer pattern. History extends to the right. Six rows of full-history cache drop away when the architecture changes. Retained cells shrink in place at Q8 and Q4. Cell area encodes bytes, and the bar below compares estimated total memory with a 32 GiB budget. 8K · 64 full-history layers · FP16 · 2 GiB KV64K · 64 layers · FP16 · 16 GiB KV256K · 64 layers · FP16 · 64 GiB KV256K · 16 full-history layers · FP16 · 16 GiB KV256K · 16 layers · Q8 · 8.5 GiB KV · 29.4 GiB total256K · 16 layers · Q4 · 4.5 GiB KV · check recall of exact details
  1. 18K · 64 full-history layers · FP16 · 2 GiB KV
  2. 264K · 64 layers · FP16 · 16 GiB KV
  3. 3256K · 64 layers · FP16 · 64 GiB KV
  4. 4256K · 16 full-history layers · FP16 · 16 GiB KV
  5. 5256K · 16 layers · Q8 · 8.5 GiB KV · 29.4 GiB total
  6. 6256K · 16 layers · Q4 · 4.5 GiB KV · check recall of exact details

An 8K chat can turn into a much longer coding task as the harness adds files, tool results and edits. Try 64K as a starting point. A task that genuinely needs more history may benefit from 128K–256K. Qwen3.8-27B supports 256K natively. At that length its 16 full-attention layers need 16 GiB for FP16 keys and values, or 8.5 GiB at Q8. Q4 reduces the cache to 4.5 GiB, with a greater risk of losing fine distinctions in long histories.

Technical notes, examples & sources

One request, four KV heads, 256 values per head, separate keys and values. Start with a hypothetical 64-layer full-attention stack, then compare Qwen3.8-27B with the same head dimensions and 16 full-attention layers. Its other 48 layers keep fixed recurrent state (144 MiB of FP32 matrices here). Layer layout is chosen during model design. Cache precision is a serving setting. Q8_0 stores 34 bytes per 32 values and Q4_0 stores 18, including block scales. The area of each tile is proportional to those bytes. Each column aggregates 8,192 positions. The 32 GiB example assumes one 18 GB Q4_K_M file (16.8 GiB), plus 4 GiB for the OS, runtime, buffers and small allocations. Actual peak usage depends on runtime, batch and device. Check it on your workload. Q4 quality loss varies with model and task; check exact identifiers or values retrieved from earlier tool output.

Making room for longer context
HistoryFull KV layersFormatKV cacheEstimated total
8K64FP162 GiB22.8 GiB
64K64FP1616 GiB36.8 GiB
256K64FP1664 GiB84.8 GiB
256K16FP1616 GiB36.9 GiB
256K16Q88.5 GiB29.4 GiB
256K16Q44.5 GiB25.4 GiB

Primary sources · checked 2026-11-18

Part 2 · Make the model fit16 / 36

Three ways to keep less history

Qwen updates a compact state in most layers, with full history in every fourth layer.

Three ways to keep less history Eight query vectors first use eight retained K/V heads, then share two. The same head histories preserve their colored values as the others fade. Next, exact stacks of 52 Muse layers or 64 Qwen layers show their repeated three-to-one patterns beside bounded window or recurrent state and full-history storage. Start with separate K/V histories for each attention head.Grouped-query attention shares K/V across query heads.Muse: short windows in most layers; full history in every fourth.Qwen: recurrent state in most layers; full history in every fourth.
  1. 1Start with separate K/V histories for each attention head.
  2. 2Grouped-query attention shares K/V across query heads.
  3. 3Muse: short windows in most layers; full history in every fourth.
  4. 4Qwen: recurrent state in most layers; full history in every fourth.

Grouped-query attention shares K/V heads across several query heads. Some architectures also avoid retaining a full token history in every layer. Muse Glimmer combines 39 sliding-window layers with 13 full-attention layers. Qwen3.8-27B combines 48 recurrent Gated DeltaNet layers with 16 full-attention layers. Their full-attention portions still grow with context.

Technical notes, examples & sources

The first two beats compare eight query heads with either eight or two K/V heads at fixed head dimension and token count: the latter has one quarter of the ideal K/V payload. Qwen3.8-27B has 24 query and four K/V heads in its full-attention layers; its 64-layer pattern is three recurrent layers followed by one full-attention layer. Muse Glimmer has 32 query and two K/V heads and a 52-layer pattern of three 2,048-token sliding-window layers followed by one full-attention layer. At 64K positions, the drawn Muse window covers 1/32 of the timeline. Bounded retention depends on the runtime; some backends can allocate full-size window caches. Recurrent state changes with input and is not a stored transcript. Plots show qualitative growth, not measured bytes or a quality ranking. Architecture is a model-design choice, not a runtime toggle. The recurrent state values are a generic illustrative state update, not a numerical implementation of Gated DeltaNet. Query and K/V examples are schematic head values; layer counts and group ratios are exact. These architectures are trained to use their local/global or recurrent/full-attention pattern; this is not a switch that discards history from an already-trained conventional model. Strong model-level results do not prove that every task is unaffected. Muse uses dense feed-forward layers: its small cache is a separate design choice from MoE expert routing.

Primary sources · checked 2026-11-18

Part 2 · Make the model fit17 / 36

Routing tokens to experts

A sparse model can store more weights and use fewer of them for each token.

Routing tokens to experts A dense token traverses two weight matrices. Across from it, a router sends the first token to experts E2 and E6, then sends the next token to E4 and E7. Each pair of paths rejoins at the output. Shared-scale bars compare 27B stored and active parameters for dense Qwen with a 125B backbone and 6B active per token for Flash-Next. In a dense layer, every token passes through the same feed-forward weights.The router sends this token through two experts and combines their outputs.The next token takes a different pair of paths through the same bank of weights.Flash-Next selects 10 of 512 routed experts per layer and also runs one shared expert.
  1. 1The dense Qwen model runs all 27B parameters for each token.
  2. 2The first token passes through E2 and E6. Their outputs rejoin.
  3. 3The next token passes through E4 and E7 in the same bank.
  4. 4Flash-Next activates 6B of its 125B backbone per token. Each layer uses 10 of 512 routed experts and one shared expert.

The dense Qwen3.8-27B activates 27B parameters per token. Flash-Next has a 125B backbone and activates 6B per token. At each mixture-of-experts (MoE) layer its router selects 10 of 512 experts, alongside one shared expert. The full set of weights still needs a home.

Technical notes, examples & sources

The routing sketch shows two of eight experts. Each tile uses the same scale across its feed-forward matrices. Each expert has a quarter as many tiles as the dense network. In the real Flash-Next model, the router selects 10 of 512 routed experts per layer, plus one shared expert. The bars below the sketch compare model-wide backbone parameter counts on one linear scale. The solid portion counts active parameters per token, including shared computation. Qwen reports an additional 51B n-gram embedding parameters and a 4B multi-token prediction module outside the 125B backbone. Throughput also depends on weight placement, bandwidth and the inference engine.

Primary sources · checked 2026-11-16

Part 2 · Make the model fit18 / 36

Choosing precision by tensor

Keep more precision where rounding would hurt most.

Choosing precision by tensor The Unsloth logo, Dynamic v3.1 and GGUF label sit above four real selected model layers. Attention and gated feed-forward tensor storage shrink in place to their actual mixed-format allocations, with unchanged parameter counts and visible 16-bit reference outlines. A layer contains several weight matrices.Unsloth assigns different formats to different tensors in the same layer.The pattern changes across layers. Sensitive tensors keep more precision.
  1. 1A layer contains several weight matrices.
  2. 2Unsloth assigns different formats to different tensors in the same layer.
  3. 3The pattern changes across layers. Sensitive tensors keep more precision.

Unsloth Dynamic v3.1 uses calibration to allocate precision across the weights. A nominal 2-bit GGUF can contain several formats. The animation uses actual formats from selected full-attention layers in Qwen3.8-27B UD-Q2_K_XL.

Technical notes, examples & sources

The metadata was read from the public GGUF header on 16 November 2026; no inference was performed. Layers 4, 8, 32 and 64 show Q, K, V, attention-output and gated feed-forward gate/up/down matrices. The intervening recurrent layers are omitted. Matrix cells are illustrative; storage height per weight uses the actual block format, including scale overhead, relative to a 16-bit reference. Columns are normalized per weight and do not represent each tensor’s total byte count. Tensor shapes and parameter counts stay unchanged. The allocation is fixed in the downloaded file, not adjusted during a chat. The file is 9,948,666,784 bytes; its nominal Q2 label does not mean every value occupies exactly two bits. GGUF is the model-file container, not a competing server.

Primary sources · checked 2026-11-18

Part 2 · Make the model fit19 / 36

Testing one- and two-bit models

Low-bit files can retain substantial capability—but the result depends on the model.

Testing one- and two-bit models An enlarged original Unsloth accuracy-versus-file-size plot is shown for each model, with its reported recovery, quantization name, total file size and benchmark basis. The source legend and links to the complete figures remain visible. Qwen3.8-27B: a roughly 10 GB file retains about 87% of its coding baseline.Flash-Next: the nominal 1-bit file retains 97.9% across 12 benchmarks.
  1. 1Qwen3.8-27B: a roughly 10 GB file retains about 87% of its coding baseline.
  2. 2Flash-Next: the nominal 1-bit file retains 97.9% across 12 benchmarks.

Unsloth reports about 87% average coding-score recovery for the 9.95 GB Qwen3.8-27B UD-Q2_K_XL file. For Flash-Next UD-IQ1_S, it reports 97.9% mean recovery across 12 benchmarks at roughly 66 GB total file size. These are different benchmark aggregates, not a model-to-model ranking.

Technical notes, examples & sources

Published plots are reproduced from Unsloth with links to the complete figures. The 27B panel uses the full-file-size version, including token embeddings: its coding aggregate covers LiveCodeBench v6, Terminal Bench 2.1 and DeepSWE v1.1. The approximately 87% callout is read from that plotted point. Flash-Next’s 97.9% is the labeled unweighted mean of per-benchmark recovery across 12 tasks. Recovery is accuracy relative to BF16, not the fraction of questions answered correctly or a throughput gain. The 1-bit Flash-Next name includes higher-precision components and is not a 16 GB model. These vendor results used long evaluation budgets (256K for agentic and 128K for other tasks); they do not guarantee the same score at a smaller configured context. Compare the complete task-specific results, including variability, before choosing a quant.

Primary sources · checked 2026-11-16

Part 2 · Make the model fit20 / 36

Where do the weights live?

Keeping the model in GPU memory avoids costly offloading.

Where do the weights live? Fine memory pages sit above detailed CPU core and GPU tile schematics. The allocation changes from a shared pool to separate RAM and VRAM. Eight of the sixteen illustrated weight pages move to RAM when GPU capacity is reserved; an activation vector then traverses the interconnect. All weight pages are conserved. Unified memory gives CPU and GPU access to the same pool.A discrete GPU has its own VRAM.Extra CPU work and transfers can slow generation.
  1. 1Unified memory gives CPU and GPU access to the same pool.
  2. 2A discrete GPU has its own VRAM.
  3. 3Offloaded layers use system RAM.
  4. 4Extra CPU work and transfers can slow generation.

Apple silicon and DGX Spark expose unified memory to CPU and GPU. A workstation with a discrete GPU usually has separate system RAM and GPU VRAM. The same allocations therefore have to fit into different pools. When some model work is offloaded, CPU performance and transfers can affect the experience. Leave room for the operating system and temporary allocations.

Technical notes, examples & sources

The diagrams show generic allocations, not equal-capacity hardware, a purchasing recommendation or personal equipment. Colors retain their roles: violet weights, teal K/V and coral workspace. In the offload beat, reserved GPU memory reduces the available GPU budget, and part of the weight allocation moves to system RAM; the overall weight allocation stays constant across the two discrete-GPU states. Offload can execute layers on the CPU and transfer activations, or follow other backend-specific policies. Unified memory avoids a separate RAM-to-VRAM pool boundary but remains bandwidth- and capacity-limited. DGX Spark’s official specification is 128 GB unified memory and 273 GB/s bandwidth; Apple systems vary by chip. Reserved capacity, workspace and operating-system headroom still matter. Sixteen weight pages and eight cache pages are shown. Each page is a schematic portion of an allocation, not a fixed number of bytes or a physical device count. Across the discrete-GPU states the page widths and count stay fixed.

Primary sources · checked 2026-11-18

Part 2 · Make the model fit21 / 36

Three ways to serve the weights

Choose where the model’s weights live.

Three ways to serve the weights Three diagrams compare resident weights, experts split between system RAM and VRAM, and SSD streaming. Strata’s discrete-GPU example reads experts from SSD into system RAM and transfers selected weights to VRAM over PCIe. The Apple silicon example reads experts from SSD into unified memory shared with the GPU. Purple denotes weights and teal denotes context in the resident diagrams. If the model fits in fast memory, Ollama can keep it there between requests.Strata can cache frequently used experts in VRAM and keep more in system RAM.Strata streams experts through system RAM on a discrete-GPU setup and into unified memory on Apple silicon.
  1. 1In-memory serving · weights stay resident
  2. 2Strata · frequently used experts stay in VRAM
  3. 3Strata · SSD → RAM → VRAM or SSD → unified memory

The model server runs inference and answers requests from applications. Ollama, llama.cpp, and MLX-LM can serve models that fit in memory. On a discrete GPU, Strata keeps frequently used experts in VRAM. Its SSD-backed modes bring missing expert weights into system RAM. Selected weights can then move to VRAM over PCIe. On Apple silicon, Strata streams missing experts into unified memory shared with the GPU. InferSSD and Slotstream also support SSD expert streaming. Disk reads make larger models possible and can add latency. Hugging Face hosts model files and cards that explain runtime compatibility.

Technical notes, examples & sources

In-memory execution usually gives the most predictable latency if the working set fits. Ollama and llama.cpp also support CPU/GPU offload; MLX can rely on system paging. GGUF is a file format; MLX is a framework and MLX-LM supplies a model runtime/server. Ollama can also use MLX for supported artifacts. On a discrete GPU, Strata caches frequently used experts in VRAM and keeps more experts in system RAM. The GPU can receive selected weights over PCIe. In resident mode, the experts outside VRAM fit in RAM, so serving needs no SSD reads for expert weights. Mapped mode uses file-backed pages in the OS cache. RAM-budget mode keeps a selected subset in RAM and reads the rest from disk as needed. The Linux file tier can prefetch likely experts. On Apple silicon, Strata’s Metal backend keeps frequently used experts in unified memory and reads missing experts into buffers the GPU can access in that same memory. Strata’s int8 KV streaming is a separate feature for retaining context in RAM with an active portion in VRAM. Setup enables it from 64K when RAM permits, except under WSL. Feature support and defaults depend on the engine, model pack and hardware. InferSSD builds on llama.cpp. SSD expert reads feed a RAM cache, and Linux CUDA adds a GPU cache. Metal/Vulkan can accelerate heavily reused prefill experts; decode placement is backend-specific. Slotstream is a native Swift/MLX/Metal engine for Apple silicon, maintaining Qwen3.8-Flash-Next 4-bit, with one generation at a time. It retains shared weights and caches selected experts, reading misses from SSD and forecasting upcoming expert needs. SSD streaming expands feasible model size; it does not give SSD the bandwidth of RAM or VRAM. Cache hit rate, prompt length, drive performance and runtime support determine latency. Compare prefill and completed-task time, not headline generation speed. Prefer RAM-resident serving when the same model fits. No universal speed ranking is implied.

Three ways to serve the weights
ApproachExamplesBenefitCost / limit
Keep the working set in memoryOllama · llama.cpp · MLX-LMSimple setup; predictable latency when residentCapacity limits the model and context; offload may slow it
Share MoE work across RAM and VRAMStrataLarge supported MoE models with modest VRAM; KV residency controlsCPU, RAM bandwidth and PCIe matter; supported packs/backends only
Stream expert weights from SSDStrata · InferSSD · SlotstreamModels larger than available memoryCache misses cost disk reads. Strata uses system RAM and VRAM on discrete GPUs, or unified memory on Apple silicon.
OllamaModel management and local APIConvenient starting pointCheck actual backend and supported options
llama.cppDirect GGUF engine and serverFine control across many backendsMore manual setup
MLX-LMDirect MLX model servingApple silicon integrationApple silicon; model and server feature support vary
InferSSDSupported GGUF MoE modelsApple silicon / Linux CUDA / Windows buildsBackend-specific expert execution; verify installed build
SlotstreamQwen3.8-Flash-Next 4-bitNative Apple silicon SSD streamingOne maintained model and one generation at a time

Primary sources · checked 2026-11-19

Part 2 · Make the model fit22 / 36

Sharing the machine with experiments

Serving a model competes with your experiments for the same resources.

Sharing the machine with experiments Three stationary motherboard diagrams highlight the resources used by full-GPU inference, RAM/GPU expert serving and SSD streaming. Each connects that resource demand to concurrent research work and a practical mitigation. Full GPU: model residency and generation compete with GPU analyses.RAM + GPU: CPU work and memory traffic can affect the whole workstation.If model reads and data reads share an SSD, both jobs can slow down.
  1. 1Full GPU: model residency and generation compete with GPU analyses.
  2. 2RAM + GPU: CPU work and memory traffic can affect the whole workstation.
  3. 3If model reads and data reads share an SSD, both jobs can slow down.

GPU-resident inference occupies VRAM and uses GPU compute during generation. Expert serving across RAM and GPU also uses CPU cores, memory bandwidth, and transfers. SSD streaming adds disk reads that can compete with data analysis. A discrete GPU can also need PCIe transfers. On Apple silicon, the streamed weights and other work share unified memory bandwidth.

Technical notes, examples & sources

These are sources of contention, not utilization percentages. Ollama can unload models to release memory. Strata can use many CPU cores. Reducing workers or reserving resources can leave room for other jobs at a performance cost. For heavy concurrent research workloads, separating inference and experiment hosts is often simpler. Strata’s SSD-backed paths also use memory bandwidth and compute. On discrete GPUs, weight uploads use PCIe. On Apple silicon, the GPU uses the same unified memory as the CPU. Drive load and inadequate cooling can cause protective thermal throttling. Overheating is conditional, not an inevitable consequence or a claim of drive damage. Actual availability depends on the model, request load and configuration.

Primary sources · checked 2026-11-19

Part 2 · Make the model fit23 / 36

Time to first token

Larger batches share more computation, but need more working memory.

Time to first token One prompt row is processed with the learned weights, then three prompt rows share the same matrix multiplication. The larger batch produces more activation rows and needs more temporary memory. During prefill the server already knows every prompt token.A larger prompt batch uses the GPU more fully and needs more working memory.
  1. 1Prompt tokens arrive together.
  2. 2Larger batches can improve throughput and use more memory.

Prefill can process many known prompt tokens together. Increasing batch size can help throughput, but needs more temporary memory. Flash Attention reduces attention memory traffic and temporary storage. Decode generates one dependent token at a time and is often limited by memory bandwidth. Multiple simultaneous requests also need more memory; keep concurrency low on a constrained machine.

Technical notes, examples & sources

All motion and dimensions are schematic, not elapsed inference times or throughput predictions. The batch illustration represents positions processed together in a physical compute batch, not multiple users or the maximum context length. llama.cpp distinguishes logical batch size from physical microbatch size; Ollama/backend mappings should be checked before tuning. Actual peak memory depends on kernels, attention implementation and allocator behavior, and increasing batch size does not guarantee a speedup. Decode may be limited by weight bandwidth, cache traffic, compute, transfers or other overhead, depending on the workload. Tensor hardware accelerates supported matrix operations; advertised peak TOPS specifies precision and workload assumptions and is not a prediction of chat performance. Record time to first token, prompt evaluation rate, output generation rate and peak memory. A model server is the next layer to introduce. The numerical figure uses the exact four-feature trace from the opening, with one versus three known prompt positions in the physical batch. Only the Q projection is drawn; K/V come from their separate learned projection matrices. Cache append retains the first three rows exactly.

Primary sources · checked 2026-11-18

Part 2 · Make the model fit24 / 36

Speculative decoding

The main model accepts a prefix, then corrects the first rejection.

Speculative decoding The committed prefix stays fixed. Ordinary target steps become four outlined draft token pieces from an MTP predictor. A target verification bracket spans the block; two tokens are accepted, one rejected and the suffix discarded. Accepted text and the target correction appear in the final output row. Ordinary decoding evaluates one new position at a time.Propose several candidate tokens.Verify the proposed block with the main model.Accept the prefix, correct the rejection, and continue.
  1. 1Generate one token per ordinary step.
  2. 2Draft several candidates.
  3. 3Verify the draft in one pass.
  4. 4Keep the accepted prefix and correct the first rejection.

Multi-token prediction (MTP) is one form of speculative decoding. A supported predictor proposes several tokens; the main model verifies the block, accepts a matching prefix and corrects the first rejection. More accepted tokens can reduce expensive target passes. Drafting and verification also have overhead. MTP may need to be enabled explicitly in the server.

Technical notes, examples & sources

Token pieces and verification are simplified; exact speculative sampling uses acceptance/correction rules to preserve the target distribution, and an all-accepted block can yield an additional target token. MTP and separate-draft-model controls are not interchangeable. Compare drafting off/on using the SAME MTP-capable artifact, prompt, target sampling, context and runtime. Ollama v0.40.16 llama-server exposes draft_num_predict: zero disables the draft path and positive values cap proposals when usable draft machinery is present. The listed qwen3.8:27b-mtp-q4_K_M artifact provides an explicit starting point; verify logs, residency and memory, not just the tag. Direct MLX-LM documents draft_model and num_draft_tokens for a separate compatible drafter; that is not proof that every Qwen MTP artifact works there. Record acceptance when exposed, draft/verification overhead, peak memory, complete request time and quality. The local service is now the engine for the next chapter: a harness will supply context, tools and the task loop. MTP is a form of speculative decoding, not a synonym for all speculative methods; separate draft models and other predictors are alternatives. Ollama requires an explicit draft_num_predict setting for supported embedded MTP tensors; the default for separate draft models differs. Verify support for the downloaded artifact and server version.

Example configuration

# Same MTP-capable artifact for BOTH comparisons; match all other options.
ollama pull qwen3.8:27b-mtp-q4_K_M

# Inside the /api/generate request options:
{"num_ctx":8192,"num_batch":256,"num_predict":256,"draft_num_predict":0}
# Compare with:
{"num_ctx":8192,"num_batch":256,"num_predict":256,"draft_num_predict":4}

# These are options objects, not standalone shell commands.
# Inspect effective draft settings and GPU residency in server logs.
# Keep only changes that improve the representative task.

Primary sources · checked 2026-11-15

Part 2 · Make the model fit25 / 36

Benchmark your local setup

Sweep one setting at a time and measure the whole request.

Measure speed, memory, and task success together.

Benchmark your local setup Eight sweep cards cover weight and KV quantization, context, batch size, drafting, concurrency, placement, and cache reuse. The timeline marks the prefill and decode windows, the time from send to first token, and the time to finish. The cards add stream gaps, total throughput, peak memory, task success, draft acceptance, and power and I/O. Weight and KV quantization · context · batch · MTPPrefill · first token · decode · completionThroughput · peak memory · task success · power and I/O
  1. 1Sweep weight and KV precision, context, batch and microbatch sizes, MTP, draft length, concurrency, placement and cache reuse.
  2. 2Time prefill, first token, decode and completion. Record stream gaps and throughput under load.
  3. 3Check peak memory and task success. Measure draft acceptance, power and disk I/O when available.

Start with the model, machine, and workload you plan to use. Sweep the settings in the left panel and measure the same requests on the right. An engine benchmark can isolate prompt processing and generation. A streamed server request measures what you actually wait for. Finish with a real task and a result you can check.

Full benchmark checklist and sources

Record the exact model file, runtime build, hardware and driver, prompt set and template, sampling settings, actual prompt and output lengths, and cache state. Keep them fixed unless they are the setting under test. Start from a baseline, change one variable at a time, then recheck combinations that matter, such as context × KV precision or draft length × concurrency. Repeat runs and report the sample count and spread. Use a fixed output budget for speed comparisons, then run your representative tasks to completion. The timeline illustrates measurement windows.

Benchmark your local setup
Setting or metricWhat to vary or record
Sweep · Weight quantizationCompare the exact quantized files for one checkpoint with a higher-precision reference. Log the quantization recipe and file size.
Sweep · KV cacheCompare supported key and value precisions independently of weight precision. Record cache size and placement.
Sweep · Context lengthVary actual input tokens and occupied context from short prompts to long histories. Record the configured limit separately. Check long-context task quality and truncation.
Sweep · Batch and microbatchVary the logical prompt batch and the physical microbatch where the runtime exposes both. Track peak working memory as well as throughput.
Sweep · MTP and other draftersStart with speculation off. Keep the target weights fixed and compare supported methods, draft length, and any acceptance threshold.
Sweep · Request concurrencyCompare one request with the expected number of simultaneous requests. Keep this distinct from prompt batching. Reuse the same arrival pattern and mix of input and output lengths.
Sweep · Placement and runtimeCompare GPU-resident and supported offload or SSD modes. Vary GPU layers or expert and KV residency when offered. Compare runtime, kernel, or Flash Attention changes in a separate sweep.
Sweep · Cache reuseSeparate cold model load, a resident model with a fresh prompt, and a repeated prefix or resumed chat. Record whether the prefix was reused and, for SSD serving, whether the file cache was warm.
Measure · Prefill speedRecord prompt evaluation time and processed input tokens per second. Record cached and newly evaluated tokens separately.
Measure · First token and full requestMeasure request send to first streamed token (TTFT), and send to completion. Client timing includes waiting and overhead. Record cold load separately where available.
Measure · Decode speed and stream gapsRecord generated tokens per second after the first token and the gaps between streamed chunks. One speculative chunk can deliver several tokens. Report median and tail latency, such as p95 when the sample is large enough.
Measure · Total throughputUnder concurrent load, report output tokens and completed requests per second across the server. Record errors, timeouts, and how many requests met the latency target.
Measure · Peak memoryRecord peak RAM and VRAM or peak unified memory, during prefill and decode when possible. Note paging or out-of-memory failures.
Measure · Task successUse the same tasks and pass criteria. Check correctness, long-context retrieval, or tool and test success. Record time and generated tokens per completed task and count failures, retries, and truncated outputs.
Measure · Draft acceptanceWhen the server exposes them, record accepted and proposed tokens and accepted tokens per verification step. Compare with end-to-end speed and extra memory to assess the benefit.
Measure · Power and I/OFor sustained or SSD-backed runs, record disk reads, power or energy per task, temperatures and throttling where available. Keep concurrent machine activity comparable.

Primary sources · checked 2026-11-20

Part 2 · Make the model fit26 / 36

Matching models to hardware

Match the model’s working memory to the hardware.

Matching models to hardware Four hardware rows compare GPU workstations and Apple silicon laptops. Inkling appears in the models column for both laptops. Their examples budget one 64K agent session and show how weight precision, cache format and peak prefill memory affect fit. Keep dense models GPU-resident.Add system RAM for larger MoE models.16 GB · Inkling Q2 trial · 64K agent session24–32 GB · Inkling Q4 · benchmark prefill at 64K
  1. 1Keep dense models GPU-resident.
  2. 2Add system RAM for larger MoE models.
  3. 316 GB · test Inkling Q2 at 64K · Q8_0 cache ≈ 1.15 GiB
  4. 424–32 GB · test Inkling Q4 at 64K · check peak prefill memory

These four setups assume one agent session. Ollama’s guidance for OpenCode calls for at least 64K tokens. At that context, a Q8_0 cache for both keys and values takes about 0.47 GiB for Muse Glimmer, 1.15 GiB for Inkling 2 Mini and 2.125 GiB for Qwen3.8-27B. These estimates assume compact sliding windows where applicable. Weights, other model state and runtime buffers also need room. On a 16 GB laptop, try Inkling’s Q2 weights only if a representative 64K prompt fits during prefill. Q4 weights are worth testing on 24 GB, with more headroom on 32 GB or above. If the 64K run does not fit, choose a lighter model or a machine with more memory.

Technical notes, examples & sources

The context arrow in each row means minimum-tier working range → ideal-tier capacity, not a requirement to use the maximum. The Qwen, Muse and Flash-Next ranges assume one request, Q8 KV where the backend supports it, and room for the OS and working buffers. For Qwen3.8-27B, the calculated q8_0 KV payload is 2.125 GiB at 64K, 4.25 GiB at 128K and 8.5 GiB at 256K, plus 144 MiB of recurrent matrices and other allocations. Those values are independent of weight quantization. A 24 GB GPU with Q4 weights can target 64–128K depending on its free VRAM; 32 GB VRAM gives room toward 256K at Q4. Q5 may require a smaller context. The Strata minimum assumes Flash-Next IQ2_XS and 64 GB system RAM; its RAM KV streaming permits long contexts while preserving some expert residency. At 256K, use the launch plan to check the combined expert and context RAM budget; 96–128 GB is a comfortable purchase target. The compact laptop minimum assumes the 7.63 GB Unsloth UD-IQ2_XS weight file, not 27B at Q4. A 16 GB Mac can target 64K; 24 GB leaves room toward 128–256K. Smaller 4B/9B Q4 models leave more room and are an alternative if low-bit 27B quality is unsuitable. On the 24 GB Mac tier, Muse Q4 has more context headroom than Qwen27 Q4; Qwen Q4 at 64K is tight once other apps and buffers are included, so prefer 32–48 GB for that combination. At 32 GB, 256K Qwen Q4 can be tight; 48 GB gives more room. Muse q8_0 payload is approximately 0.47 GiB at 64K and 0.90 GiB at 128K when its sliding-window cache is bounded; the recommendation stays within the standard 128K configuration. Native MLX and Slotstream cache formats/options differ: use 8-bit KV when supported, otherwise budget the actual native cache. Direct MLX-LM --kv-bits 8 currently disables batching in that server path. Q8 usually has negligible task-quality impact but is not mathematically lossless; FP16 is the higher-precision option for sensitive tasks or a reference comparison. Test Q4 cache only when its extra memory savings matter. Strata’s SSD-backed modes, InferSSD, and Slotstream are options for larger MoE models on supported hardware. Latency depends on how much of the working set stays in memory and how fast the drive can supply the rest. Minimum and ideal targets are capacity recommendations, not private benchmarks or universal performance optima. GPU/driver support, CPU and PCIe, memory bandwidth, SSD space, and other research software still matter when buying. Muse is also an option on compact laptops. Unsloth lists Muse UD-IQ2_XXS at 10.7 GB (about 10.0 GiB), UD-IQ3_XXS at 13.1 GB and UD-Q4_K_XL at 15.9 GB. These are text-model weight-file sizes, not total runtime memory. A 16 GB Apple silicon laptop can be a tight text-only IQ2 starting point with Q8 cache and a conservative prefill batch; 24 GB leaves room for IQ3 or Q4 depending on other apps. At 64K the bounded Q8 KV payload is about 0.47 GiB. Leave room for buffers and the OS, and check the low-bit model on the actual task. Vision encoders and speculative drafters are additional allocations; the listed projector and draft files are not standalone models. Prefer a calibrated dynamic weight file where the model and engine support it. Q4–Q8 is a range across configurations, not a promise that Q8 fits at the minimum: moving toward Q8 spends memory that could otherwise hold context. For Qwen27/Muse at Q8, 48 GB or more provides more practical headroom than 32 GB; verify the exact file and allocation. IQ1 is an aggressive, model-specific alternative rather than a default recommendation for these dense 27–30B rows. The sweet-spot capacities are starting purchase targets, not upper limits. For Inkling 2 Mini, use a llama.cpp build and GGUF with looped-layer support. Budget one 65,536-token agent session, including tools, conversation history and space for the reply. On 16 GB, the 9.14 GB UD-Q2_K_XL file is a text-only trial. On 24 GB, benchmark the 17.63 GB UD-Q4_K_XL file under realistic load. A 32 GB or larger machine gives Q4 more working room. Check low-bit weight quality on a task you can verify. With compact sliding windows, Inkling’s estimated cache at 64K is 1.15 GiB for Q8_0 keys and values, or 2.16 GiB for FP16. At the same context Muse needs 0.47 or 0.89 GiB and Qwen needs 2.125 or 4 GiB, respectively. Qwen’s recurrent state is additional. A llama.cpp Q8_0 block uses 34 bytes per 32 values. In Unsloth’s documented Inkling implementation, quantized KV takes a different attention path during prefill. Temporary buffers can offset the cache savings. Compare Q8_0 and FP16 on the same long prompt and microbatch in your build. Record peak memory, prompt-processing speed and whether the machine swaps. Check decoding speed and tool-call quality as well. The OS, convolution state and compute buffers add to the budget. Vision also requires a 639 MB projector plus working memory. File sizes are decimal GB and cache estimates are binary GiB.

Matching models to hardware
SetupMinimumSweet spotModelsWorking context
GPU workstation24 GB VRAM + 32 GB RAM32 GB+ VRAM + 64 GB+ RAMQwen3.8-27B / Muse Glimmer · dynamic Q4–Q8 when supported; Q8 needs more room, or less context.64–128K → 256K; Muse 64–128K
GPU workstation + high system RAM12 GB VRAM + 64 GB RAM24 GB+ VRAM + 96 GB+ RAMLarge MoE · Q2–Q3; Qwen3.8-Flash-Next64–128K → 256K
Lower-end Apple silicon laptop16 GB unified + Apple silicon24 GB+ + Unified memoryQwen27 2-bit or Muse Glimmer IQ2 on 16 GB. Muse IQ3/Q4 when there is room on 24 GB. A 4B/9B Q4 model is another option. Inkling 2 Mini Q2 is a text-only trial.Qwen with Q8 KV, 64K → 128–256K. Muse with Q8 KV, 64–128K. Inkling Q2 at 64K with Q8_0 KV only if peak memory fits.
Higher-end Apple silicon laptop / Mac mini / Studio24 GB unified + Apple silicon32 GB+ + 48 GB+ for Q8Qwen3.8-27B / Muse Glimmer · dynamic Q4–Q8 when supported; Q8 needs more room, or less context. Inkling 2 Mini Q4 with a loop-aware llama.cpp build.Qwen with Q8 KV, 64K → 128–256K. Muse with Q8 KV, 64–128K. Inkling Q4 at 64K, one session. Compare Q8_0 and FP16 during prefill before extending context.

Primary sources · checked 2026-11-21

Part 3 · Give the model tools27 / 36

Who actually reads the file?

The harness checks permissions, runs tools, and gives the model the result.

Who actually reads the file? A hosted ChatGPT or Claude session appears first. A second row lines up the same roles in a local session using OpenCode and Ollama. The comparison gives way to the two application windows. The model requests a file, OpenCode checks permission, and the returned contents become input for the next model call. ChatGPT or Claude · hosted harness and modelOpenCode harness · model served by OllamaSend the task and available toolsCheck permission and read the fileReturn the file contents to the model
  1. 1ChatGPT or Claude · hosted harness and model
  2. 2OpenCode harness · model served by Ollama
  3. 3Send the task and available tools
  4. 4Check permission and read the file
  5. 5Return the file contents to the model

If you use ChatGPT or Claude, the hosted setup is probably familiar. You send a request from an app or browser, and the provider runs the agent harness and model in the cloud. The harness manages the conversation and calls tools. A local setup uses the same pieces. Here OpenCode runs the harness and Ollama serves the model on your laptop or workstation. When the model asks to read an analysis file, OpenCode checks permission, reads the file, and sends the contents back to the model.

Technical notes, examples & sources

Start with the agent people may already use in ChatGPT or Claude. The diagram shows a hosted session. A desktop harness can also call a cloud model. Advance to the local equivalent, then follow the request from the opening research question to the analysis file. If the read is denied or fails, OpenCode reports that outcome in the next model request.

Primary sources · checked 2026-11-18

Part 3 · Give the model tools28 / 36

Connecting apps with MCP

The Model Context Protocol (MCP) gives an agent harness a common way to discover and call tools offered by other apps.

Connecting apps with MCP The model requests a list of image layers. OpenCode checks access and calls the PhotoCraft MCP server, returning the result to the model. The next reveal shows the GitHub, Slack, Notion and Figma logos with examples of tools offered by their official MCP servers. Model requests the layer list → OpenCode calls PhotoCraftGitHub · issues and pull requestsSlack · search and messagesNotion · pages and meeting notesFigma · design context
  1. 1OpenCode asks PhotoCraft for the open figure’s layers.
  2. 2GitHub · issues and pull requests
  3. 3Slack · search and messages
  4. 4Notion · pages and meeting notes
  5. 5Figma · design context

OpenCode can read a file with its built-in tools. To work inside another app, it can connect to a server that speaks the Model Context Protocol (MCP). A server describes the tools it offers and the inputs each one accepts. The model can then request a tool by name. OpenCode checks the configured permissions, sends the request through its MCP client, and passes the result back to the model. For example, ArtCraft’s PhotoCraft can return the layer list for an open figure or export selected layers. GitHub’s official server can search issues or open a pull request. Notion’s can find and update pages and meeting notes. Slack’s can search channels and retrieve or send messages. Figma’s can supply design context from selected frames and components. Each server exposes the actions supported by that app and your connected account.

Technical notes, examples & sources

Ask how an agent could tell which layers are in an open figure. PhotoCraft offers a document-inspection tool through its local MCP server. The layer names in the diagram illustrate what might come back. Once OpenCode has the result, the model can use it to answer or request another action. On the next reveal, point to the GitHub, Slack, Notion and Figma logos. Give one example for each: open a pull request, search a discussion, find meeting notes, or read a design. These are official app integrations. A server can offer several tools, and the host’s tool settings and the connected account determine which actions are available.

Primary sources · checked 2026-11-22

Part 3 · Give the model tools29 / 36

Choosing an agent harness

Hermes / OpenClaw: ongoing assistant work with tools and memory.

Choosing an agent harness Three small realistic workspaces remain visible: an OpenCode project task with tests, a VS Code selection with inline assistance, and an assistant conversation beside saved notes. Each names one workflow. Manual emphasis changes in place; no text flies between windows. OpenCode can carry a task from a project brief to a proposed change.In VS Code, keep the file and diff in front of you while you edit.An assistant harness can carry preferences and ongoing tasks between sessions.
  1. 1OpenCode can carry a task from a project brief to a proposed change.
  2. 2In VS Code, keep the file and diff in front of you while you edit.
  3. 3An assistant harness can carry preferences and ongoing tasks between sessions.

A harness is the application around model calls: it assembles context, offers tools, checks permissions and keeps the task moving. My main division is OpenCode for long-running, larger tasks; VS Code for edit-focused or mixed coding work; and Hermes or OpenClaw for assistant work with saved memory. These are workflow preferences, not hard boundaries between what the tools can do.

Technical notes, examples & sources

OpenCode can plan, change files, run commands and tests, and continue across many steps; I review the result as a GitHub pull request. VS Code supports inline edits, chat and multi-step agents through its integrations, so it also suits a mixed workflow. Hermes and OpenClaw provide ongoing assistant workflows with tools, saved memory and integrations; saved memory lives outside a single model context and is not the KV cache. The active provider determines whether inference is local or hosted. The harness controls its tools and permissions; the server runs the model. Verify tool calling, streaming, model limits and the actual provider route. No interface automatically grants access to another machine’s files.

Primary sources · checked 2026-11-16

Part 3 · Give the model tools30 / 36

Where do the model and tools run?

The model server generates tokens. OpenCode runs tools. The interface lets you steer the session.

Put the model server where it fits and OpenCode where the project lives.

Where do the model and tools run? Three rows show the same roles in different places. On one machine, the model server, OpenCode tools, and interface sit together. With a separate model server, only the Model API crosses machines. With remote control, the model and tools run on a workstation while a laptop or phone connects to the OpenCode session. One laptop or workstation can run the model server, OpenCode, and its interface.A model workstation can serve OpenCode running on your laptop or research workstation.Run the work on a workstation and steer the OpenCode session from a laptop or phone.
  1. 1One laptop or workstation · model, tools and interface
  2. 2Separate workstation · only the model moves
  3. 3Remote session · steer workstation tools from a laptop or phone

On one laptop or workstation, the model server, OpenCode, and its interface can all run together. You can move the model server to a separate workstation while OpenCode runs tools against project files on your laptop or research workstation. For remote control, run OpenCode and the model server on a workstation and open the same OpenCode session from a laptop browser or a phone. The model server can also be on a separate host in that setup.

Technical notes, examples & sources

The Model API connects OpenCode to the model server that generates tokens. An OpenCode session connection links a browser or paired client to the OpenCode process, which runs tools and accesses project files on its own machine unless a tool has been configured to run elsewhere. For a phone, use a browser or a compatible OpenCode mobile client. Keep remote access private and authenticated. These are generic deployment examples.

Primary sources · checked 2026-11-18

Part 3 · Give the model tools31 / 36

When the context window fills

Compaction carries the useful task state forward as a summary.

When the context window fills An OpenCode output stream grows while a context meter fills. At the next presenter step the near-full meter prompts compaction. Older work is summarized into goal, constraints and next action; its allocation shrinks, and the agent resumes with free context and the summary retained. Messages, reasoning and tool output accumulate while the agent works.The next step needs room in the context window.Compaction summarizes older work and replaces it in the next request.Continue from the summary; retrieve exact details from project files.
  1. 1Messages, reasoning and tool output accumulate while the agent works.
  2. 2The next step needs room in the context window.
  3. 3Compaction summarizes older work and replaces it in the next request.
  4. 4Continue from the summary; retrieve exact details from project files.

An agent’s history grows with each step. Before it runs out of room, compaction summarizes the older work: the goal, decisions, constraints and next action. That summary replaces the older messages in the active context. A 64K working context plus compaction is a reasonable starting point here; the Qwen examples support up to 256K native context. Use more when the task needs it.

Technical notes, examples & sources

Compaction is a harness operation that usually calls a model to create a summary. It loses detail, so keep exact code and task state in files and retrieve what is needed. It does not shrink model weights or change the neural architecture into a recurrent model. NVIDIA’s Belcak et al. report that frequent compaction retains little-to-no loss on many evaluated long tasks and propose semantic state-space models: a natural-language state summary carried between steps. This supports the state-space analogy, not a universal guarantee that long context is unnecessary. The meter shows schematic relative occupancy, not measured tokens. 64K is a starting configuration, not an OpenCode requirement or a result of the NVIDIA paper. Qwen3.8-27B and Flash-Next support 256K natively; other models, including Muse, have their own limits. Match harness and server limits.

Primary sources · checked 2026-11-18

Part 3 · Give the model tools32 / 36

Would you trust this change?

A proposed change becomes useful when you can check it.

Would you trust this change? A persistent four-stage flow links delegation, automated tests, human review and a keep-or-revise decision. The active stage and connecting progress advance while the same task remains visible. A revision arrow loops back to delegation. Delegate a bounded task on a branch.Run useful tests and CI on the proposed change.Review the diff, outputs and scientific assumptions.Keep a sound change—or revise, test and review again.
  1. 1Delegate a bounded task on a branch.
  2. 2Run useful tests and CI on the proposed change.
  3. 3Review the diff, outputs and scientific assumptions.
  4. 4Keep a sound change—or revise, test and review again.

My workflow is increasingly to describe the task in OpenCode, review the proposed change in a GitHub pull request, and use tests and CI to catch regressions. I still check what the code means: units, missing data, null models and the assumptions behind the analysis.

Technical notes, examples & sources

For trajectory analysis, check units, coordinate conventions, missing data, identity switches and known synthetic cases. Compare expected plots or reference outputs. Passing CI only means the configured checks passed. It does not establish biological validity or rule out data leakage. Human review owns the assumptions and merge decision.

Primary sources · checked 2026-11-18

Part 3 · Give the model tools33 / 36

Make verification routine

Tests, CI, and pull requests are now practical for small research projects. They are my default for agent-written changes.

Give every agent-written change a test, a repeatable check, and a review.

Make verification routine A single request to preserve missing frames leads through three connected cards. Tests show the regression failing before the fix and passing afterward. Continuous integration reruns the test command on every pull request push. The pull request brings the diff, results, and output together for a human decision. Agent setup · Add the test, configure CI, and open a small pull request.Tests · Check that a shifted track preserves missing frames. Reproduce the bug before fixing it.CI · Run the same test command locally and on every push to the PR.Pull request · Review the code, the checks, and an example output before merging.
  1. 1Agent setup · Add the test, configure CI, and open a small pull request.
  2. 2Tests · Check that a shifted track preserves missing frames. Reproduce the bug before fixing it.
  3. 3CI · Run the same test command locally and on every push to the PR.
  4. 4Pull request · Review the code, the checks, and an example output before merging.

Setting up tests, CI, and pull requests used to take enough effort that it was easy to skip them on small projects. A coding agent can write the first regression test, wire the same test command into CI, and prepare a small pull request with its results. That makes this my recommended default for updating and maintaining code with agents. I still define the expected behavior, review the diff and a representative output, and decide when to merge.

Technical notes, examples & sources

Start with one rule you can check. For a time-shifted track with a known gap, a small synthetic fixture can establish where that gap should land. Ask the agent to run the regression test against the original implementation and the fix, then reuse the local test command in CI. Keep the pull request focused and ask for the commands and results in its description. Review the expected behavior and test itself, along with the diff and an example output. Repeat the checks after revisions.

Primary sources · checked 2026-11-18

Part 4 · Take it into the lab34 / 36

Check the date on setup advice

Keep the mental model. Recheck the setup.

The names and defaults change. The method carries over.

Check the date on setup advice Two chronological rows show six selected milestones: Ollama’s desktop app, OpenCode 1.0, Qwen3.8, Strata 0.2, Qwen3.8 Dynamic v3.1 quants and the Qwen4-Max cloud release. Equal spacing is used for readability.
  1. 1Models and tools are evolving together.
  2. 2New servers change which models can fit.
  3. 3Keep the mental model. Recheck the setup.

Ollama’s desktop app arrived in July 2025; OpenCode 1.0 in October 2025; Qwen3.8 in August 2026; Strata’s 0.2 app and engine packaging in October 2026. Unsloth updated its Qwen3.8-27B Dynamic v3.1 quantizations on 11 November; QwenCloud lists Qwen4-Max on 16 November. Treat setup advice as a dated starting point and compare changes on your own tasks.

Technical notes, examples & sources

Release milestones, checked 16 November 2026: OpenCode v1.0.0 was published on 31 October 2025 (the project had earlier releases). Qwen3.8-Max launched on 3 August 2026; QwenCloud added Qwen3.8-27B on 19 August. Unsloth dates its Qwen3.8-27B Dynamic v3.1 update to 11 November 2026; its Flash-Next update was earlier in November. Qwen4-Max-Preview appeared on 11 November and QwenCloud lists Qwen4-Max on 16 November, so describing Qwen4 only as work in progress is already outdated. This is a cloud release, not a claim that a local Qwen4 replacement is available. Agent harnesses have changed rapidly; this does not mean established editors such as VS Code began in 2025. Keep a known-good configuration and compare one change at a time using current model cards, release notes and documentation. The timeline shows selected milestones, with equal visual spacing rather than elapsed-time distances. Ollama’s desktop chat app was announced on 30 July 2025; the server predates it. Strata v0.2.0-beta was released on 19 October 2026 and packaged the app, Terminal and engine; this is not the project’s founding date.

Primary sources · checked 2026-11-18

Part 4 · Take it into the lab35 / 36

Back to the food patch

From a question about a food patch to a testable change in the analysis.

Back to the food patch Three visual summaries pair a model and cache, a hardware memory budget, and a reviewed code change with the three takeaways. From a question about a food patch to a testable change in the analysis.
  1. 1A model predicts one token and adds its new keys and values to the cache.
  2. 2Fit weights, cache and working memory on the machine. Leave room for other jobs.
  3. 3A harness can propose the control. Use tests and scientific judgment to review it.

A model generates tokens using learned weights and a changing KV cache. Local performance depends on matching the model and settings to the hardware. A harness adds tools and a task loop; reviewing the result remains part of the work.

Technical notes, examples & sources

Close with one action: pick a small research-code task. Establish an Ollama baseline, connect OpenCode, record one controlled comparison, then review one proposed change with checks and scientific judgment.

Primary sources · checked 2026-11-18

Part 4 · Take it into the lab36 / 36

Try it on one task you know

Use the setup prompt with ChatGPT or Claude—and start with one real task.

Try it on one task you know A chat composer invites the viewer to describe their hardware and task. A copy button supplies the complete setup prompt, with links to server and harness documentation below. Bring your machine’s specs and one task whose result you know how to check.
  1. 1Bring your machine’s specs and one task whose result you know how to check.

Start with one task you already understand. Use the setup prompt with ChatGPT or Claude, follow the official documentation, and keep a working configuration you can return to.

Technical notes, examples & sources

Use this prompt with ChatGPT or Claude to work through your own hardware and task. The links below lead to the project documentation.

Help me set up a useful local AI system for my work. Guide me one step at a time, explain each important setting in a sentence, and use current official documentation rather than guessing commands or model support.

First ask me about:
- My operating system, Apple chip or GPU model, unified memory or GPU VRAM, system RAM, free disk space, and what else needs to run.
- My main tasks: chat, coding, research, long agent tasks, or an assistant with memory; the kinds and sizes of files I use; and whether speed, quality, context length, or keeping data local matters most.
- Any model server or harness I already use. Ask only for information needed for the next decision.

Then help me:
1. Choose a model and exact quantized download that fit my hardware and tasks. Use the Hugging Face model card and file list to verify the artifact, license and runtime compatibility. Consider Qwen3.8-27B, Muse Glimmer, Inkling 2 Mini, or a smaller current alternative, but verify availability and support. Explain dense versus MoE, total versus active parameter count, weight quantization and the memory needed for the weights, KV cache or recurrent state at my intended context and session count, temporary work, and room for other apps. For Inkling 2 Mini, account for the separate cache per loop pass and verify how the runtime allocates its sliding-window layers.
2. Choose a server. Compare ordinary in-memory serving (Ollama, llama.cpp, MLX-LM), RAM/VRAM MoE tiering (Strata), and SSD expert streaming (Strata, InferSSD, Slotstream on supported setups). Start with in-memory serving when the model fits. On Apple silicon compare direct MLX-LM when useful. Explain latency, capacity and model-support tradeoffs. For a compatible MoE model, also consider Strata: verify its supported model pack/backend, expert cache and CPU/GPU split, RAM/SSD budget, KV streaming and expert prefetch support. Explain GGUF as a model-file format and MLX as Apple’s computation framework; MLX-LM supplies model tools and a server. Distinguish those from the harness. Check support for this exact model and hardware.
3. Get a small request working and confirm actual GPU use. Save the model identifier, versions and settings. Do not assume the defaults match my workload.
4. Tune one setting at a time: model size/weight precision (prefer a compatible calibrated dynamic quant; check model-specific IQ1 through Q8 options); context length; KV-cache precision (Q8 as the working assumption where supported, FP16 for higher precision); Flash Attention where supported; prefill batch size; concurrent requests; and multi-token prediction (MTP), a form of speculative decoding, and its draft length if compatible. Check whether it needs explicit enabling. Explain what each changes, its memory/speed/quality tradeoff, and how to undo it. Use the SAME compatible artifact when comparing speculation off and on.
5. Compare a short repeatable task before and after each change. Record memory use, time to the first token, output speed and answer quality; distinguish loading, prefill and decode. Use my actual results to decide what to keep. Do not invent measurements or promise a speedup.
6. Connect a harness suited to the work: OpenCode for long-running larger coding tasks, VS Code for edit-focused or mixed coding work, or an assistant harness such as Hermes/OpenClaw for ongoing tasks and memory. Explain which tools it can run, where files are edited, permissions, what fills context, compaction, and how saved memory differs from the KV cache. For an OpenCode agent, configure at least 64K context in the server and harness. At one session, compare FP16 and Q8_0 KV where supported. Measure peak memory and prompt-processing speed with a representative long input. Use compaction as the history fills.
7. For coding, start with one small task, a branch and a pull request. Add useful tests/CI, then help me review the diff, output and scientific assumptions. If I want another device to access the server, identify the model server, tool host, and client, then connect over a private authenticated link.

Give me one recommended starting configuration and the official links that support it. If I am buying a machine, ask my budget and other research software requirements, then compare GPU VRAM versus unified memory, bandwidth, system RAM, CPU/PCIe needs for offloading, storage, power/cooling and upgradeability. Consider an existing shared workstation before recommending a purchase. Begin with the hardware and task questions, then wait for my answers before giving installation commands. Compare practical minimum and sweet-spot hardware, including Unsloth Dynamic v3.1 2-bit Qwen3.8-27B and Muse Glimmer. Separate weight-file size from total runtime memory, recommend an initial context and cache precision for the exact backend, and reserve OS, prefill and draft-model headroom.

Primary sources · checked 2026-11-18

Keep as a reference

The essential vocabulary

Parameter
A learned numerical value in the model.
Token
An element of the encoded input or output sequence; not necessarily a word.
Inference
Using learned weights to produce model output.
Attention
A computation combining value representations using query–key compatibility.
KV cache
Retained keys and values used to avoid recomputing earlier representations.
Recurrent state
A retained state updated by recurrent layers.
Prefill
Processing known input tokens before or between generation steps.
Decode
Generating dependent output tokens one step at a time.
TTFT
User-visible time from request submission to first output token.
Quantization
Representing values with fewer levels, often reducing storage.
GB / GiB
Decimal gigabytes (10⁹ bytes) / binary gibibytes (2³⁰ bytes).
Batch / microbatch
Logical tokens submitted / physical tokens executed at once.
Speculative decoding
Drafting continuations and verifying them with a target model.
MTP
Multi-token prediction; trained machinery that can support drafting.
Residency / offload
Where model data and layers are placed for execution.
Harness
Software managing model calls, tools, permissions, state, and stopping.
Compaction
Replacing part of the history with a shorter representation.
Prefix caching
Reusing computation for an unchanged prefix without shortening its logical length.
Dense / MoE
Dense layers use the same feed-forward weights for every token; mixture-of-experts layers route tokens through selected expert networks.
Total / active parameters
All stored model parameters / the subset used to process a token.
Expert cache / prefetch
Keeping frequently used expert weights nearby / fetching likely needed weights before their use.
Model Context Protocol (MCP)
A standard the agent harness can use to discover tools on a connected server, call them, and receive their results.

Memory budget example · Setup prompt and resources

About the examples

Memory examples use the architectures and precision stated beside each figure. Model files and runtime overhead add to the raw weight and cache sizes. Sources and setup examples were checked in November 2026; use the linked documentation for current versions.

Copy the setup prompt