Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

llm-zoo

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llm-zoo

100+ LLM models. Pricing, capabilities, context windows. Always current.

latest
Source
npmnpm
Version
1.8.1
Version published
Weekly downloads
368
5.44%
Maintainers
1
Weekly downloads
 
Created
Source

llm-zoo 🦁

LLM pricing and capabilities change weekly. Docs are scattered. There's no single source of truth.

One package. 85+ models. Always current.

import { lookup, cost, cheapest } from 'llm-zoo';

// Know everything about any model
const claude = lookup('sonnet46');
console.log(claude.contextWindow);  // 1000000
console.log(claude.inputPrice);     // 3

// Calculate exact costs
const price = cost('gpt4o', { input: 50000, output: 10000 });

// Find the right model
const budget = cheapest({ supportsVision: true, supportsReasoning: true });

Zero dependencies. Full TypeScript. Tree-shakeable. Zod schemas included.

Install

npm install llm-zoo

Model Rankings

Cheapest ($/1M tokens)

ModelInputOutputProvider
qwenturbo$0.05$0.50DashScope
deepseek$0.14$0.28DeepSeek
gemini31f-$0.25$1.50Google
gemini3f$0.30$2.50Google
gpt41-$0.40$1.60OpenAI
qwenplus$0.40$1.20DashScope
kimi25$0.60$3.00Moonshot
haiku45$1.00$5.00Anthropic
grok43$1.25$2.50xAI
gpt52$1.75$14.00OpenAI

Premium ($/1M tokens)

ModelInputOutputReasoningProvider
gpt55pro$30$180OpenAI
gpt55$5$30OpenAI
opus48T$5$25Anthropic
opus48$5$25-Anthropic
sonnet46T$3$15Anthropic
gpt54$2.50$15OpenAI
gpt41$2$8-OpenAI
gpt52$1.75$14OpenAI

Largest Context

ModelContextProvider
gpt551MOpenAI
gpt541MOpenAI
gemini31p1MGoogle
gemini31f-1MGoogle
gemini3f1MGoogle
opus481MAnthropic
sonnet461MAnthropic
qwenplus1MDashScope
gpt411MOpenAI
grok431MxAI
gpt52400KOpenAI
kimi25262KMoonshot

Capabilities

CapabilityCountExamples
Vision45+sonnet46, gpt41, gemini31p
Reasoning30+opus48T, gpt55, deepseekT, grok43
Code Execution20+sonnet46, gpt41, gemini3f
Web Search15+opus48, gpt41, gpt54
Prompt Caching25+All Claude, Gemini, DeepSeek

Providers

ProviderModelsHighlights
Anthropic221M context, 90% cache savings, PDF support
OpenAI35GPT-5.x reasoning, deep research
Google81M context, audio input
DeepSeek8Budget reasoning ($0.14/1M)
xAI6Grok 4.3 with 1M context, configurable reasoning
Moonshot8Kimi K2.5 thinking mode
DashScope3Qwen with 1M context
Copilot1Free GPT-4o
OpenRouter2Llama 405B, QVQ-72B

API

Lookup

lookup('sonnet46')              // → ModelConfig | undefined
resolve('claude-sonnet-4-6')    // → by full API name
exists('gpt4o')                 // → true

Filter

from(ModelProvider.ANTHROPIC)   // → all Claude models
where(c => c.supportsVision)    // → by capability predicate
supporting('supportsReasoning') // → models with reasoning
withContext(500000)             // → 500K+ context models

Cost

cost('sonnet46', { input: 10000, output: 5000 })
cost('sonnet46', { input: 10000, output: 5000, cached: 8000 })  // with caching
maxCost('gpt4o', 50000)                                         // worst case
compareCosts(['sonnet46', 'gpt4o'], { input: 10000, output: 2000 })

Select

cheapest({ supportsVision: true })
cheapest({ supportsReasoning: true }, { minContext: 100000 })
smartpick(5)                    // best model under $5/1M tokens
ranked('price')                 // cheapest first
ranked('context', 'desc')       // largest context first

Insights

const { totalModels, providers, pricing, context } = insights();

Zod Schemas (v4)

Validate model configs at runtime (requires zod@^4.0.0):

import { ModelConfigSchema } from 'llm-zoo/schemas';

// Validate custom model config
const result = ModelConfigSchema.safeParse(myConfig);
if (!result.success) {
  console.error(result.error);
}

// Validate API responses
const validatedModel = ModelConfigSchema.parse(apiResponse);

Available schemas:

  • ModelConfigSchema — Full model configuration
  • ModelCapabilitiesSchema — Capability flags
  • ModelProviderSchema — Provider enum
  • ReasoningEffortSchema — Reasoning levels

Data Structure

interface ModelConfig {
  name: string;              // 'sonnet46'
  fullName: string;          // 'claude-sonnet-4-6'
  provider: ModelProvider;
  inputPrice: number;        // $/1M tokens
  outputPrice: number;
  contextWindow: number;
  maxOutputTokens: number;
  capabilities: ModelCapabilities;
  openRouterOnly: boolean;
  openrouterFullName?: string;
}

interface ModelCapabilities {
  supportsFunctionCalling: boolean;
  supportsVision: boolean;
  supportsReasoning: boolean;
  supportsNativeCodeExecution: boolean;
  supportsNativeWebSearch: boolean;
  supportsPromptCaching: boolean;
  cacheDiscountFactor: number;   // 0.1 = 90% savings
  // ... and more
}

Use Cases

LLM Router

import { where, cost } from 'llm-zoo';

function route(needs: { vision?: boolean; budget: number; tokens: number }) {
  return where(c => !needs.vision || c.supportsVision)
    .filter(m => cost(m, { input: needs.tokens, output: 4000 }) <= needs.budget)
    .sort((a, b) => a.inputPrice - b.inputPrice)[0];
}

Edge Function (Supabase/Vercel)

import { lookup, exists, cost } from 'llm-zoo';

export async function validateRequest(model: string, tokens: number, tier: string) {
  if (!exists(model)) return { error: 'Unknown model' };

  const config = lookup(model)!;
  if (tier === 'free' && config.inputPrice > 1) {
    return { error: 'Upgrade for premium models' };
  }

  return {
    allowed: true,
    estimatedCost: cost(model, { input: tokens, output: 4000 })
  };
}

Cost Dashboard

import { cost, MODEL_CONFIGS } from 'llm-zoo';

const report = Object.entries(usage).map(([model, tokens]) => ({
  model,
  spent: cost(model, tokens),
  provider: MODEL_CONFIGS[model]?.provider,
}));

Direct Access

import { MODEL_CONFIGS, MODELS, ANTHROPIC_MODELS } from 'llm-zoo';

MODEL_CONFIGS['sonnet46'].inputPrice;
MODELS.forEach(name => console.log(name));
Object.keys(ANTHROPIC_MODELS);

Open Source by texra-ai

This package is part of a growing collection of open-source projects by texra-ai:

ProjectDescriptionLinks
llm-zoo80+ LLM models — pricing, capabilities, and context windows in one packageGitHub · npm
mcp-server-mathematicaMCP server that executes Mathematica code via wolframscript and verifies mathematical derivationsGitHub

Contributing

Found incorrect pricing? Missing capability? New model released? PRs welcome!

Model data lives in src/providers/. Just update the relevant file and submit a PR.

License

MIT

Keywords

llm

FAQs

Package last updated on 29 May 2026

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