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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@simonorzel26/ai-models

v2.0.6

Published

AI model types extractor for @ai-sdk providers

Readme

@simonorzel26/ai-models

npm version License: MIT

Converts Vercel AI SDK's TypeScript model types into usable JavaScript objects and arrays.

Usage

This package provides multiple ways to work with AI SDK models, from simple to advanced:

🎯 Simple & Clean Types

import { OpenAIChatModel, AnthropicChatModel, GoogleChatModel } from '@simonorzel26/ai-models';

// Clean, readable type names
const gptModel: OpenAIChatModel = 'gpt-4o';
const claudeModel: AnthropicChatModel = 'claude-3-5-sonnet-20241022';
const geminiModel: GoogleChatModel = 'gemini-1.5-pro';

🚀 Popular Models (Quick Access)

import { POPULAR_MODELS } from '@simonorzel26/ai-models';

// Easy access to commonly used models
const gpt4o = POPULAR_MODELS.GPT_4O;              // 'gpt-4o'
const claude = POPULAR_MODELS.CLAUDE_3_5_SONNET;  // 'claude-3-5-sonnet-20241022'
const gemini = POPULAR_MODELS.GEMINI_1_5_PRO;     // 'gemini-1.5-pro'

📦 Provider Collections

import { OPENAI_MODELS, ANTHROPIC_MODELS } from '@simonorzel26/ai-models';

// Organized by provider and category
const openaiChatModels = OPENAI_MODELS.chat;         // ['gpt-4o', 'gpt-4-turbo', ...]
const openaiEmbeddings = OPENAI_MODELS.embedding;    // ['text-embedding-3-large', ...]
const claudeModels = ANTHROPIC_MODELS.chat;          // ['claude-3-5-sonnet-20241022', ...]

🔧 Advanced Utilities

import {
  getModelInfo,
  findModels,
  isValidModel,
  getModelCount
} from '@simonorzel26/ai-models';

// Get detailed model information
const info = getModelInfo('gpt-4o');
// Returns: { provider: 'openai', model: 'gpt-4o', category: 'chat', value: 'openai:gpt-4o' }

// Find models with filters
const models = findModels({ provider: 'openai', category: 'chat' });

// Validate model names
if (isValidModel('gpt-4o')) {
  // Model exists
}

// Get statistics
const totalModels = getModelCount();
const openaiModels = getModelCount({ provider: 'openai' });

🎨 Category-Based Types

import { ChatModel, EmbeddingModel, ImageModel } from '@simonorzel26/ai-models';

// Use any chat model from any provider
const chatModel: ChatModel = 'gpt-4o' || 'claude-3-5-sonnet-20241022' || 'gemini-1.5-pro';

// Use any embedding model
const embeddingModel: EmbeddingModel = 'text-embedding-3-large' || 'text-embedding-004';

🏗️ Real-World Examples

Building a Model Selector

import {
  POPULAR_MODELS,
  OPENAI_MODELS,
  ANTHROPIC_MODELS,
  type OpenAIChatModel,
  type AnthropicChatModel
} from '@simonorzel26/ai-models';

// Quick popular models dropdown
const popularOptions = [
  { value: POPULAR_MODELS.GPT_4O, label: 'GPT-4o' },
  { value: POPULAR_MODELS.CLAUDE_3_5_SONNET, label: 'Claude 3.5 Sonnet' },
  { value: POPULAR_MODELS.GEMINI_1_5_PRO, label: 'Gemini 1.5 Pro' },
];

// Provider-specific sections
const openaiOptions = OPENAI_MODELS.chat.map(model => ({
  value: model,
  label: model.toUpperCase()
}));

Type-Safe Model Configuration

import {
  getModelInfo,
  type ChatModel,
  type EmbeddingModel
} from '@simonorzel26/ai-models';

interface AIConfig {
  chatModel: ChatModel;
  embeddingModel: EmbeddingModel;
  temperature: number;
}

const config: AIConfig = {
  chatModel: 'gpt-4o',
  embeddingModel: 'text-embedding-3-large',
  temperature: 0.7
};

// Validate configuration
const chatInfo = getModelInfo(config.chatModel);
console.log(`Using ${chatInfo?.provider} for chat`);

Advanced Model Discovery

import {
  findModels,
  getModelsByProviders,
  getModelCount,
  type FilterOptions
} from '@simonorzel26/ai-models';

// Find all multimodal models
const multimodalModels = findModels({
  provider: 'openai',
  category: 'chat'
}).filter(m => m.model.includes('vision') || m.model.includes('4o'));

// Get models from multiple providers
const aiProviders = ['openai', 'anthropic', 'google'];
const allChatModels = getModelsByProviders(aiProviders)
  .filter(m => m.category === 'chat');

// Statistics
console.log(`Total models: ${getModelCount()}`);
console.log(`OpenAI models: ${getModelCount({ provider: 'openai' })}`);
console.log(`Chat models: ${getModelCount({ category: 'chat' })}`);

🔄 Legacy Support (Still Works)

import { ALL_MODELS, AI_SDK_MODELS } from '@simonorzel26/ai-models';

// Original flat array approach
const allModels = ALL_MODELS;

// Original structured approach
const openaiChatModels = AI_SDK_MODELS.openai.chat.OpenaiOpenAIChatModelId;

The Problem

The Vercel AI SDK is fantastic, but its model types are only available as union types exported from their individual provider packages (e.g., @ai-sdk/openai, @ai-sdk/anthropic). If you want types for all models, you'd need to install dozens of packages, leading to bloat.

The Solution

This package does the heavy lifting for you. It's a types-only library that:

  • Extracts model information from all @ai-sdk providers.
  • Exports them as TypeScript types, structured objects, and flat arrays.
  • Automatically updates daily via a GitHub Action, so you always have the latest models.

With @simonorzel26/ai-models, you get comprehensive, up-to-date model types with zero runtime dependencies, removing explicit definition bloat from your app.

Installation

npm install @simonorzel26/ai-models

Statistics

For detailed statistics about models, providers, and categories, see STATS.md.

Looking for a UI Component?

Check out @simonorzel26/shadcn-aisdk-model-select for a Next.js + shadcn/ui "Model Select" component that uses this package.

License

MIT