Documentation
¶
Overview ¶
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.