LLMs and agents
8 minutes · Hardware development with agentic AI

How AI models and agents actually work

Language models, the loop that makes them agents, and the harness in between. And why firmware and hardware are a good fit.

Jørgen · IC Works · 17 November 2026
SayEight short parts: how a model works, what it is good and bad at, why code is easier, tool calling, agents, why we leave the browser, harnesses, and which model to pick. All of it seen from the bench: firmware, HDL and boards.
1 · How a model works

It predicts the next word

Pre-trained on a huge amount of textBooks, websites, code. Weeks on thousands of chips
Guesses what comes nextPicks one word, adds it, asks again
Tuned into an assistantHuman ratings nudge it toward helpful, honest, safe answers
No database of facts insideA knowledge cutoff, and a context window as working memory
SayA model is pattern knowledge squeezed into billions of numbers. Pre-training teaches it to guess the next word on a vast amount of text, and word after word, that is how a whole answer appears. Tuning with human ratings turns that text predictor into an assistant. But there is no database inside: it has a cutoff date and only sees what fits in its context window. That is why it can sound sure and still be wrong.
2 · Strengths and weaknesses

Great with language, shaky with facts

Good at
Drafting and rewritingDocs, comments, commit messages
Translating and summarisingA 900-page datasheet down to what you need
Explaining and writing codeC, Rust, Verilog, Python, build scripts
Weak at
Exact numbers and arithmetic→ fixed by tools that calculate
Anything after its cutoff→ fixed by tools that look it up
Admitting it does not know→ fixed by a loop that checks the result
SayStrong at language, weak at exactness. In hardware that shows up as an invented register bit or a pin from a datasheet it half remembers. Each weakness has a fix, and the next slides show them: tools that calculate and look things up, and a loop that checks instead of trusting.
3 · Why code is easier

Prose is open. Code is narrow.

You type
WriteaGofunctionthataddstwonumbers
The model writes, one token at a time
funcadd(a,bint)int{returna+b}
Thousands of sensible next words after “The board”
A handful of valid next tokens after func add(a, b int)
SayText is cut into tokens, small pieces of words. After each token the model picks the next one. The vocabulary is the same for English and code, about a hundred thousand tokens. What differs is how many make sense next. After "The board" thousands of words fit. After func add, open bracket, a, b int, close bracket, the grammar leaves a handful: a return type or a brace. Go has only twenty-five keywords. The split shown is illustrative. The same holds for C, Verilog or VHDL. And you can compile, simulate and test the result.
4 · Tool calling

Tools are a tiny language you can check

1 · Model writes
{"tool": "bash",
 "command": "make sim"}
2 · Harness checks, runs
Valid JSON? Known tool?
Right arguments?
Then run it.
3 · Result goes back
FAIL: tb_uart.v:42
rx=0x00, want 0x55
exit code 1
Few wordsA handful of tools, each with a fixed shape
Checked on syntaxA malformed call is rejected before it runs
Checked by runningCompiler, simulator or the board says if it worked
SayTool calling is the same trick as code. The model does not click or type, it writes a small structured message from a very limited vocabulary: which tool, which arguments. The harness can check the syntax against the tool definition, reject it if it is malformed, and otherwise run it. In hardware the check is a compiler, a simulator testbench, or flashing the board and reading the serial log. The exit code and output tell you whether it worked, and that result goes straight back to the model, which fixes the error and tries again.
5 · Agents

A model in a loop with tools

Goal
You say what you want
Decide
Model picks the next action
Act
Edit code, build, simulate, flash, read the serial log
Observe
Result goes back in, repeat until done
Agents you can runClaude CodeCodexOpenCodePi
SayTools fix the weaknesses: it can look up facts and run real calculations instead of guessing. Four you can run today: Claude Code, Codex, OpenCode and Pi. All of them are this loop. On a board, the loop is edit, build, flash, read the log, fix.
6 · Out of the browser

From chat window to your project

Chat in the browser
You copy code in and outIt never sees the rest of your project
You run the buildPaste the error back, again and again
You get adviceThe work is still yours to do
Harness on your machine
Reads your codeSources, headers, datasheets, git history
Writes code and calls toolsEdits files, builds, simulates, flashes
Delivers the user storyFrom "as a user I want..." to working firmware
SayIn the browser you are the hands: you copy code in, paste errors back, and it only sees what you show it. A harness runs next to your project. It reads the code itself, writes the changes, calls the compiler and the tools, and checks the result. So you hand it a user story, not a question, and it works until the story is done. That is what the harness is for, so let us look inside one.
7 · Harness and model

The harness fills the context

Harness
Builds the prompt, runs the tools
Context
Prompt, files, tool results
Model
Frontier in the cloud, or local
Reply
Text or a tool call
Inside the inference engine, every turn
1TokenizeText cut into tokens, word pieces as numbers
2PrefillOne parallel pass builds the KV cache, the working memory
3DecodeOne token at a time: score every option, sample one, feed it back
4OutputText until a stop token, or a tool call for the harness
SayChoose the harness you like, then choose the model separately. The harness does the bookkeeping and sends one big query each turn. Inside the inference engine four things happen. Tokenize: the text becomes numbers. Prefill: the whole context is read in one parallel pass, building the KV cache, the model's working memory. That is why a big context is slow to start, and why prompt caching makes the next turn cheap: the harness sends almost the same context every time. Decode, called eval in llama.cpp: one token at a time, scored, sampled and fed back. Sampling is why the same prompt can give different answers. Output: the tokens become text until a stop token, or a tool call the harness parses and runs.
8 · Which model

Frontier or local

Frontier model
Anthropic Claude, OpenAI GPTBest quality, closed, cloud only
Open weight from ChinaQwen, DeepSeek, Kimi, GLM: close behind, and you can download them
Pay per token, data leavesYour code goes to someone else's server
Local model
Private, offline, free to runNothing leaves the building
Quantized: smaller numbers16-bit weights stored as 4-bit: a quarter of the memory, a little less precise
Needs a GPU, a notch weakerA 30B model at 4 bits fits in about 20 GB
SayFrontier means Claude from Anthropic and GPT from OpenAI: the best, but closed and in the cloud. Right behind them are the open-weight models from China, like Qwen, DeepSeek, Kimi and GLM. You can rent them in the cloud or download them. To run one locally you quantize it: store each weight in 4 bits instead of 16. That makes it about four times smaller and loses only a little quality, so a 30-billion-parameter model fits on one big GPU. Quality decides the outcome: use frontier. Privacy, cost, offline: use local. The harness stays the same.
Takeaways

Fast assistant, you stay responsible

Treat it as capable but uncheckedLet the compiler, simulator and board do the checking
Give it good contextDatasheets, schematics, pinouts, register maps
Close the loop with observabilitySerial logs, test results, logic analyzer: so it can see if it reached the goal
A human owns the resultReview the diff, sign off before it ships
SayClose on these four. It is fast but unchecked, so let the tools check it. Feed it the datasheets. Give it eyes on the result: logs, test output, a logic analyzer, so it can judge for itself whether it met the goal and keep going until it does. And in the end a human owns the result. Then questions.
1 / 4