feat: ship the catalog as a typed npm package#43
Open
brunobuddy wants to merge 2 commits into
Open
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💭 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
packages/modelparams/with codegen, helpers, and tests.ParamsOf<"provider/model">resolves per-model. Wrong keys and bad enum values are compile errors.release-modelparams.ymlauto-publishes on catalog change with OIDC provenance.npm i modelparamsCTA.👤 For users
npm i modelparams. Per-model autocomplete and runtime defaults, with zero dependencies.🔧 For operators
Two steps before the first publish:
modelparams(npmjs.com -> Settings -> Trusted Publishers -> GitHub Actions, repomnfst/modelparams.dev, workflowrelease-modelparams.yml). Once set, theNPM_TOKENenv var can come out ofrelease-modelparams.yml.packages/modelparams/package.jsonfrom0.0.0to0.1.0so the first release is0.1.0, not0.0.1.After merge, trigger the workflow manually via
workflow_dispatchfor the first publish. Subsequent releases happen automatically on catalog change.