npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

llm-info

v1.0.69

Published

Information on LLM models, context window token limit, output token limit, pricing and more

Readme

llm-info

NPM version CI

Information on LLM models, context window token limit, output token limit, pricing and more, developed by 16x Prompt and 16x Eval team.

Related projects:

  • send-prompt: A unified TypeScript library for AI model interactions with standardized interfaces and function calling.
  • ai-file-edit: A library for editing files using AI models such as GPT, Claude, and Gemini.

Information provided

  • context window token limit
  • output token limit
  • pricing
  • image input support
  • tokenizerId for loading tokenizer from @xenova/transformers
  • legacy status and legacy reason
  • alpha/beta status
  • small model indicator
  • reasoning model indicator
  • coding recommendation
  • writing recommendation
  • OpenRouter model ID mapping
  • notes and documentation URLs
  • API keys page URLs for easy access to provider API key management
  • Deprecated model mappings (DeepSeek-V3 under deepseek-chat, DeepSeek-R1 under deepseek-reasoner)
  • and more

Models included

  • GPT-5.2
  • GPT-5.2 Pro
  • o3
  • o4-mini
  • Claude Opus 4.5
  • Claude Sonnet 4.5
  • Claude Haiku 4.5
  • DeepSeek-V3.1
  • Gemini 3 Pro Preview
  • Gemini 2.5 Flash
  • Grok 4
  • .. and more

Non-models (model-like) included:

  • ChatGPT

Providers supported

First-party providers:

  • OpenAI
  • Anthropic
  • Azure OpenAI
  • DeepSeek
  • Google
  • xAI

Third-party providers:

  • OpenRouter
  • Fireworks

Install:

$ npm install llm-info

Usage

// Models
import { AllModels, ModelEnum, NonModelEnum, ModelInfoMap } from 'llm-info';

console.log(AllModels);
/*
[
  'gpt-4',
  'gpt-4-turbo',
  'gpt-4o',
  'gpt-4o-64k-output-alpha',
  'gpt-4o-mini',
  'gpt-4o-2024-08-06',
  'o1-preview',
  'o1-mini',
  'o1',
  'claude-3-5-sonnet-20240620',
  'claude-3-5-sonnet-20241022',
  'claude-3-5-haiku-20241022',
  // ...
]
*/

// Model Info
const modelInfo = ModelInfoMap['gpt-4o'];
console.log(modelInfo);
/*
{
  name: 'GPT-4o',
  provider: 'openai',
  contextWindowTokenLimit: 128000,
  outputTokenLimit: 4096,
  pricePerMillionInputTokens: 5,
  pricePerMillionOutputTokens: 15,
  tokenizerId: 'Xenova/gpt-4o',
  supportsImageInput: true,
  legacy: false
}
*/

// Example with more fields including recommendations
const recentModelInfo = ModelInfoMap['claude-sonnet-4-20250514'];
console.log(recentModelInfo);
/*
{
  name: 'Claude Sonnet 4',
  provider: 'anthropic',
  contextWindowTokenLimit: 200000,
  outputTokenLimit: 64000,
  pricePerMillionInputTokens: 3,
  pricePerMillionOutputTokens: 15,
  tokenizerId: 'Xenova/claude-tokenizer',
  notes: 'Optimal balance of intelligence, cost, and speed',
  notesUrl: 'https://www.anthropic.com/claude/sonnet',
  supportsImageInput: true,
  recommendedForCoding: true,
  recommendedForWriting: true,
  legacy: false,
  openRouterModelId: 'anthropic/claude-sonnet-4'
}
*/

// Providers
import { AI_PROVIDER_NAME_MAP } from 'llm-info';

console.log(AI_PROVIDER_NAME_MAP);
/*
{
  openai: 'OpenAI',
  anthropic: 'Anthropic',
  'azure-openai': 'Azure OpenAI',
  deepseek: 'DeepSeek',
  openrouter: 'OpenRouter',
  google: 'Google',
  fireworks: 'Fireworks'
}
*/

// Provider Configuration
import { AI_PROVIDER_CONFIG, AI_PROVIDERS } from 'llm-info';

