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.

Release files for modelparams 0.0.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modelparams 0.0.30
File Size Uploaded
modelparams-0.0.30.tar.gz 33.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for modelparams 0.0.30
File Interpreter ABI Platform
modelparams-0.0.30-py3-none-any.whl Python 3 none any Details

Total release size: 81.7 kB

Release files / modelparams-0.0.30.tar.gz

Download URL modelparams-0.0.30.tar.gz
Size 33.7 kB
Tags Source
SHA-256 checksum
How to use checksums
90ca558ac726531d7b60d2cff07231ed59f7eb34bf2cf34dcb676ded24ca7dfc
BLAKE2b-256 checksum
How to use checksums
e51299429f9db3631ce0f01127574ca2c43fa53abaac167b62f961e8e9fb9918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release files / modelparams-0.0.30-py3-none-any.whl

Download URL modelparams-0.0.30-py3-none-any.whl
Size 48.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1c7bf34f828b88798d814faffd4bdf14e4f2c49c78a615074c66080cf253ad7
BLAKE2b-256 checksum
How to use checksums
41d1dc74122a668c883736255cdc4ea292d34791b76ed1df07f33dbe9beecae7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

This release

0.0.30 This release

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page