@llmgateway/models

中文文档
1.389.1发布于 2026/11/02SEE LICENSE IN ../../LICENSETypeScriptES Module零依赖构建来源已验证

Model and provider definitions for LLM Gateway - the unified API for all LLM providers.

原始使用文档
文档目录7 节
  1. Installation
  2. Usage
  3. Models
  4. Providers
  5. Supported Providers
  6. Full Model List
  7. License

@llmgateway/models

Model and provider definitions for LLM Gateway - the unified API for all LLM providers.

Installation

npm install @llmgateway/models

Usage

Models

The models array contains all supported LLM models with their pricing and provider mappings:

import { models } from "@llmgateway/models";

// Find a specific model
const gpt4 = models.find((m) => m.id === "gpt-4o");

console.log(gpt4.id); // "gpt-4o"
console.log(gpt4.family); // "openai"
console.log(gpt4.contextSize); // 128000
console.log(gpt4.providers); // Provider mappings with pricing

Model Properties

PropertyTypeDescription
idstringUnique model identifier
familystringModel family (openai, anthropic, google, etc.)
contextSizenumberMaximum context window in tokens
maxOutputnumberMaximum output tokens
providersProviderModelMapping[]Available providers with pricing
supportsImagesbooleanWhether model supports image inputs
supportsToolsbooleanWhether model supports tool/function calling
supportsReasoningbooleanWhether model supports extended reasoning
freebooleanWhether model is free to use

Provider Mapping Properties

PropertyTypeDescription
providerIdstringProvider identifier
externalIdstringUpstream provider model id
inputPricenumberPrice per input token (USD)
outputPricenumberPrice per output token (USD)
cachedInputPricenumberPrice per cached input token (USD)
contextSizenumberProvider-specific context size
maxOutputnumberProvider-specific max output

Providers

The providers array contains all supported LLM providers:

import { providers } from "@llmgateway/models";

// List all providers
providers.forEach((p) => {
  console.log(`${p.name}: ${p.description}`);
});

// Find a specific provider
const openai = providers.find((p) => p.id === "openai");
console.log(openai.name); // "OpenAI"
console.log(openai.website); // "https://openai.com"

Provider Properties

PropertyTypeDescription
idstringUnique provider identifier
namestringDisplay name
descriptionstringProvider description
websitestringProvider website URL
streamingbooleanWhether provider supports streaming
colorstringBrand color (hex)

Supported Providers

  • OpenAI
  • Anthropic
  • Google AI Studio
  • Google Vertex AI
  • Azure OpenAI
  • AWS Bedrock
  • Mistral
  • DeepSeek
  • xAI (Grok)
  • Perplexity
  • And more...

Full Model List

For the complete list of models with live pricing, visit llmgateway.io/models.

License

See LICENSE for details.

版本与发布记录

@llmgateway/models 共发布 592 个版本,首次发布于 2026/01/25;过去 12 个月发布了 592 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.389.1latest2026/11/021 天前
1.389.02026/11/012 天前
1.388.22026/10/312 天前
1.388.12026/10/313 天前
1.388.02026/10/313 天前
1.387.02026/10/303 天前

关于 @llmgateway/models 的常见问题

@llmgateway/models 是什么?

的模型和提供程序定义 LLM网关 -所有LLM提供商的统一API。

如何安装 @llmgateway/models?

在项目目录运行 npm install @llmgateway/models,或使用 pnpm add / yarn add / bun add。

@llmgateway/models 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@llmgateway/models 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@llmgateway/models 可以商用吗?

@llmgateway/models 使用 SEE LICENSE IN ../../LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@llmgateway/models 还在维护吗?

最新版本 1.389.1 发布于 2026/11/02(1 天前);至今共发布 592 个版本,其中过去 12 个月发布了 592 个;首次发布于 2026/01/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。