Instructions to use Loke-60000/qwomputer-9b-exp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Loke-60000/qwomputer-9b-exp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Loke-60000/qwomputer-9b-exp") 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("Loke-60000/qwomputer-9b-exp") model = AutoModelForCausalLM.from_pretrained("Loke-60000/qwomputer-9b-exp", 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 Loke-60000/qwomputer-9b-exp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Loke-60000/qwomputer-9b-exp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Loke-60000/qwomputer-9b-exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Loke-60000/qwomputer-9b-exp
- SGLang
How to use Loke-60000/qwomputer-9b-exp 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 "Loke-60000/qwomputer-9b-exp" \ --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": "Loke-60000/qwomputer-9b-exp", "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 "Loke-60000/qwomputer-9b-exp" \ --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": "Loke-60000/qwomputer-9b-exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Loke-60000/qwomputer-9b-exp with Docker Model Runner:
docker model run hf.co/Loke-60000/qwomputer-9b-exp
Qwomputer 9B (experimental)
Qwen3.5-9B with a RISC-V computer compiled into the weights.
When Qwen uses its calc tool, it's not Python or a sandbox that's giving you the answer.
It's a 32-bit RV32IM CPU running in the model's own forward passes, precisely.
This is the Qwenputer machine from divagr1925 ported to 9B.
No weights for the computer were trained. They're all calculated by a compiler.
Qwen's weights are untouched.
I built this out of curiosity, to see if a bigger model still gets much out of the built-in computer, or if it's already good enough at arithmetic not to need it.
This is an experiment. The computer only runs inside Qwenputer's own decoding loop (
RvChat, see Usage). Plaingenerate()loads the model but won't give you the machine's answers.
Benchmarks
- The in-weights computer gives 35 more points to 9B (162->197/200). 49 more points to 4B (143->192). The largest gain is for big multiplications. 30->40 for 9B. 19->39 for 4B. Long
mul_divchains are already good on the base models (34,38), so not much gain. - All computer responses were exact (0 lockstep errors, 0 head mismatches vs reference RISC-V machine). 1,020 tool calls, 4.9M tokens of machine.
- The larger model is more effective at using the tool. The 4B model tends to double-check its own answer a lot, repeatedly calling
calc(164 calls for 40 synthetic problems). The 9B model tends to call once and give an answer (41 calls). It's 1.8-3.9x faster per problem for 4 of the 5 sets. - 9B's misses are Qwen's (not the machine's) - 2 long re-call loops on
div_big, 1 longmul_divexpression Qwen broke up and set up incorrectly (but the machine got all the pieces right) - The 9B base tends to return rounded decimal (instead of the exact fraction) for
div_bigso that's why it is worse than 4B base in there.
What's different from the 4B
How the machine works is documented in the
Qwenputer repo. This build uses
the same compiler and the same calc firmware. Only the parts that depend on the base model change:
- 11 chip layers in front of Qwen3.5-9B's 32 layers.
- The hidden size goes from 4096 to 5632 to make room for the circuit.
- The 9B has its own output head (the 4B ties it to the embeddings). It keeps Qwen's weights and gets the circuit's readout columns.
| Qwen3.5-9B | Qwomputer 9B | |
|---|---|---|
| Layers | 32 | 11 chip + 32 |
| Hidden size | 4096 | 5632 |
| Vocabulary | 248,320 | 478,656 |
| Stored parameters | 9.0B | 18.2B (mostly zero padding) |
| Checkpoint (bf16) | 19 GB | 36.4 GB |
This is a new build with Qwenputer's compiler, streamed to fit in 13GB of RAM. The published 4B Qwenputer built the same way is 572/580 tensors bit identical. The remaining 8 are GPU-fitted and off by one bf16 step.
Usage
The computer runs inside Qwenputer's decoding loop, RvChat. It loads the calc firmware
into the machine, then decodes the machine's tokens and the text in lockstep. Clone the code, install it,
and run the example below from qwenputer/experimental/riscv:
git clone https://github.com/divagr18/qwenputer
cd qwenputer/experimental/riscv && uv sync --extra hf
lowmem.py and w8.py in this repo load the model into ~10 GiB of GPU memory:
- Dense chip layers are not used, instead, the decoding loop uses the exact fp32 Triton executor for the circuit.
- The zero padding is dropped.
- Qwen's linear layers are int8 weight-only.
import sys
from huggingface_hub import snapshot_download
path = snapshot_download("Loke-60000/qwomputer-9b-exp")
sys.path.insert(0, path) # lowmem.py and w8.py ship with the model
from chipformer.rv import bridge as BR, elf, ref
from lowmem import LowRvChat
chat = LowRvChat(path)
machine = ref.Machine.from_program(elf.program("tests/data/rv/calc-bridge.elf"))
BR.park(machine)
ids = chat.prompt_ids([{"role": "user", "content": "Use calc: what is 123456789 * 987654321?"}])
out = chat.generate(ids, machine, max_new=600)
print(chat.text_of(out["tokens"]))
# ... <tool_response>121932631112635269</tool_response> ...
# The product of 123456789 and 987654321 is **121,932,631,112,635,269**.
Greedy decode. Disable thinking. The system prompt for Qwen to use the tool every time is in chipformer/rv/evalarith.py (NUDGE).
Limitations
- It makes arithmetic exact, not reasoning better. Word problems are still up to Qwen.
- Qwen sometimes calls
calcagain on an answer it already has, and can loop until it runs out of tokens. - Each call adds hundreds to thousands of machine tokens to the cache (about 2,300 for a big product).
- The benchmarks are small: 40 problems per set, run with int8 Qwen layers.
License
Apache-2.0 (same for base model Qwen/Qwen3.5-9B and Qwenputer weights). MIT for Qwenputer compiler and decoding code (from divagr18). This is a derivative of both Qwen weights and Qwenputer-compiled circuit. See LICENSE.
- Downloads last month
- 433

