
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@simonorzel26/ai-models
Advanced tools
Converts Vercel AI SDK's TypeScript model types into usable JavaScript objects and arrays.
This package provides multiple ways to work with AI SDK models, from simple to advanced:
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';
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'
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', ...]
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' });
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';
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()
}));
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`);
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' })}`);
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 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.
This package does the heavy lifting for you. It's a types-only library that:
@ai-sdk
providers.With @simonorzel26/ai-models
, you get comprehensive, up-to-date model types with zero runtime dependencies, removing explicit definition bloat from your app.
npm install @simonorzel26/ai-models
For detailed statistics about models, providers, and categories, see STATS.md.
Check out @simonorzel26/shadcn-aisdk-model-select
for a Next.js + shadcn/ui "Model Select" component that uses this package.
MIT
FAQs
AI model types extractor for @ai-sdk providers
The npm package @simonorzel26/ai-models receives a total of 18 weekly downloads. As such, @simonorzel26/ai-models popularity was classified as not popular.
We found that @simonorzel26/ai-models demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.