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.33
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| modelparams-0.0.33.tar.gz | 33.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| modelparams-0.0.33-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.0 kB
Release files / modelparams-0.0.33.tar.gz
| Download URL | modelparams-0.0.33.tar.gz |
|---|---|
| Size | 33.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d3ad0084278fd12de90e371d721bd2e082394af1ee1a60b091797429317aa3b
|
|
BLAKE2b-256 checksum How to use checksums |
6b8ef5b914b1edb83d279de84e9676569b21fca45e43019beb00979227b1275e
|
| 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 logRelease files / modelparams-0.0.33-py3-none-any.whl
| Download URL | modelparams-0.0.33-py3-none-any.whl |
|---|---|
| Size | 48.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a10b5138057ecf3a1a32591d2dcba9741869ed1288063c4efb78dfbf9a9a298c
|
|
BLAKE2b-256 checksum How to use checksums |
a0a28d3f750846c4226f12cfba369eddd618b7e2e67474bb8e5b07bf024e96f3
|
| 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