Skip to main content

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_million_tokens"]) # {"input": 5, "output": 15}

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/*.yaml at install/build time
  • 73 models across 18 providers
  • Prices are in USD per 1,000,000 tokens

Schema

Matches the JSON Schema definitions in the repo root.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

model_metadata_central-0.4.0.tar.gz (60.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

model_metadata_central-0.4.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file model_metadata_central-0.4.0.tar.gz.

File metadata

  • Download URL: model_metadata_central-0.4.0.tar.gz
  • Upload date:
  • Size: 60.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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

Hashes for model_metadata_central-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8af833f231582764e13b02216f410e33688ad9402cdd37776af3809ab81a81d9
MD5 25bcf1019bcfaef9f3164e716a6f455e
BLAKE2b-256 56d0312e60bc6755a1e6e9f0e00427606e8fd3c529a22bde76dd2ef9916deedc

See more details on using hashes here.

File details

Details for the file model_metadata_central-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: model_metadata_central-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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

Hashes for model_metadata_central-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dccccc00dbd91b036d9cb5bc1e1b4d28def5e99d1da4046dfc23be71b672685e
MD5 ae062efeb1d584055384a70a6127b9a0
BLAKE2b-256 9063a2554f2f94d39a29af824959411bb2d7c75c939e46416fbc2adb4393ac53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page