Validate a model entry (or every model in a provider) in apps/sim/providers/models.ts against the provider's live API docs (no hallucination — reports what cann
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-validate-model-afa004b31c74 ,按照其中的说明把「validate-model」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
You audit one or more model entries in apps/sim/providers/models.ts against the provider's official live API docs. Hallucinated pricing and capabilities are the #1 failure mode in this file. Every numeric and capability claim must be re-derived from a live web fetch in this session — not from memory, not from training data, not from the user's marketing email.
models.ts is dead unless the provider's code under apps/sim/providers/{provider}/ consumes it (see Consumption Matrix below). Setting a flag the provider ignores is a warning, not a critical.When invoked as /validate-model <provider> [model-id]:
models.tsmodels.ts in a single pass and re-lintIf model-id is omitted, validate every model in the provider.
models.tsCapture per model: id, full pricing, full capabilities, contextWindow, releaseDate, recommended, speedOptimized, deprecated.
Use the canonical provider URL table in the add-model skill (.agents/skills/add-model/SKILL.md), Step 1, as the single source of truth — fetch the models index, pricing, and reasoning/parameter caveats pages listed there for the target provider.
Secondary cross-check (use at least one): OpenRouter, Artificial Analysis, CloudPrice.
If a fetch fails (404, timeout, paywall), record the URL attempted and mark dependent fields UNVERIFIED.
Use the Consumption Matrix in .agents/skills/add-model/SKILL.md Step 2 and run its re-grep commands for the target provider before relying on it. A flag set in models.ts that the provider's code does not read = warning: dead flag.
For each model, evaluate every row. Statuses: ✓ matches docs, ✗ disagrees, ⚠️ single-source, ❓ UNVERIFIED (could not fetch).
id exactly matches provider's API model identifier (case, dots, dashes, prefix for resellers)releaseDate matches launch announcementdeprecated: true set if provider has announced retirement (or removed from active list)pricing.input matches provider pricing pagepricing.output matches provider pricing pagepricing.cachedInput matches provider's documented cached/prompt-cache rate (or is correctly omitted if no caching offered)pricing.updatedAt is recent — warn if older than 60 dayscontextWindow matches docs (in tokens)capabilities.maxOutputTokens matches documented output cap (or is correctly omitted if "no output limit")temperature — provider accepts it for this model (reasoning-always-on models often reject)reasoningEffort.values — list matches docs; omitted for always-reasoning models that reject the parameter (e.g., grok-4.3, where xAI docs explicitly state reasoning_effort is not supported). Verify per model — some always-reasoning models (e.g., OpenAI's o-series) DO accept reasoning_effort and should keep the flag.verbosity.values — only on OpenAI gpt-5.x family; values match docsthinking.levels + thinking.default — only on Anthropic/Gemini; values match docsthinking.streamed — REQUIRED on Anthropic-family thinking models ('full' for generations returning full thinking deltas, 'summary' for omitted-display generations like Opus 4.7+/Sonnet 5/Fable 5 where Sim requests display: 'summarized'); verify against the provider's thinking-display docs. After any change, run bun run agent-stream-docs:generate so the Agent block docs table stays in sync (CI diffs it)nativeStructuredOutputs — only on providers whose code consumes it (see the Consumption Matrix); provider must document Structured Outputs / JSON-mode for this modeltoolUsageControl — provider supports tool_choice semanticscomputerUse — provider implements computer-use loop AND model is a computer-use SKUdeepResearch — only on actual deep-research SKUsmemory: false — only when the model genuinely cannot maintain conversation historyrecommended: true — at most one or two per provider; should be current flagshipspeedOptimized: true — only on smallest/fastest tier (nano / flash-lite / haiku class)getHostedModels() includes the model ID (providers/models.ts expands whole providers — more than openai/anthropic/google — plus the static Fireworks catalog), the model is served with Sim's rotating key and billed via shouldBillModelUsage(). Confirm that is the intent (a BYOK-only model parked under a hosted provider is a billing bug — warning).{PREFIX}_COUNT / {PREFIX}_1..N env vars set (ops concern; note if it looks unset for a model claiming hosted support).For each model, emit a table with one row per checklist item. Every row that claims ✓ must have a URL.
### Validation — <model-id>
| Field | Repo | Live docs | Source URL | Status |
|---|---|---|---|---|
| `input` | $1.25/M | $1.25/M | https://docs.x.ai/... | ✓ |
| `cachedInput` | $0.50/M | $0.20/M | https://cloudprice.net/... | ✗ stale (price cut not picked up) |
| `reasoningEffort` | low/medium/high | rejected by API | https://docs.x.ai/.../reasoning | ✗ inert — selecting silently no-ops |
| `contextWindow` | 1,000,000 | 1,000,000 | https://docs.x.ai/... + https://openrouter.ai/... | ✓ (2 sources) |
| `releaseDate` | 2026-04-30 | not found in scraped pages | _attempted: docs.x.ai, x.ai/news_ | ❓ UNVERIFIED |
**Findings**
- 🔴 critical — `cachedInput` is wrong: docs say $0.20/M, repo has $0.50/M
- 🟡 warning — `reasoningEffort` is set but provider rejects it for this model (xAI docs explicitly: "reasoning_effort is not supported by grok-4.3")
- 🔵 suggestion — `pricing.updatedAt` is 90 days old; refresh
- ❓ unverified — `releaseDate` could not be confirmed from any fetched page; ask user
**Disagreements between sources**
- _none_ OR _OpenRouter says $X, provider docs say $Y — went with provider docs_
End each multi-model run with a summary count: N models checked · X critical · Y warnings · Z suggestions · W unverified.
After reporting, ask: "Want me to fix the critical and warning items? I'll print the diff first." On yes:
models.ts in a single passbun run lintrecommended: true per provider, pricing.updatedAt >60 days old, missing deprecated: true on retired model.speedOptimized on a clearly smallest-tier model.Pricing changes after provider price cuts; reasoningEffort/thinking/verbosity set on a model whose provider code or API does not accept them; stale pricing.updatedAt; wrong context window; more than one recommended after a flagship swap; missing deprecated: true after a provider retirement announcement.
If, after fetching the documented sources, a field cannot be confirmed:
The skill is allowed to say "I could not verify the cached input price for grok-4.3 from the official xAI docs in this session — I attempted [URLs] without finding the value. Third-party sources [URL1, URL2] both report $0.20/M. Confirm before I update." That is correct behavior. Hallucinating a number is not.