🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

@tokenlens/core

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tokenlens/core

Core types and registry utilities for TokenLens (model metadata).

latest
Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
502K
29.01%
Maintainers
1
Weekly downloads
 
Created
Source

@tokenlens/core

npm version npm downloads License: MIT TypeScript

TokenLens overview

Core types and fast registry utilities for TokenLens. Build canonical model registries with alias resolution and strong typing.

Install

  • npm: npm i @tokenlens/core
  • pnpm: pnpm add @tokenlens/core
  • yarn: yarn add @tokenlens/core

Exports

  • createRegistry(models: Model[]) to build a fast provider+model lookup with alias resolution.
  • Types: Model, Provider, Status, Pricing, ContextCaps, usage shapes.

Quick Start

import { createRegistry, type Model } from '@tokenlens/core';

const reg = createRegistry([
  {
    id: 'openai:gpt-4o',
    provider: 'openai',
    status: 'stable',
    context: { combinedMax: 128000 },
    source: 'docs',
  } satisfies Model,
]);

// Resolve shorthands/aliases to the canonical entry
const m = reg.resolveModel('gpt-4o');
console.log(m?.id); // 'openai:gpt-4o'

See also

  • @tokenlens/models for a prebuilt models catalog.
  • @tokenlens/helpers for context/cost utilities layered on top.

License MIT

Keywords

ai

FAQs

Package last updated on 19 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts