Skip to content

Jev directory

Jevtok TS

Offline Jev token counting and request accounting for Node.js and Next.js: an MIT TypeScript port of jevtok that matches the reconstructed encoder for jev-1.13-20260917 and ships its vocabulary inside the package — no keys, network calls or dependencies.
Stars
3
Language
TypeScript
License
MIT
Reading time
2 min
Published by
Community
Author
aarzhaev
Last verified
Oct 2026

Highlights

  • No Python, network calls, API keys, native extensions or runtime dependencies: vocabulary and lookup tables ship inside the npm package.
  • Ordinary o200k_base tokenization is not interchangeable with Jev — the word 'evidence' is three tokens and '2024' is four.
  • estimateRequestTokens computes an estimated usage.input_tokens from a state plus noul, choice or score questions and throws on budget violations.
  • ESM and CommonJS with TypeScript declarations for Node.js 22+, CI-tested on Node 22 and 24; browsers and edge runtimes are not supported.
  • A TypeScript port of LabGuy94/jevtok; getEncoding() defaults to jev-1.13 with 200,019 vocabulary entries and model version jev-1.13-20260917.

Quickstart

ts
import { getEncoding, estimateRequestTokens } from 'jevtok-ts';

const enc = getEncoding('jev-1.13');
enc.count('evidence'); // 3

const questions = {
  relevant: { type: 'noul' as const, instructions: 'Is this about software?' },
};
const inputTokens = estimateRequestTokens({ title: 'Managed Postgres' }, questions);

Watch out

Copy reviewed against the truncated repo README on 2026-10-15; the capture ends inside the API documentation, so parts of the question-cost semantics were not reviewed. Encoder parity with the upstream jevtok is the port's own claim for one specific model version.

Questions about this entry

Short answers drawn from the linked project or page.

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai