Skip to main content

modelparams

Typed model parameters for Python, generated from the open modelparams.dev catalog.

pip install modelparams

Typed request parameters

Generated TypedDict definitions provide autocomplete and static errors for unsupported keys, incorrect value types, and invalid enum values:

from modelparams import validate_params
from modelparams.types.openai import Gpt_4_1Params

params: Gpt_4_1Params = {
    "max_tokens": 1024,
    "temperature": 0.7,
}

validated = validate_params("openai/gpt-4.1", params)

validate_params uses a cached strict Pydantic adapter. It returns a provider-keyed dictionary or raises pydantic.ValidationError for unknown parameters, coercions, invalid enum values, or values outside the catalog range.

from openai import OpenAI

OpenAI().chat.completions.create(model="gpt-4.1", messages=messages, **validated)

Provider-specific dot paths remain literal dictionary keys:

from modelparams.types.anthropic import Claude_Haiku_4_5_20251001Params

params: Claude_Haiku_4_5_20251001Params = {
    "thinking.type": "enabled",
    "thinking.budget_tokens": 4096,
}

Catalog helpers

from modelparams import get_defaults, get_model, get_param, list_models

model = get_model("anthropic/claude-haiku-4-5-20251001")
print(model.auth_type, model.params)

defaults = get_defaults("anthropic/claude-haiku-4-5-20251001")
thinking = get_param("anthropic/claude-haiku-4-5-20251001", "thinking.type")
anthropic_models = list_models("anthropic")

The catalog is bundled with the package. No network request is made at runtime.

Development

From the repository root:

npm run codegen:python
uv sync --project packages/modelparams-python --extra dev
uv run --project packages/modelparams-python pytest packages/modelparams-python/tests

Generated catalog and type files are committed and verified in CI. Python releases use independent modelparams-py@x.y.z tags and publish to PyPI through the repository's trusted-publisher workflow.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modelparams-0.0.1.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modelparams-0.0.1-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file modelparams-0.0.1.tar.gz.

File metadata

  • Download URL: modelparams-0.0.1.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for modelparams-0.0.1.tar.gz
Algorithm Hash digest
SHA256 42786790f4b51ee9f05237f4dcae87f97b482814c32d5c7a9d7e5acb6b56c597
MD5 6f5839e677fc267e7e397afda2504867
BLAKE2b-256 fa8b33f1033a1752452c4c36564eeee87038f5ff068073d694fdcc087f070f4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelparams-0.0.1.tar.gz:

Publisher: release-modelparams-python.yml on mnfst/modelparams.dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file modelparams-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: modelparams-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for modelparams-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87774b168887fb8d683922cf4ec4fd161dc2db48936fa8c371a7991e93310b55
MD5 4bf252f89854401532ee48acc6fafe2b
BLAKE2b-256 38ff6224c2392d951ea78e3e8af76216a6651023bcedd8d0905b5a045aa1ac85

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelparams-0.0.1-py3-none-any.whl:

Publisher: release-modelparams-python.yml on mnfst/modelparams.dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page