Manuel Herrador Muñoz, PhD

Offtoco — count GPT, Claude and Gemini tokens offline for web/CLI/desktop

I built Offtoco (https://github.com/PacifAIst/Offtoco) — a zero-knowledge offline token counter for GPT, Claude and Gemini

Tired of pasting prompts into online token counters that send your text to a server you don't control? I built Offtoco to fix that. It counts tokens for GPT (o200k_base), Claude and Gemini simultaneously, gives you a SHA-256 fingerprint of your text, and does all of it 100% locally — no API calls, no telemetry, no internet required after download.

It ships three ways:

  • Web app — unzip, open index.html in any browser. Works on a USB stick, an air-gapped machine, or any static server. No Node.js required.

  • CLI — standalone executables for Windows, Linux and macOS (~90 MB, no dependencies). Pipe text, pass files, get JSON output for scripting.

  • Windows desktop — system tray app with Explorer right-click integration. Right-click any file → token count popup instantly.

The interesting technical bit: the official Claude tokenizer ships a WASM binary that browsers reject. Instead of adding a plugin, I extract the raw BPE vocabulary at install time and run it through the same pure-JS engine as GPT — counts are bit-for-bit identical, zero WASM anywhere.

GPL-3.0. Everything in the repo, audit it yourself.

4 views

Add a comment

Replies

Be the first to comment