npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

modelparams

v0.0.3

Published

TypeScript types and runtime data for LLM model parameters. Generated from the modelparams.dev open catalog.

Readme

modelparams

Typed LLM model parameters for TypeScript. Generated from the open modelparams.dev catalog.

npm install modelparams

Stop guessing which knobs each model accepts. Get autocomplete on every parameter, compile-time errors on typos and unsupported settings, and the catalog's defaults at runtime — for every provider in one tiny zero-dependency package.

Why

You're calling claude-opus-4-7 with frequency_penalty set. TypeScript doesn't tell you the param doesn't exist. The provider silently ignores it. Your evals drift. Multiply by every model in your router.

modelparams makes the catalog of supported parameters a first-class TypeScript citizen, the same way tokenlens does for context windows and pricing.

Usage

Per-model parameter typing — the headline feature

import type { ParamsOf } from "modelparams";
import Anthropic from "@anthropic-ai/sdk";

const params: ParamsOf<"anthropic/claude-opus-4-7"> = {
  max_tokens: 8192,
  temperature: 0.7,
  "thinking.type": "enabled",
  "thinking.budget_tokens": 4096,
  // frequency_penalty: 0.5, // ❌ TYPE ERROR — Anthropic doesn't expose this knob
};

await new Anthropic().messages.create({
  model: "claude-opus-4-7",
  messages: [...],
  ...params,
});

Autocomplete on every key. Autocomplete on every enum value. A compile error on the typo before it ships.

Defaults at runtime

import { getDefaults } from "modelparams";

const defaults = getDefaults("anthropic/claude-haiku-4-5-20251001");
// { max_tokens: 4096, temperature: 1, top_p: 1, top_k: 0, "thinking.type": "disabled", ... }

const params = { ...defaults, temperature: 0.2 };

Model picker UI

import { listModels, getModel } from "modelparams";

for (const id of listModels({ provider: "anthropic" })) {
  const m = getModel(id);
  m.params.filter((p) => p.group === "sampling").forEach((p) => renderSlider(p));
}

Discover what a model supports

import { getParam } from "modelparams";

const thinking = getParam("anthropic/claude-opus-4-7", "thinking.type");
if (thinking?.type === "enum") {
  console.log(thinking.values); // ["disabled", "enabled"]
}

Validate untrusted params at runtime

ParamsOf<Id> is compile-time only — it can't help against a JSON request body. parseParams validates an untrusted object against the catalog (unknown keys, numeric ranges, enum values):

import { parseParams } from "modelparams";

app.post("/chat", (req, res) => {
  const result = parseParams("openai/gpt-4.1", req.body.params);
  if (!result.success) return res.status(422).json({ issues: result.issues });
  openai.chat.completions.create({ model: "gpt-4.1", messages, ...result.value });
});

Prefer a schema? paramsSchema(id) returns a Standard Schema, so it drops into tRPC, Hono, TanStack Form, and anything else that speaks the spec:

import { paramsSchema } from "modelparams";

app.post("/chat", validator("json", paramsSchema("openai/gpt-4.1")), handler);

API

Types

| Type | Description | | -------------------- | --------------------------------------------------------------------------------------------------------------------- | | ParamsOf<Id> | Optional parameters for model Id. The headline type. | | StrictParamsOf<Id> | Same shape, every field required. | | ModelId | Union of all "provider/model" ids (including -subscription variants). | | Provider | Union of provider slugs ("anthropic", "openai", …). | | ParamsById | Mapped type: { [Id in ModelId]: ParamsByIdMap[Id] }. | | CatalogEntry | The full catalog object for one model. | | Param | A parameter definition in a loose, iterable shape — getModel(id).params assigns to readonly Param[] with no cast. | | ParseParamsResult | The discriminated result of parseParams. | | StandardSchemaV1 | The Standard Schema interface paramsSchema returns. |

Functions

| Function | Description | | -------------------------- | ----------------------------------------------------------- | | getModel(id) | The full catalog entry for a model id. | | getDefaults(id) | The catalog-declared defaults. | | getParam(id, path) | A single parameter's definition (range, enum values, etc.). | | listModels({ provider }) | List model ids, optionally filtered by provider. | | listAllModels() | The full CATALOG array. | | parseParams(id, input) | Validate an untrusted params object against the catalog. | | paramsSchema(id) | A Standard Schema that validates a params object for id. |

Constants

| Constant | Description | | ----------- | -------------------------------------------------- | | MODEL_IDS | Frozen tuple of every model id (drives ModelId). | | PROVIDERS | Frozen tuple of provider slugs. | | CATALOG | Frozen array of every catalog entry. | | BY_ID | Frozen Record<ModelId, CatalogEntry> lookup. | | DEFAULTS | Frozen per-model defaults. |

Subpath imports (tree-shaking)

import { MODEL_IDS } from "modelparams/model-ids"; // types-only consumers
import { DEFAULTS } from "modelparams/defaults"; // just defaults
import { CATALOG } from "modelparams/data"; // full runtime catalog

How it's built

  • Source of truth: the YAML catalog at github.com/mnfst/modelparams.dev/tree/main/models.
  • A codegen script reads the catalog through the same Zod schema the website uses and emits four .ts files (model-ids, params-by-id, defaults, data).
  • Every catalog change on main auto-publishes a new version. Removed params bump major; everything else is patch. Provenance is signed via npm OIDC.

Versioning

| Catalog change | npm bump | | -------------------------------------------------------------- | --------- | | Parameter removed from a still-existing model | major | | Anything else (new model, new param, range or default changed) | patch | | No semantic change | skipped |

Pin ^x.y.z to get non-breaking updates as new models and parameters land.

License

MIT