Skip to content

feat: ship the catalog as a typed npm package#43

Open
brunobuddy wants to merge 2 commits into
mainfrom
feat/model-parameters-types
Open

feat: ship the catalog as a typed npm package#43
brunobuddy wants to merge 2 commits into
mainfrom
feat/model-parameters-types

Conversation

@brunobuddy
Copy link
Copy Markdown
Member

💭 Why

Builders calling LLMs in TypeScript guess which knobs each model supports. The catalog is the source of truth. This makes it importable as types and runtime data so the compiler catches typos before they ship.

✨ What changed

  • New workspace packages/modelparams/ with codegen, helpers, and tests.
  • ParamsOf<"provider/model"> resolves per-model. Wrong keys and bad enum values are compile errors.
  • Codegen reads the YAML catalog through the existing Zod schema.
  • New release-modelparams.yml auto-publishes on catalog change with OIDC provenance.
  • Bump policy reuses the existing param-guard classifier: removed param triggers major, anything else patch.
  • Homepage hero adds an npm i modelparams CTA.

👤 For users

npm i modelparams. Per-model autocomplete and runtime defaults, with zero dependencies.

import type { ParamsOf } from "modelparams";

const params: ParamsOf<"anthropic/claude-opus-4-7"> = {
  max_tokens: 8192,
  "thinking.type": "enabled",
  "thinking.budget_tokens": 4096,
  // frequency_penalty: 0.5, // compile error — Anthropic does not expose it
};

🔧 For operators

Two steps before the first publish:

  1. Configure the npm trusted publisher for modelparams (npmjs.com -> Settings -> Trusted Publishers -> GitHub Actions, repo mnfst/modelparams.dev, workflow release-modelparams.yml). Once set, the NPM_TOKEN env var can come out of release-modelparams.yml.
  2. Hand-bump packages/modelparams/package.json from 0.0.0 to 0.1.0 so the first release is 0.1.0, not 0.0.1.

After merge, trigger the workflow manually via workflow_dispatch for the first publish. Subsequent releases happen automatically on catalog change.

Adds a new `modelparams` npm workspace at packages/modelparams that
generates per-model TypeScript types from the YAML catalog. Builders get
autocomplete on every supported parameter and compile errors on typos or
unsupported settings.

The codegen reads the catalog through the existing Zod schema so the
package and the website always agree on shape.

A new release workflow auto-publishes on catalog change with OIDC
provenance. Removed parameters bump major, anything else bumps patch,
reusing the same diff classifier param-guard.yml already runs on PRs.

Homepage gets an `npm i modelparams` hero CTA.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modelparams.dev Ready Ready Preview Jun 2, 2026 6:08pm

Request Review

@github-actions github-actions Bot added site Website code or tooling meta Repo docs, CI, and config labels Jun 2, 2026
The codegen emits files in `JSON.stringify(..., null, 2)` shape, while
prettier was reformatting them via lint-staged. That made the committed
form diverge from a fresh codegen run, which broke the CI drift guard.

Excluding `packages/modelparams/src/generated/` from prettier keeps the
two in lockstep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Repo docs, CI, and config site Website code or tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant