Skip to content

jevtok-ts

Offline TypeScript token counter and request-cost estimator for Jev 1.13, a port of the reconstructed jevtok encoder.

PluginbetaMIT

Overview

jevtok-ts provides offline Jev token counting and request accounting for Node.js and Next.js. It is a TypeScript port of LabGuy94's jevtok and matches its reconstructed encoder for jev-1.13-20260917. Vocabulary and lookup tables ship inside the package, so there are no Python, network calls, API keys, native extensions or runtime dependencies.

You can count, encode and decode text, get exact token byte pieces, and estimate the input tokens of a full Jev request from a state and a question map, which helps budget costs before calling the API. The README stresses that ordinary o200k_base tokenisation is not interchangeable with Jev's: for example 'evidence' is three tokens and '2024' is four. It supports ESM and CommonJS with TypeScript declarations on Node 22 or later, but not browser or Edge runtimes. It does not make decisions itself; it is infrastructure for developers managing Jev costs.

What the decision model decides

TypeQuestionAnswers
OtherHow many input tokens will this Jev request use? (estimation, not a model decision)—

How it works

  1. Install the package
  2. Get the jev-1.13 encoding
  3. Count or encode text, or estimate request tokens from state and questions
  4. Use the estimate to budget or batch requests

Strengths

  • Fully offline with no dependencies
  • Matches Jev's reconstructed tokeniser rather than o200k
  • Request-level token estimates

Caveats

  • Encoder is a reconstruction, tied to one Jev version
  • No browser or Edge support
  • Does not call or replace the model

Getting started

npm install jevtok-ts

At a glance

Type
Plugin
Status
beta
Language
TypeScript
Runtime
Node.js 22+ library
Has code
yes
Has tests
yes
License
MIT

Use cases and integrations

How curated lists describe it

  • \*\*No Python, network calls, API keys, native extensions, or runtime dependencies.\*\* Vocabulary and lookup tables ship inside the package. Ordinary \`o200k\_base\` tokenization is not interchangeable with Jev: \`evidence\` is three tokens and \`2024\` is four.

    logicrw/awesome-jev-projects

Frequently asked questions

Why not use a standard tokenizer?

Jev's tokenisation differs from o200k_base; the README gives examples where counts differ.

Does it call the Jev API?

No, it runs entirely offline.

Which Jev version does it match?

jev-1.13-20260917, via the reconstructed encoder from jevtok.

Related projects

  • Hack Club's lightweight LLM proxy, listed for adding a Jev forwarding endpoint behind its auth, limits and usage logging.

    MCP serverproductionTypeScript
  • npm library that rate-limits, spend-caps, caches and redacts every Jev request made in a loop.

    LibrarybetaJavaScript
  • Go gateway that pools multiple TypeSafe accounts behind the native System One API with user keys, quotas and failover.

    ServicebetaGo
  • Rust CLI for Jev that lints typed question sets offline, then sends them and prints probabilities, labels and scores as JSON.

    CLIbetaRust
  • Task plugin for the new-api LLM gateway that adds a native /v1/systemone endpoint for Jev with auth, routing and token billing.

    PluginbetaJavaScript
  • Chinese-documented LLM gateway with virtual model routing, protocol conversion and a transparent Jev System One proxy.

    ServicebetaTypeScript