generatemodels

command
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

ai/scripts/generatemodels/ai_gateway_pricing (pi: packages/ai/scripts/ai-gateway-pricing.ts, S17 943a10e74) — converts Vercel AI Gateway pricing to ModelCost. Each rate lists its own prompt-length brackets; every bracket start above zero becomes a request-wide tier with the rates in effect there.

pi: generate-models.ts — the amazon-bedrock block of loadModelsDevData (the P2-T2 bedrock batch).

pi: generate-models.ts — the codexModels block (ChatGPT Codex / OAuth openai-codex-responses models, hardcoded outside models.dev). Older model limits are based on observed server behavior; GPT-5.6 and GPT-6 use Codex's 272k default catalog limit.

Go source emitter for ai/models_generated.go. The generated file is package ai (same package as the ai.Model / compat types), so the emitter references package-ai names directly; lo.ToPtr provides the *T pointer literals the generated compat fields need. Output is run through go/format.

pi: generate-models.ts — fetch functions: models.dev (loadModelsDevData), OpenRouter (fetchOpenRouterModels), Vercel AI Gateway (fetchAiGatewayModels), NVIDIA NIM live model ids (fetchNvidiaNimModelIds).

pi: generate-models.ts — the models.dev Google blocks ("Process Google models" 1545-1572 and "Process Google Vertex Gemini models" 1576-1613) plus the Google thinking-api helpers (isGoogleThinkingApi at 551; isGemini3ProModel / isGemini3FlashModel / isGemma4Model at 859-871).

ai/scripts/generatemodels (pi: packages/ai/scripts/generate-models.ts) — fetches the models.dev, OpenRouter, and Vercel AI Gateway catalogs and regenerates ai/models_generated.go.

Run: cd ai/scripts/generatemodels && go run . Output: ai/models_generated.go (overwritten in place).

pi's model-data.ts / check-model-data.ts (validation of per-provider shards plus data/*.json and .manifest.json) are not ported: the generator emits a single file with no data/manifest layout to validate (see the ai/models_generated.go header comment). See also ai/scripts/generateimagemodels.

pi: generate-models.ts — compat detection (detectOpenAICompletionsCompat), thinking-level metadata, Anthropic fallback metadata, and the per-model metadata application pipeline. Branch comments mark logic that targets providers pig has not ported yet (openai-responses / google / bedrock / github-copilot / opencode / qwen-token-plan / xiaomi): kept verbatim where a kept provider can still match, and skipped (with the pi line noted) where the trigger API/provider is never produced by this generator.

pi: scripts/models-dev-reasoning-options.ts.

pi: generate-models.ts — the openai-responses catalog blocks that arrived with the B2 adapter: long-context pricing helpers, missingOpenAiModels, and the Azure Foundry clone.

pi: scripts/openrouter-catalog.ts (v0.99.1 #9948). Builds the OpenRouter catalog from the default listing plus the `output_modalities=image` and `output_modalities=decisions` listings. The default listing omits image-only and decision models, so those come from the other listings. An upstream model may appear in several results; it then gets separate entries per operation (chat/image/classifier).

openrouter_reasoning_options.go (pi: scripts/openrouter-reasoning-options.ts) — convert OpenRouter's reasoning metadata into pi model capabilities.

pi: generate-models.ts — models.dev catalog processing. Ported for every provider whose wire API pig has implemented (openai-completions / anthropic-messages / openai-responses / google-generative-ai / bedrock-converse-stream). Providers that pi serves through unported APIs (mistral-conversations) are skipped with the pi processing noted in comments.

pi: generate-models.ts — data-source types (ModelsDevModel, OpenRouter, Vercel AI Gateway). The generator is a standalone main package: it imports github.com/ZoroSpace/pig/ai for the Model/compat types it emits into ai/models_generated.go.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL