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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42786790f4b51ee9f05237f4dcae87f97b482814c32d5c7a9d7e5acb6b56c597
|
|
| MD5 |
6f5839e677fc267e7e397afda2504867
|
|
| BLAKE2b-256 |
fa8b33f1033a1752452c4c36564eeee87038f5ff068073d694fdcc087f070f4f
|
Provenance
The following attestation bundles were made for modelparams-0.0.1.tar.gz:
Publisher:
release-modelparams-python.yml on mnfst/modelparams.dev
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modelparams-0.0.1.tar.gz -
Subject digest:
42786790f4b51ee9f05237f4dcae87f97b482814c32d5c7a9d7e5acb6b56c597 - Sigstore transparency entry: 2340379852
- Sigstore integration time:
-
Permalink:
mnfst/modelparams.dev@489ab91975e8621b3a42b602ab7d7561344a7028 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mnfst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-modelparams-python.yml@489ab91975e8621b3a42b602ab7d7561344a7028 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87774b168887fb8d683922cf4ec4fd161dc2db48936fa8c371a7991e93310b55
|
|
| MD5 |
4bf252f89854401532ee48acc6fafe2b
|
|
| BLAKE2b-256 |
38ff6224c2392d951ea78e3e8af76216a6651023bcedd8d0905b5a045aa1ac85
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modelparams-0.0.1-py3-none-any.whl -
Subject digest:
87774b168887fb8d683922cf4ec4fd161dc2db48936fa8c371a7991e93310b55 - Sigstore transparency entry: 2340379860
- Sigstore integration time:
-
Permalink:
mnfst/modelparams.dev@489ab91975e8621b3a42b602ab7d7561344a7028 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mnfst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-modelparams-python.yml@489ab91975e8621b3a42b602ab7d7561344a7028 -
Trigger Event:
push
-
Statement type: