Instructions to use jgalego/olmputer-tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jgalego/olmputer-tiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jgalego/olmputer-tiny")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jgalego/olmputer-tiny") model = AutoModelForCausalLM.from_pretrained("jgalego/olmputer-tiny", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jgalego/olmputer-tiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jgalego/olmputer-tiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jgalego/olmputer-tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jgalego/olmputer-tiny
- SGLang
How to use jgalego/olmputer-tiny 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 "jgalego/olmputer-tiny" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jgalego/olmputer-tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "jgalego/olmputer-tiny" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jgalego/olmputer-tiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jgalego/olmputer-tiny with Docker Model Runner:
docker model run hf.co/jgalego/olmputer-tiny
olmputer-tiny
A RISC-V computer (RV32IM + Zba) compiled into the layers of a stock OlmoHybridForCausalLM. No weight is trained: a compiler computes all of them. The code ROM, data ROM, RAM and registers live in the recurrent state of the Gated DeltaNet layers, and the model runs a program by greedy decoding: every token it generates is the next token of the CPU's execution trace.
This is the standalone half of Olmputer, which puts the same layers in front of allenai/Olmo-Hybrid-Instruct-DPO-7B so that OLMo's calc tool calls run on the CPU inside its weights. It ports Qwenputer, which does this with Qwen3.5-4B, to OLMo-Hybrid's head shapes. The compiler is the chipformer package of JGalego/olmputer.
Uses the architecture and head shapes of Ai2's OLMo-Hybrid, none of its weights; not affiliated with or endorsed by Ai2.
The machine
| ISA | RV32IM + Zba, plus bignum digit-file instructions |
| Code ROM | 256 KB |
| Data ROM | 128 KB, read-only |
| RAM | 32 KB |
| Layers | 11 Gated DeltaNet + SwiGLU layers, plus the zero attention layer HF's cache needs |
| Shapes | OLMo-Hybrid-7B's: 30 heads of 96 × 192 a layer, MLP 11,008 wide; hidden 2,816 |
| Parameters | 3.13B, almost all zero |
| Vocabulary | the trace tokens (values in 15-bit chunks, jumps, stores, putchar, ...) plus PAD |
Qwen3.5-4B's heads are 128 × 128, two value heads per key head; OLMo's are 96 × 192, one each. The changes that keep every read exact:
- A state row's ballast sits in 3 of its 192 columns (Qwen: 2 of 128), so the gated output norm divides by the same power of 2.
- The code and data ROMs hold bytes, and a byte read needs a power-of-2 query scale. OLMo's 96^-0.5 is not one, so the selected row's query is padded with four rows that are never written (weights 3 : 3, 2, 1, 1), which makes the scale exactly 1/16.
- Write gates use OLMo's β = 2 sigmoid(b): b = 0 writes, b ≤ -256 does not.
- ROM rows hold 32 words instead of 8, so the 256 KB ROM fits one layer's 30 heads; the RAM, one word a row, takes three layers.
Checks
For each program, the machine's trace from a reference RISC-V emulator is the target:
- the residual stream after the chip layers equals the circuit's IR evaluator on every dimension at every position (bf16; traces up to 60k tokens);
- free-running greedy
generatefrom the program's start reproduces the reference trace token for token.
| Run | Kernels | Programs | Exact | Trace tokens |
|---|---|---|---|---|
| c-qsort | torch | 1 | 1 | 240,175 |
| c-sieve-gmpmul | torch | 2 | 2 | 66,825 |
| short-fla | fla | 55 | 55 | 26,677 |
| short-torch | torch | 55 | 55 | 26,677 |
A run, from an ELF to the HALT token:
Usage
example.py runs fibonacci(25) on olmo-tiny: greedy generate runs the CPU, and the result is read from the trace the model wrote. It is a uv script that declares its own dependencies:
uv run https://huggingface.co/jgalego/olmputer-tiny/resolve/main/example.py
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "chipformer @ https://github.com/JGalego/olmputer/archive/98639dff4c84a18542e3ca12a286a4df563b3a27.tar.gz#subdirectory=experimental/riscv", # pylint: disable=line-too-long
# "huggingface_hub",
# "torch==2.14.1",
# "transformers==5.19.0",
# ]
# ///
"""Run a RISC-V program on olmo-tiny: fibonacci(25), computed by the computer in its weights.
The program's code and registers are written into the model's Gated DeltaNet states; greedy
generate then runs the CPU, every generated token being the next token of its execution trace.
The program ends with mv a0, t0 (fibonacci(25)), li a7, 93 and the exit ecall, so the result is
the value of the second-to-last value record the model wrote.
"""
import torch
from chipformer.q35.ir import OLMO
from chipformer.rv import core, firmware, ref, spec
from chipformer.rv.programs import program
from transformers import OlmoHybridForCausalLM
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
MODEL = OlmoHybridForCausalLM.from_pretrained("jgalego/olmputer-tiny", dtype=torch.bfloat16)
MODEL = MODEL.to(DEVICE).eval()
CIRCUIT = core.build(OLMO) # the CPU as a circuit: it writes the program into the model's cache
TRACE = firmware.run(MODEL, CIRCUIT, ref.Machine.from_program(program("fib")))
VALUES = [spec.decode_value(TRACE[:i + 1]) for i, t in enumerate(TRACE)
if spec.family(t)[0] in ("F0", "F1", "F2")]
print("fibonacci(25) =", VALUES[-2])
print(f"{len(TRACE)} trace tokens on {DEVICE}, identical to the reference machine:",
TRACE == ref.Machine.from_program(program("fib")).run()[1:])
A GPU takes under a minute; a CPU works too, more slowly. firmware.run loads the program's ROM, RAM and registers into the linear-attention layers' recurrent states after a one-token prefix, starts the CPU with GO and decodes greedily until HALT.
- Downloads last month
- -


