Skip to content
PluginStats

tokenlens weekly downloads statistics

By xn1cklas · npm · AI SDKs

A lightweight registry of LLM model information, like name and context sizes, for building AI-powered apps.

View on npm Fresh · Oct 17, 2026

tokenlens has 476,539 recorded weekly downloads on npm, a decrease of 28.7% over the past 30 days.

It ranks #261 of 2,251 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by -23.9%.

PluginStats has 543 daily observations since Apr 23, 2025; the latest is from Oct 17, 2026.

Weekly downloads
476,539
Official API · Oct 17, 2026
7-day growth
-46.6%
-415.8K weekly downloads
30-day growth
-28.7%
-191.4K weekly downloads
90-day growth
-23.9%
-150K weekly downloads
Rank
#261
Among tracked npm listings

About tokenlens

TokenLens ========

Typed model metadata and context/cost utilities that help AI apps answer: Does this fit? What will it cost? Should we compact now? How much budget is left for the next turn?

Works great with the Vercel AI SDK out of the box, and remains SDK‑agnostic.

Highlights • Canonical model registry with alias resolution and minimal metadata you can trust. • Strong TypeScript surface: ModelId autocomplete and safe helpers. • Usage normalization across providers and SDKs (incl. Vercel AI SDK fields). • Context budgeting: remaining tokens, percent used, and next-turn budget. • Compaction helpers: when to compact and how many tokens to remove. • Cost estimation: fast, rough USD costs using source‑linked pricing when available. • Conversation utilities: sum usage, estimate conversation cost, measure context rot.

Install • npm: npm i tokenlens • pnpm: pnpm add tokenlens • yarn: yarn add tokenlens

Quick Start

Core Helpers • Registry: resolveModel, listModels, MODEL_IDS, isModelId, assertModelId • Usage: normalizeUsage, breakdownTokens, consumedTokens • Context: getContextWindow, remainingContext, percentRemaining, fitsContext, pickModelFor • Cost: estimateCost • Compaction: shouldCompact, contextHealth, tokensToCompact • Conversation: sumUsage, estimateConversationCost, computeContextRot, nextTurnBudget • Sugar: modelMeta, percentOfContextUsed, tokensRemaining, costFromUsage

Provider‑Agnostic Usage

Async Fetch (models.dev)

Picking Model Metadata

Context Budgeting & Compaction

Advanced • Caps strategy: remainingContext supports strategy: 'provider-default' | 'combined' | 'input-only'. • provider-default (default): prefers combinedMax when available; otherwise uses inputMax. • combined: always uses combinedMax (falls back to inputMax if missing). • input-only: uses only inputMax for remaining/percent calculations. • Defaults: shouldCompact defaults to threshold: 0.85; contextHealth defaults to warnAt: 0.75, compactAt: 0.85.

Conversation Utilities

Listing Models

Data Source & Sync • Primary source: models.dev (https://github.com/sst/models.dev). We periodically sync our registry from their dataset. • Official provider pages are used where applicable; if numbers aren’t explicit, fields remain undefined. • Sync locally: pnpm -C packages/tokenlens sync:models

Acknowlegements • Big thanks to the sst/models.dev maintainers and community for keeping model information current: https://github.com/sst/models.dev

License MIT

Description from the npm listing.

  • ai
  • llm
  • ai models
  • model registry
  • context window
  • token usage
  • tokens
  • pricing
  • cost estimation
  • usage normalization
  • prompt cache
  • vercel ai
  • vercel ai gateway
  • ai-sdk
  • openai
  • anthropic
  • google
  • mistral
  • cohere
  • xai

Where tokenlens sits in the listing

Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

All npm2,248 listings · 113 pages · page 14, #1 (overall #261)
All npm: every listing in weekly downloads order
PNG SVG
AI SDKs249 listings · 13 pages · page 1, #4 (overall #4)
AI SDKs: every listing in weekly downloads order
PNG SVG

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

tokenlens weekly downloads on npm, last 90 days: 476,539 weekly downloads as of Oct 17, 2026, -23.9% over 90 days.tokenlensWeekly downloads on npm · Last 90 days476,539downloads / week-23.9% over 90 days400K500K600K700K800K900K1MJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 20, 2026 – Oct 17, 2026 · 90 observations · Updated Oc…pluginstats.com
tokenlens weekly downloads on npm, last 90 days: 476,539 weekly downloads as of Oct 17, 2026, -23.9% over 90 days.
PNG SVG

7/30/90-day growth

tokenlens weekly downloads growth on npm: -46.6% over 7 days, -28.7% over 30 days, -23.9% over 90 days.tokenlensWeekly downloads growth on npm476,539downloads / week now7-day growth-415,776 weekly downloads-46.6%30-day growth-191,377 weekly downloads-28.7%90-day growth-150,026 weekly downloads-23.9%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
tokenlens weekly downloads growth on npm: -46.6% over 7 days, -28.7% over 30 days, -23.9% over 90 days.
PNG SVG

Ranking history

tokenlens npm ranking history: currently #261 (by weekly downloads).tokenlensnpm ranking · by weekly downloads · Last 90 days#261current rank#50#100#150#200#250#300Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18rankOct 17, 2026 – Oct 18, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
tokenlens npm ranking history: currently #261 (by weekly downloads).
PNG SVG

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Recent observations

Full history (543)
Recent weekly downloads observations for tokenlens
Date (UTC)Weekly downloadsChange vs. previous
476,539-115K
591,586+9.4K
582,202-193.3K
775,462-179.1K
954,6050
954,605+27.9K
926,702+34.4K
892,315+30.5K
861,854+29.3K
832,545+37.2K
795,374+25.9K
769,442-159.4K
928,837-749
929,586—

Similar npm AI SDKs plugins

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/tokenlens. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.