Group meeting · 20 minutes including discussion

Using AI Agents for Research

How language models use tools, how to run them on the hardware you have, and how I delegate, reproduce, and review research work.

Full talk and guide

Part 1 · From prompt to tool1 / 51

Using AI Agents for Research

Follow one research question from prompt to result.

  1. Up nextTokens
  2. LaterAttention & layers
  3. LaterGeneration
  4. LaterTool use
Speaker notes · 14 seconds

Follow one research question from prompt to result.

Part 1 · From prompt to tool2 / 51

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.

Speaker notes · 21 seconds

Open with the two animals at the same food patch. Ask what evidence could separate attraction from a shared interest in food. Send that question and follow its words into the model.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool3 / 51

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.

Speaker notes · 25 seconds

Follow one piece of the prompt into the embedding table. Its row of learned numbers is the representation that the rest of the model can transform.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool4 / 51

From a prompt to a tool call

How does context change a token’s meaning?

  1. CoveredTokens
  2. Up nextAttention & layers
  3. LaterGeneration
  4. LaterTool use
Speaker notes · 6 seconds

How does context change a token’s meaning?

Part 1 · From prompt to tool5 / 51

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.

Speaker notes · 40 seconds

Start with one token. Its query is compared with earlier keys. The resulting weights control how strongly those positions’ values contribute to its new representation.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool6 / 51

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.

Speaker notes · 20 seconds

Keep your eye on one position. Attention has brought in information from other words. The feed-forward network transforms that position’s features before passing them on.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool7 / 51

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.

Speaker notes · 29 seconds

Follow the keys and values as they leave the layer and enter this chat’s cache. Every chat uses the same learned weights. As the reply grows, decoding reuses the cached keys and values and appends the new token’s pair. The 16 GiB figure is the cache for 8,192 tokens in the FP32 example, separate from the weights.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool8 / 51

From a prompt to a tool call

How do the final features become the next token?

  1. CoveredTokens
  2. CoveredAttention & layers
  3. Up nextGeneration
  4. LaterTool use
Speaker notes · 7 seconds

How do the final features become the next token?

Part 1 · From prompt to tool9 / 51

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.

Speaker notes · 24 seconds

Follow the selected token from the vocabulary scores into the reply. Appending it changes the input for the next prediction.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool10 / 51

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.

Speaker notes · 10 seconds

Use the timeline to distinguish waiting for the answer to start from watching the rest arrive. The next two slides show what the model keeps between those moments.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool11 / 51

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.

Speaker notes · 24 seconds

Point to the K and V entries that the prompt positions leave behind. Advance straight into decode so those same entries remain visible.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool12 / 51

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.

Speaker notes · 24 seconds

The highlighted entry is new. The earlier keys and values stay in place while the model generates the next token.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool13 / 51

From a prompt to a tool call

Who carries out a tool request?

  1. CoveredTokens
  2. CoveredAttention & layers
  3. CoveredGeneration
  4. Up nextTool use
Speaker notes · 6 seconds

Who carries out a tool request?

Part 1 · From prompt to tool14 / 51

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.

Speaker notes · 40 seconds

Start with the cloud agent people may already use. Show the same arrangement on a laptop or workstation, then follow the model’s file request through OpenCode’s permission check and back to Ollama.

Read the worked example in the full guide

Further reading

Part 1 · From prompt to tool15 / 51

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.

Speaker notes · 25 seconds

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.

Read the worked example in the full guide

Further reading

Part 2 · Running locally16 / 51

Running a model locally

Which model suits the task?

  1. Up nextModel choice
  2. LaterWeights & context
  3. LaterMemory placement
  4. LaterPerformance
Speaker notes · 8 seconds

Which model suits the task?

Part 2 · Running locally17 / 51

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.

Speaker notes · 18 seconds

Use the scale animation to show how quickly parameter counts become a storage problem. A parameter count only turns into a memory estimate once we choose the precision.

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—

Read the worked example in the full guide

Further reading

Part 2 · Running locally18 / 51

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.

Speaker notes · 28 seconds

Compare the four models by the jobs they suit. Keep Qwen for dense coding, Muse for quick visual assistance, and Flash-Next for more demanding code. Inkling 2 Mini adds coding and vision with a looped model. Compare them at the same 64K OpenCode context. A single Q8_0 cache is about 0.47 GiB for Muse, 1.15 GiB for Inkling and 2.125 GiB for Qwen3.8-27B. The runtime also needs space to process the prompt.

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

