QwenFX runs a coding agent on a RISC-V CPU built out of transformer layers
A compiler turns Qwen3.5-4B's own layer types into a working RV32 processor, then runs Vercel's fx agent on it one token at a time. It is slow, and it opens pull requests.
Most coding agents are ordinary programs that call a model. QwenFX, by Divyansh Agrawal, moves the ordinary program into the network too. It builds a RISC-V processor from the same kinds of layers Qwen3.5-4B is made of, runs Vercel’s fx coding agent on that processor, and has the agent call the real Qwen whenever it needs a model.
Nobody needs this. It is a careful answer to a strange question, and the README is exact about which parts run where.
How it works
The processor is not learned. According to the README, a compiler produces it: 162 layers of the two layer types Qwen3.5-4B uses, Gated DeltaNet and SwiGLU, with weights chosen so that each token advances an RV32IM machine by a step. Registers, ROM, and RAM live in the recurrent state of the DeltaNet heads.
The program is fx itself. fx is written in Zig and builds to WebAssembly; the author pushes that through wasm2c and zig cc to get a RISC-V binary of about 75.6 MB. The README says fx’s 717 source files are untouched, checked by a script against a pinned commit.
When fx needs the outside world, the chip halts on a system call and the host steps in. The host renders the chat template, tokenizes, parses tool calls, keeps the file store, and does the git work. The agent loop, the request building, and the file read and edit tools run on the chip.
Two things in the README undercut the tidiest version of the story, and the author states both. The chip and Qwen are separate sets of weights on one GPU, not one merged checkpoint; merging them would produce a file of an estimated 25 to 37 GB that is mostly zero padding. And 13 hand-built circuits replace fx’s hottest loops, such as memcpy and SHA-256, each wired to a fixed address in this exact binary.
The numbers
All of these are the author’s own, from the README.
| Measure | Figure |
|---|---|
| Chip speed on one L4 GPU | about 24,000 chip tokens per second |
| Tasks solved | 15 of 15 runs, with and without the shortcut circuits |
| Median task time with shortcuts | 249 seconds |
| Chip tokens checked against a reference emulator | about 313M, none wrong |
| Fewer chip tokens with the 13 shortcut circuits | 34.7% |
The tasks are five small bugs and features in a ten-file Python library, three runs each. The author says the runs “show the path works” and are not a measure of failure rate. Without the shortcuts, the chip accounts for 77 to 95 percent of wall time, which is the cost of emulating a CPU in matrix multiplications.
Try it yourself
The repo is MIT licensed, with the fx-derived binary under Apache 2.0. The README asks for Linux, one 24 GB NVIDIA GPU, gcc, git, uv, and about 8.4 GB of disk for Qwen3.5-4B, and puts a full run at about nine minutes on an L4 machine.
We have not run QwenFX ourselves; this is based on the README.