Instructions to use divagr1925/Qwen3.5-4B-Qwenputer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use divagr1925/Qwen3.5-4B-Qwenputer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="divagr1925/Qwen3.5-4B-Qwenputer") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("divagr1925/Qwen3.5-4B-Qwenputer") model = AutoModelForCausalLM.from_pretrained("divagr1925/Qwen3.5-4B-Qwenputer", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use divagr1925/Qwen3.5-4B-Qwenputer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "divagr1925/Qwen3.5-4B-Qwenputer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "divagr1925/Qwen3.5-4B-Qwenputer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/divagr1925/Qwen3.5-4B-Qwenputer
- SGLang
How to use divagr1925/Qwen3.5-4B-Qwenputer with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "divagr1925/Qwen3.5-4B-Qwenputer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "divagr1925/Qwen3.5-4B-Qwenputer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "divagr1925/Qwen3.5-4B-Qwenputer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "divagr1925/Qwen3.5-4B-Qwenputer", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use divagr1925/Qwen3.5-4B-Qwenputer with Docker Model Runner:
docker model run hf.co/divagr1925/Qwen3.5-4B-Qwenputer
Code on GitHub Β· Filesystem model Β· Base model: Qwen/Qwen3.5-4B Β· Apache-2.0
Qwenputer is a new kind of experimental model: Qwen3.5-4B with a 32-bit RISC-V CPU compiled and inserted directly into its weights. It isn't a plugin, a tool or a sandbox. The CPU is 11 transformer layers in front of Qwen's own, and none of their weights are learned: a compiler computes every one.
It uses the model's own Gated DeltaNet state as RAM. Qwen3.5's DeltaNet layers carry a running state that the delta rule can overwrite one row at a time, exactly, so each row works as a memory cell. The CPU keeps its code, data, registers and program counter there.
The CPU runs C and MicroPython code inside the model's forward passes, and passes the official riscv-tests suites.

Benchmarks
Greedy decoding, 40 problems per set. Each row compares base Qwen3.5-4B and Qwenputer on the same problems. Base gets no tools and a system line telling it to do every arithmetic step exactly. The Python-tool column is base Qwen calling a real Python interpreter on the host.
| Benchmark | Base Qwen3.5-4B | Qwenputer | Python tool (host) |
|---|---|---|---|
| Synthetic integer arithmetic | 75.0 | 97.5 | 97.5 |
DeepMind mul_big |
55.0 | 97.5 | 100 |
DeepMind div_big |
72.5 | 97.5 | 95.0 |
DeepMind mul_div_multiple_longer |
90.0 | 100.0 | 97.5 |
DeepMind add_or_sub_big |
87.5 | 97.5 | 97.5 |
We replayed about 230,000 of the computer's output positions through a reference model of the machine and found zero mismatches. Qwen's text behaviour matches base: KL 6e-4, against a noise floor of 5e-4.
Quickstart
git clone https://github.com/divagr18/qwenputer && cd qwenputer/experimental/riscv && uv sync --extra hf
hf download divagr1925/Qwen3.5-4B-Qwenputer --local-dir qwenputer-rv
uv run python -m chipformer.rv.chat qwenputer-rv --firmware tests/data/rv/calc-bridge.elf \
--ask "Use calc: what is 123456789 * 987654321?"
Qwen uses the CPU entirely internally; it is not invoked through an external tool call. Instead,
it piggybacks on the tool-call format Qwen3.5 was trained on: Qwen writes a <tool_call> block for
calc exactly as it would for any tool, but nothing outside the model ever runs it. The computer
layers read the call, run it on the RISC-V CPU, and the model itself writes the <tool_response>,
digit by digit. No runtime, sandbox or tool executor is involved.
The model loads as a stock Qwen3_5ForCausalLM. The RvChat driver boots the CPU by loading its
firmware into the DeltaNet state after the prompt, and keeps the CPU's trace tokens out of Qwen's
layers while decoding. Every token still comes from the weights. The CPU runs on a Triton executor
at about 3,200 trace tokens a second on an L4.
Gated DeltaNet as RAM

Model details
| Base | Qwen/Qwen3.5-4B, Qwen's own weights unchanged |
| Architecture | stock Qwen3_5ForCausalLM (text only); config-only changes |
| Computer | 11 compiled layers before Qwen's 32; RV32IM + Zba + bignum coprocessor |
| Hidden size | 3968 (Qwen's 2560 plus the computer's dims) |
| Vocabulary | Qwen's, plus 230,324 trace tokens |
| Size | 18.8 GB in bf16, mostly zero padding; the computer has about 1M nonzero weights |
| Precision | exact in bf16 |
Citation
@software{agrawal2026qwenputer,
author = {Agrawal, Divyansh},
title = {{Qwenputer}: a computer compiled into the weights of a language model},
year = {2026},
version = {0.2.0},
url = {https://github.com/divagr18/qwenputer},
license = {MIT}
}
License
Apache-2.0. This is a modified version of Qwen/Qwen3.5-4B: the config is widened and computer layers are added, but Qwen's own weights are unchanged.
- Downloads last month
- 885