Typed registry of LLM model metadata for Python — context windows, pricing, provider routing.
Project description
model-metadata-central
Typed registry of LLM model metadata for Python — context windows, pricing, provider routing.
pip install model-metadata-central
Usage
Full registry
from model_metadata_central import get_all_models, get_all_providers
models = get_all_models()
for model in models:
print(f"{model['model_name']}: {model['context_window']} context")
Look up a single model
from model_metadata_central import get_model
model = get_model("gpt-4o")
if model:
print(model["context_window"]) # 128000
print(model["cost_per_token"]) # {"input": 0.000005, "output": 0.000015}
Filter by provider
from model_metadata_central import get_models_by_provider
anthropic = get_models_by_provider("anthropic")
openrouter = get_models_by_provider("openrouter")
Provider routing
from model_metadata_central import get_provider_model_id, get_provider
# Get the model ID for a specific provider
openai_id = get_provider_model_id("gpt-4o", "openai") # "gpt-4o"
orouter_id = get_provider_model_id("gpt-4o", "openrouter") # "openai/gpt-4o"
# Get provider config
provider = get_provider("openai")
print(provider["base_url"]) # "https://api.openai.com/v1"
print(provider["auth_type"]) # "api_key"
Named model constants
from model_metadata_central import GPT_4_O, CLAUDE_OPUS_4_7
# Fully typed dict — bundlers exclude the rest
print(GPT_4_O["context_window"])
API
| Function | Returns | Description |
|---|---|---|
get_model(id) |
dict | None |
Lookup by model_id |
get_all_models() |
list[dict] |
All models |
get_models_by_provider(provider_id) |
list[dict] |
Filter by provider |
get_model_on_provider(provider_id, provider_model_id=None) |
dict | None |
Find model on a specific provider |
get_provider(id) |
dict | None |
Provider config |
get_all_providers() |
list[dict] |
All providers |
get_provider_model_id(model_id, provider_id) |
str | None |
Provider-specific model ID |
Data
- Registry pre-compiled from
models/*.yamlat install/build time - 74 models across 17 providers
- Prices are in USD per token
Schema
Matches the JSON Schema definitions in the repo root.
Project details
Release history Release notifications | RSS feed
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 model_metadata_central-0.3.0.tar.gz.
File metadata
- Download URL: model_metadata_central-0.3.0.tar.gz
- Upload date:
- Size: 59.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
202e00c9880d28837566dd9ef16d317d06f32bdba1f48b0522ad815332f45ea4
|
|
| MD5 |
d111c3ef63fac603db402e1e4802771b
|
|
| BLAKE2b-256 |
216fdff15b313b31b893bee1960d00b0f06f01b21728d714b4b7300928aa0723
|
File details
Details for the file model_metadata_central-0.3.0-py3-none-any.whl.
File metadata
- Download URL: model_metadata_central-0.3.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92501e0bb07f8775ba92ba44fcbd2c08eb226b9b1207796d8d7b78efe07300ff
|
|
| MD5 |
b3a86eef74141384b93f2bc788ad5921
|
|
| BLAKE2b-256 |
8d89ade4ea82073569fc1daed4f4596b83994d91e37e8b35e741fd62334c21d3
|