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_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/*.yaml at 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


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.2.0.tar.gz (59.5 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.2.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: model_metadata_central-0.2.0.tar.gz
  • Upload date:
  • Size: 59.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2.0.tar.gz
Algorithm Hash digest
SHA256 17175b7c1062e66380a90908e945b3a583b6e05cfee164cfa897a32aaca39d3e
MD5 e9ff6b1f9b67db0516ebd370314167d4
BLAKE2b-256 c8f9c51ba7a02e33c21b3ef50a9f7a6ec84a4df4cc3e406363261f897dd695d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: model_metadata_central-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66b0ecff12c9c30c07decb292e8aa96efa83fd120bcad09abadd22e17a8b20dc
MD5 19d801d6d795c66099126009fb303413
BLAKE2b-256 afb1d99a19562d967c41b0f803c1543dd43a3cc4cc4825fec44e7c8e3cf520e9

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