console.log(AI_PROVIDER_CONFIG);
/*
{
  openai: {
    name: 'OpenAI',
    firstParty: true,
    apiKeysPage: 'https://platform.openai.com/api-keys'
  },
  anthropic: {
    name: 'Anthropic',
    firstParty: true,
    apiKeysPage: 'https://console.anthropic.com/settings/keys'
  },
  'azure-openai': {
    name: 'Azure OpenAI',
    firstParty: false,
    baseURL: 'https://<your-resource-name>.openai.azure.com/',
    website: 'https://azure.microsoft.com/en-us/products/ai-services/openai-service'
  },
  deepseek: {
    name: 'DeepSeek',
    firstParty: true,
    baseURL: 'https://api.deepseek.com',
    apiKeysPage: 'https://platform.deepseek.com/api_keys'
  },
  openrouter: {
    name: 'OpenRouter',
    firstParty: false,
    baseURL: 'https://openrouter.ai/api/v1',
    website: 'https://openrouter.ai',
    apiKeysPage: 'https://openrouter.ai/keys'
  },
  google: {
    name: 'Google',
    firstParty: true,
    baseURL: 'https://generativelanguage.googleapis.com/v1beta/openai/',
    apiKeysPage: 'https://aistudio.google.com/app/apikey'
  },
  fireworks: {
    name: 'Fireworks',
    firstParty: false,
    baseURL: 'https://api.fireworks.ai/inference/v1',
    website: 'https://fireworks.ai'
  },
  xai: {
    name: 'xAI',
    firstParty: true,
    baseURL: 'https://api.x.ai/v1',
    apiKeysPage: 'https://console.x.ai/'
  }
}
*/

// Tokenizer
import { AutoTokenizer } from '@xenova/transformers';
const testSentence =
  "Many words map to one token, but some don't: indivisible.";
const results: string[] = [];
for (let i = 0; i < AllModels.length; i++) {
  const model = AllModels[i];
  if (ModelInfoMap[model].tokenizerId) {
    const tokenizer = await AutoTokenizer.from_pretrained(
      ModelInfoMap[model].tokenizerId
    );
    const tokens = tokenizer.encode(testSentence);
    results.push(`${model}: ${tokens.length}`);
  }
}
console.log(`Test sentence: ${testSentence}\n${results.join('\n')}`);
// Test sentence: Many words map to one token, but some don't: indivisible.
// gpt-4: 15
// gpt-4o: 14
// gpt-4o-mini: 14
// claude-3-5-sonnet-20240620: 16

Deprecated Model Mappings

Some model IDs have been reused for newer versions. The library includes a deprecated mapping system to track these transitions:

import {
  getDeprecatedMappingByModelId,
  getAllDeprecatedMappings,
} from 'llm-info';

// Check for deprecated model mappings
const deprecatedMapping = getDeprecatedMappingByModelId('deepseek-chat');
if (deprecatedMapping) {
  console.log(`Model ID: ${deprecatedMapping.modelId}`);
  console.log(`Deprecated Name: ${deprecatedMapping.deprecatedName}`);
  console.log(`Deprecated Release: ${deprecatedMapping.deprecatedReleaseDate}`);
  console.log(`Transition Date: ${deprecatedMapping.transitionDate}`);
  console.log('Deprecated Model Info:', deprecatedMapping.deprecatedModelInfo);
}
/*
Model ID: deepseek-chat
Deprecated Name: DeepSeek-V3 (new)
Deprecated Release: 2025-03-24
Transition Date: 2025-08-21
Deprecated Model Info: {
  id: 'deepseek-chat',
  name: 'DeepSeek-V3 (new)',
  provider: 'deepseek',
  contextWindowTokenLimit: 64000,
  outputTokenLimit: 8192,
  pricePerMillionInputTokens: 0.27,
  pricePerMillionOutputTokens: 1.1,
  tokenizerId: null,
  legacy: true,
  legacyReason: 'Replaced by DeepSeek-V3.1 on the same model ID',
  releaseDate: '2025-03-24'
}
*/

// Get all deprecated models info
const allModelsInfo = getAllDeprecatedModelsInfo();
console.log(allModelsInfo);
/*
[
    {
      id: 'deepseek-chat',
      name: 'DeepSeek-V3 (new)',
      provider: 'deepseek',
      contextWindowTokenLimit: 64000,
      outputTokenLimit: 8192,
      pricePerMillionInputTokens: 0.27,
      pricePerMillionOutputTokens: 1.1,
      tokenizerId: null,
      legacy: true,
      legacyReason: 'Replaced by DeepSeek-V3.1 on the same model ID',
      releaseDate: '2025-03-24'
    },
    {
      id: 'deepseek-reasoner',
      name: 'DeepSeek-R1',
      provider: 'deepseek',
      contextWindowTokenLimit: 64000,
      outputTokenLimit: 8000,
      pricePerMillionInputTokens: 0.55,
      pricePerMillionOutputTokens: 2.19,
      tokenizerId: 'Xenova/gpt-4o',
      reasoning: true,
      supportsImageInput: false,
      legacy: true,
      legacyReason: 'Replaced by DeepSeek-V3.1 (Thinking Mode) on the same model ID',
      releaseDate: '2025-05-28'
    }
  ]
*/

Current Deprecated Mappings

  • deepseek-chat: Originally "DeepSeek-V3 (new)" (released 2025-03-24), now refers to "DeepSeek-V3.1" (transitioned 2025-08-21)
  • deepseek-reasoner: Originally "DeepSeek-R1" (released 2025-05-28), now refers to "DeepSeek-V3.1 (Thinking Mode)" (transitioned 2025-08-21)

Testing

$ npm test