jevtok-ts
Offline TypeScript token counter and request-cost estimator for Jev 1.13, a port of the reconstructed jevtok encoder.
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
| Type | Question | Answers |
|---|---|---|
| Other | How many input tokens will this Jev request use? (estimation, not a model decision) | — |
How it works
- Install the package
- Get the jev-1.13 encoding
- Count or encode text, or estimate request tokens from state and questions
- 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-tsAt 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 serverproductionTypeScriptnpm library that rate-limits, spend-caps, caches and redacts every Jev request made in a loop.
LibrarybetaJavaScriptGo gateway that pools multiple TypeSafe accounts behind the native System One API with user keys, quotas and failover.
ServicebetaGoRust CLI for Jev that lints typed question sets offline, then sends them and prints probabilities, labels and scores as JSON.
CLIbetaRustTask plugin for the new-api LLM gateway that adds a native /v1/systemone endpoint for Jev with auth, routing and token billing.
PluginbetaJavaScriptChinese-documented LLM gateway with virtual model routing, protocol conversion and a transparent Jev System One proxy.
ServicebetaTypeScript