Skip to content

Tokensift

Token-efficiency linter for LLM prompts and payloads - ritenv/tokensift

Tokensift screenshot

About Tokensift

Deterministic, local, tokenizer-level static analysis of prompt strings, Message[] arrays, and tool schemas.

Status : early, actively developed. Core engine, 20 rules, real dollar cost per finding, a CLI, and tokensift/matchers for vitest/jest all work today. OpenAI models are exact; Claude support is estimate-based, see Cost and pricing below. See DESIGN.md for tradeoffs made along the way.

LLM APIs charge per token, and token counts don't line up with characters or words as cleanly as you'd expect. A UUID, a base64-encoded file, an indented JSON blob: all of these cost more tokens than their length suggests, because the tokenizer can't find any reusable pattern in them. tokensift reads a prompt (or a whole message array, or a tool schema) and points out exactly where that's happening: this UUID cost 18 tokens and a short id would've cost 3, this block of instructions got pasted twice, this JSON would tokenize the same minified.

It does this by actually tokenizing the text with the encoder the provider uses, not by estimating from character count. For OpenAI models that means the real BPE vocabulary, so counts are exact.

Discussion

Sign in to join the discussion.

Loading comments…

Tagged

Alternatives to Tokensift

Tools in the same space, ranked by how they are performing in the directory.

Compare all
  • Orion

    A backend and automation language compiled to bytecode in Rust.

    /Developer Tools
  • Free QR Codes

    Create a free static QR code with no signup, watermark or expiry.

    Free/Developer Tools
  • ArcadeMaker

    A cross-platform 2D game engine with its own programming language and IDE.

    Open source/Developer Tools
  • Makie

    Makie is a child-safe AI game builder where kids describe, build, remix, and share playable games.

    /Developer Tools
  • ravynOS

    An open-source operating system based on Darwin and FreeBSD that aims to be compatible with macOS applications.

    Open source/Developer Tools
  • Litelink

    Durable append-only capture into Iceberg tables; embedded and local-first.

    /Developer Tools