Repository navigation
ruNNtime v0.4.0: runntime/core beta preview 🧱
This release, runntime/core ships as a beta preview: the graph ops, PyTorch-style nn modules and the safetensors loader every zoo model is built from. Use it to run a model the zoo doesn't have, or your own fine-tune.
import { add, initRunntime, matmul, tensor, toArray } from 'runntime/core';
import tgpu from 'typegpu';
initRunntime(await tgpu.init({ device: { optionalFeatures: ['subgroups', 'shader-f16'] } }));
const x = tensor(new Float32Array([1, 2, 3, 4]), [2, 2]);
const w = tensor(new Float32Array([1, 0, 0, 1]), [2, 2]);
console.log(await toArray(add(matmul(x, w), 1)));Point your coding agent at the following sources:
src/zoo: every zoo model, built on core. Pick the one closest to yours (a transformer encoder, a decoder, a conv net, an audio codec) and have the agent follow it: the modules, the load hooks that map a checkpoint onto them, the runner around them.AGENTS.mdand.claude/skills: the rules the engine is built on, plus how we write and test kernels and models. Agents that read them write code that runs fast and doesn't leak.
Then have some fun!
Beta preview. The core API may change between minor versions. Pin a minor version if you depend on it.
Docs: Core, Getting started. Thanks to @maciekstosio for the first version of that page!
Run your own weights
Every zoo model loads one .safetensors file, and now so does yours. Export a fine-tune as is, or quantize it to int8 or int4 with our Python tool, and load it with any create*():
uv run runntime quantize model.safetensors model.int4.safetensors --bits 4The quantizer works on any checkpoint: it quantizes every float weight in the checkpoint's own layout, and the runtime loads what no quantized kernel runs as float. Docs: Exporting weights.
Performance
- Faster warm-up. Models compile their GPU pipelines asynchronously during load, one task each, instead of blocking the main thread.
- f16 conversion is native. Reading back and uploading f16 data goes through
Float16Array: a[4096, 384]f16 readback no longer spends ~17 ms decoding in JS. - EmbeddingGemma 2 audio on long clips. The audio subsample now runs on real convs: 1635 → 360 µs on 10 s of audio, 4012 → 1014 µs on 30 s.
Fixes
- Letterbox matches ultralytics. Resized images now sit on whole pixels, so object detection, segmentation and pose see the same input as the PyTorch reference.
- AMD GPUs. Integer division in the kernels compiled to f32 division, which came out one too low on some AMD GPUs, small shapes included. Fixed everywhere.
- Reverb re-masks codes the way the released
reverb-ttsdoes, and keeps only speech frames when you passverbalize. - Privacy filter no longer leaks GPU memory between
detect()calls, and a call that throws no longer breaks the next one.
Also in this release
- Parity tests against PyTorch for 8 zoo models (all but YOLO26), so a kernel change that moves an output fails a test.
- Hub download counts. Loading a hosted model sends one HEAD request to its
config.json, so the model pages show real download numbers. Cached loads send nothing, and a failed request never fails a load. - A new landing page, with a neural network drawn by a TypeGPU shader.
Breaking changes
None for runntime/zoo.
Model coverage
Unchanged since v0.3.0: 19 models across 9 tasks. See the docs for the full table.