npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cooljapan/oxillama

v0.1.3

Published

WebAssembly bindings for OxiLLaMa GGUF parsing and quantization

Readme

oxillama-wasm

WebAssembly bindings for OxiLLaMa — GGUF parsing and LLM inference in the browser.

Part of the OxiLLaMa workspace — a Pure Rust LLM inference engine.

What It Provides

  • GGUF metadata and tensor catalogue parsing from a Uint8Array in the browser
  • Typed metadata export via parseGgufMetadata() returning a GgufMetadataJs object (arch, context_length, embedding_length, etc.)
  • Full text generation via oxillama-runtime (behind the inference feature) with optional per-token onToken callback
  • K-quant dequantization bindings: dequantQ4_0, dequantQ4K, dequantQ5K, dequantQ6K
  • Model loading with progress callbacks: loadModelFromBytesWithProgress(bytes, onProgress)
  • WebGPU async bridge: initWebGpuDevice(), webgpuDequantQ4_0Async(), webgpuGemvAsync()
  • IndexedDB model cache: cacheModel(), loadCachedModel(), listCachedModels(), deleteCachedModel()
  • Streaming GGUF load via GgufChunkLoader for incremental byte feeds
  • Web-worker message-passing API: parseWorkerMessage() / workerTokenEvent()
  • Pure-Rust tokenizer backend (fancy-regex, no Oniguruma C library) — safe for wasm32-unknown-unknown
  • No SIMD rayon threads — single-threaded, browser-compatible; SIMD128 proposal enabled at compile time

Status

Version: 0.1.2 — Tests: 51 passing

Feature Flags

| Feature | Default | Description | |---------|---------|-------------| | inference | yes | Include oxillama-runtime for full generation | | console_error_panic_hook | yes | Pretty panic messages in the browser console |

Build

# Install wasm-pack once
cargo install wasm-pack

# Build for the browser (ES module)
wasm-pack build --release --target web -p oxillama-wasm

# Output lands in pkg/
# oxillama_wasm.js    — JS glue
# oxillama_wasm_bg.wasm — compiled WebAssembly

Usage (JavaScript)

import init, {
  parseGgufHeader, parseGgufMetadata, listTensorNames,
  dequantQ4_0, dequantQ4K, dequantQ5K, dequantQ6K,
  loadModelFromBytesWithProgress, WasmEngine,
} from "./pkg/oxillama_wasm.js";

await init();

// Fetch and parse GGUF metadata (no weights loaded)
const resp   = await fetch("/models/llama-3.2-1b.Q4_K_M.gguf");
const bytes  = new Uint8Array(await resp.arrayBuffer());
const header = parseGgufHeader(bytes);
const meta   = parseGgufMetadata(bytes);
console.log("arch:", meta.arch, "context:", meta.context_length);
console.log("tensors:", listTensorNames(bytes));

// Load model with progress callback (requires `inference` feature)
const engine = await loadModelFromBytesWithProgress(bytes, (pct) => {
  console.log(`loading: ${pct}%`);
});

// Generate text with per-token streaming
const output = engine.generate("Hello, world!", 128, 0.8, (token) => {
  process.stdout.write(token);
});
console.log(output);

// IndexedDB cache — persist across reloads
await cacheModel("llama-3b", bytes);
const cached = await loadCachedModel("llama-3b");

// WebGPU acceleration (where supported)
await initWebGpuDevice();
const result = await webgpuDequantQ4_0Async(quantizedBlock);

License

Apache-2.0 — COOLJAPAN OU (Team Kitasan)