Skip to content

The Engine Refactor

Pre-release
Pre-release

Choose a tag to compare

@qwatts-dev qwatts-dev released this 22 Feb 19:45
cd0ded3

This release transforms the procedural WebGPU proof-of-concept into a clean, object-oriented JavaScript library — now branded as bitnet.js.

Highlights

  • ~200 ms/token on MacBook Pro M2 Max (~5 tok/s, 300 GPU dispatches per token)
  • Coherent, grammatically correct English output through all 30 transformer layers

Architectural Changes

  • BitNetEngine class — encapsulates all WebGPU state, tokenizer, KV cache, and generation loop into a single class with a clean public API: init(), generate(), reset()
  • Renamed to bitnet.js — file, package name, and all branding updated to reflect library-grade positioning
  • npm run setup — one-command model extraction via scripts/setup_model.py master orchestrator
  • npm start — launches the local dev server

Repository Hygiene

  • Moved all 9 Python extraction scripts into scripts/
  • Centralized all model assets into weights/ (embeddings, LM head, vocab map, ternary weights, norms, scales)
  • Deleted stale root-level binaries (sparse_embeddings.bin, sparse_lm_head.bin, vocab_map.json)
  • Added __pycache__/ to .gitignore

Documentation

  • README fully rewritten: updated Quick Start, project structure, benchmarks section, npm scripts
  • docs/TESTING.md — test suite documentation extracted into dedicated file
  • package.json — license corrected to MIT, keywords updated, description refreshed