Read the worked example in the full guide

Further reading

Part 2 · Running locally19 / 51

Running a model locally

How much memory will the conversation need?

  1. CoveredModel choice
  2. Up nextWeights & context
  3. LaterMemory placement
  4. LaterPerformance
Speaker notes · 7 seconds

How much memory will the conversation need?

Part 2 · Running locally20 / 51

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?

Speaker notes · 24 seconds

Point first to the fixed weight allocation, then to the cache growing with the prompt. Use the final total as the starting point for the same model on a smaller machine.

Read the worked example in the full guide

Further reading

Part 2 · Running locally21 / 51

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?

Speaker notes · 16 seconds

Carry the example into a 32 GiB local budget. The question for the next slides is which parts of that budget can change.

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

Read the worked example in the full guide

Further reading

Part 2 · Running locally22 / 51

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.

Speaker notes · 33 seconds

Keep the highlighted weights in view as the representation changes. Read the 4-bit budget once. The narrowing set of values at 2 bits makes the precision trade-off visible.

Read the worked example in the full guide

Further reading

Part 2 · Running locally23 / 51

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.

Speaker notes · 45 seconds

Now hold the weights fixed. Extend the history, show which layers retain it, then lower cache precision. Pause at the first configuration that fits the example budget.

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

Read the worked example in the full guide

Further reading

Part 2 · Running locally24 / 51

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.

Speaker notes · 28 seconds

Distinguish sharing history across attention heads, retaining a recent window, and storing a fixed-size recurrent state. Point to what disappears and what is retained in each picture.

Read the worked example in the full guide

Further reading

Part 2 · Running locally25 / 51

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.

Speaker notes · 28 seconds

Part 2 · Running locally26 / 51

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.

Speaker notes · 17 seconds

Part 2 · Running locally27 / 51

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.

Speaker notes · 16 seconds

Use the two reported comparisons to explain why the smallest file still needs a task-specific check. The percentages refer to the different evaluations named on the figure.

Read the worked example in the full guide

Further reading

Part 2 · Running locally28 / 51

Running a model locally

Where will the weights live?

  1. CoveredModel choice
  2. CoveredWeights & context
  3. Up nextMemory placement
  4. LaterPerformance
Speaker notes · 7 seconds

Where will the weights live?

Part 2 · Running locally29 / 51

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.

Speaker notes · 26 seconds

Follow the same data in a unified pool and then across separate system memory and VRAM. The transfer path matters whenever the working set extends beyond fast memory.

Read the worked example in the full guide

Further reading

Part 2 · Running locally30 / 51

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.

Speaker notes · 36 seconds

Compare keeping weights resident with expert caching and SSD streaming. Trace SSD through system RAM to VRAM on a discrete GPU, then trace SSD to the unified pool on Apple silicon.

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

Read the worked example in the full guide

Further reading

Part 2 · Running locally31 / 51

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.

Speaker notes · 20 seconds

Part 2 · Running locally32 / 51

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.

Speaker notes · 23 seconds

Part 2 · Running locally33 / 51

Running a model locally

What limits speed on this machine?

  1. CoveredModel choice
  2. CoveredWeights & context
  3. CoveredMemory placement
  4. Up nextPerformance
Speaker notes · 7 seconds

What limits speed on this machine?

Part 2 · Running locally34 / 51

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.

Speaker notes · 18 seconds

Part 2 · Running locally35 / 51

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.

Speaker notes · 29 seconds

Follow a proposed block through the main model’s verification step. An accepted prefix advances generation. The first rejection determines where drafting resumes.

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.

Read the worked example in the full guide

Further reading

Part 2 · Running locally36 / 51

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.

Speaker notes · 21 seconds

Use the checklist as a reference. Point to one setting to sweep, the wait for the first token, and a task-level check. The panel also records peak memory, decode speed and failures.

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.

Read the worked example in the full guide

Further reading

Part 2 · Running locally37 / 51

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.

Speaker notes · 25 seconds

Use 64K as the starting point for one OpenCode agent session. At 64K, Inkling needs about 1.15 GiB for Q8_0 KV, between Muse at 0.47 GiB and Qwen at 2.125 GiB. On a 16 GB laptop, test the Q2 weights. On 24 GB, test Q4. A 32 GB machine gives the runtime more headroom. Check peak memory and prompt speed with a long prompt because the attention backend can change when the cache format changes.

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.

Read the worked example in the full guide

Further reading

Part 3 · My research workflow38 / 51

A longer research task

