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.15

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.15
File Size Uploaded
modelparams-0.0.15.tar.gz 31.4 kB Details

Built distribution (wheel)

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

Total release size: 77.1 kB

Release files / modelparams-0.0.15.tar.gz

Download URL modelparams-0.0.15.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bbaebef4ef6a61b1f1e07fba6c930756f2276a124e1288870bdd667ae7d87e38
BLAKE2b-256 checksum
How to use checksums
bf342320d0f2602851157e5ac8e0231b18b1b0d196e2c3edb24e296deb8381c4
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 17, 2026.

Transparency log

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

Download URL modelparams-0.0.15-py3-none-any.whl
Size 45.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f20abb7596ab73183cafcd3864358efa30032a52dd5f576f3dd03bead5e1bfe1
BLAKE2b-256 checksum
How to use checksums
37dc86dcd3121b2cf9bc89e0018e3e00269453d579e2d9d346824398cb41aca0
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 17, 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

0.0.30

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

This release

0.0.15 This release

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