What can the agent do while I’m away?

  1. Up nextScope & access
  2. LaterCheckpoints
  3. LaterReproducibility
  4. LaterReview
Speaker notes · 8 seconds

What can the agent do while I’m away?

Part 3 · My research workflow39 / 51

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.

Speaker notes · 22 seconds

Compare an interactive coding session, editor-based review, and ongoing assistant work. The choice depends on which decisions I want to make while the agent works.

Read the worked example in the full guide

Further reading

Part 3 · My research workflow40 / 51

Before I step away

I agree on the goal, access and stopping point before a longer run.

  1. Expected behavior
  2. Allowed access
  3. Pause condition
  4. Evidence to return

For a longer task I specify the change I want, the files and tools the agent may use, and the evidence I want back. I set a checkpoint where an assumption could change the scientific meaning of the work.

Speaker notes · 56 seconds

For example, ask for a time-shifted control that preserves missing observations. Let the agent work on a branch against a small sample. Ask it to pause if aligning the tracks requires a decision about gaps or changes to the input data. I can step away during implementation and return to a proposed change, a test result and an output I can inspect.

Further reading

Part 3 · My research workflow41 / 51

A longer research task

When should I check in?

  1. CoveredScope & access
  2. Up nextCheckpoints
  3. LaterReproducibility
  4. LaterReview
Speaker notes · 7 seconds

When should I check in?

Part 3 · My research workflow42 / 51

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.

Speaker notes · 32 seconds

Follow the growing tool history into compaction. I keep commands, decisions and exact changes with the project so the agent can recover details after the conversation has been summarized.

Read the worked example in the full guide

Further reading

Part 3 · My research workflow43 / 51

A longer research task

Could someone else rerun this result?

  1. CoveredScope & access
  2. CoveredCheckpoints
  3. Up nextReproducibility
  4. LaterReview
Speaker notes · 7 seconds

Could someone else rerun this result?

Part 3 · My research workflow44 / 51

Could a colleague rerun this?

A clean rerun tests whether the setup is actually reusable.

  1. Environment, input, command
  2. Clean setup
  3. Independent rerun
  4. Compare outputs

Ask an agent to capture the software environment, a small known input, and one command that produces the output. Then try that command in a fresh environment and compare the output with an agreed expectation.

Speaker notes · 47 seconds

A useful handoff is a runnable project. Have the agent record software versions, how to obtain the input and any relevant seed or tolerance. Keep those records with the code. A fresh checkout can reveal a missing dependency or a file that only existed in the original working directory. A matching rerun establishes repeatability for that case. The scientific assumption still needs review.

Further reading

Part 3 · My research workflow45 / 51

A longer research task

Does the change answer the research question?

  1. CoveredScope & access
  2. CoveredCheckpoints
  3. CoveredReproducibility
  4. Up nextReview
Speaker notes · 7 seconds

Does the change answer the research question?

Part 3 · My research workflow46 / 51

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.

Speaker notes · 47 seconds

Follow one change through a failing regression test, a passing fix, and the same command in continuous integration. Version control and a small pull request make the change inspectable even on a one-off project.

Read the worked example in the full guide

Further reading

Part 3 · My research workflow47 / 51

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.

Speaker notes · 43 seconds

Focus on the judgment call. A passing test can encode the wrong assumption. Inspect the change and a sample output before deciding whether to merge or ask for a revision.

Read the worked example in the full guide

Further reading

Part 3 · My research workflow48 / 51

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.

Speaker notes · 12 seconds

Return once to the opening picture. A change that runs and passes its tests is ready for scientific interpretation. What does the control let us distinguish?

Read the worked example in the full guide

Further reading

Part 3 · My research workflow49 / 51

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.

Speaker notes · 12 seconds

The guide includes a setup prompt you can take away. Start with a task whose result you already know how to check.

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.

Read the worked example in the full guide

Further reading

Part 3 · My research workflow50 / 51

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.

Speaker notes · 15 seconds

Part 3 · My research workflow51 / 51

A regular AI meetup for the group?

What would be worth comparing at a regular meeting?

  1. My current setup
  2. A tool you tried
  3. What you learned
  4. A regular group meetup?

I’m one researcher still figuring this out. I’d like to hear which tasks people in the group have tried, what held up, and whether meeting regularly would help us learn from each other.

Speaker notes · 90 seconds

Give the floor to the group for the final 90 seconds. Invite one experience that worked and one that fell short. Ask whether people would like a regular AI meetup and what they’d bring to the first one. I’d be happy to help organize it.

Copy the setup prompt