Skip to main content

A centralized registry for discovering and managing LLM model capabilities. Track model features, costs, and limitations across providers like OpenAI and Anthropic. Supports both verified model definitions and user-managed entries with local storage.

Project description

LLM Registry

Build Status MIT License

LLM Registry is a Python package that provides a unified interface for discovering and managing the capabilities of various Large Language Models (LLMs). It includes a robust API, a rich CLI, and supports synchronization between local and remote model registries.

Table of Contents

Overview

Manage and discover LLM model capabilities across multiple providers like OpenAI, Anthropic, and more in a centralized registry. Use this package to check model capabilities before initializing provider clients and to manage model metadata efficiently.

Features

  • Unified API for capability discovery and management
  • Multiple Providers: Supports OpenAI, Anthropic, and others
  • Local and Remote Storage: Synchronize your model registries
  • Rich Command-Line Interface (CLI)
  • Dynamic Capability Management: Easily add, update, and delete model data

Installation

Install via pip:

pip install llm-registry

Library Usage

Integrate the package in your Python projects by following these steps:

Listing Models

from llm_registry import CapabilityRegistry, Provider
registry = CapabilityRegistry()
models = registry.get_models()
for model in models:
    print(model)

Retrieve a Specific Model's Capabilities

model = registry.get_model(Provider.OPENAI, "gpt-4")
if model and model.supports_streaming:
    from openai import OpenAI  # Replace with actual OpenAI client import
    client = OpenAI()  # Initialize client with streaming enabled
    response = client.chat.completions.create(
        model=model.model_id,
        messages=[{"role": "user", "content": "Hello"}],
        stream=True
    )

Add a New Model Capability

from llm_registry.utils import create_model_capability
new_model = create_model_capability(
    model_id="gpt-4",
    provider=Provider.OPENAI,
    model_family="GPT-4",
    input_cost=0.01,
    output_cost=0.03,
    context_window=8192,
    training_cutoff="2023-04",
    supports_streaming=True,
    supports_tools=True,
    supports_json_mode=True,
    supports_system_prompt=True
)

from llm_registry import CapabilityRepository
repo = CapabilityRepository()
repo.save_model_capabilities(new_model)

CLI Usage

The CLI tool llmr allows you to interact with model capabilities directly from the terminal.

List Models

View all available models:

llmr list

CLI Screenshot

*The above screenshot demonstrates how the CLI tool (llmr) currently looks like when listing models.

To filter models by provider:

llmr list --provider openai

Add Model

Add a new model:

llmr add gpt-4 \
    --provider openai \
    --model-family GPT-4 \
    --input-cost 0.01 \
    --output-cost 0.03 \
    --context-window 8192 \
    --training-cutoff 2023-04 \
    --streaming \
    --tools \
    --json-mode \
    --system-prompt

Delete Model

Remove an existing model:

llmr delete gpt-4 --provider openai

Use -f or --force to bypass confirmation.

Model Capabilities

Each model entry tracks:

  • Basic Information
    • Provider (e.g., OpenAI, Anthropic)
    • Model ID and Model Family
  • Cost Details
    • Input/Output token costs (per 1M tokens)
    • Context window size
    • Training data cutoff date
  • Feature Support
    • Streaming responses
    • Tools/Function calling
    • Vision/Image input
    • JSON mode
    • System prompt support

Configuration

Default model data is stored in ~/.llm-registry. You can override the directory by:

  • Passing a data_dir parameter to CapabilityRepository in code
  • Using the --data-dir option in CLI commands

Development

Requirements

  • Python 3.13+
  • uv for dependency management

Setup

# Create virtual environment and sync dependencies
uv venv
uv sync --group dev

# Run tests with coverage analysis
pytest -v --cov=llm_registry

License

Distributed under the MIT License. See LICENSE for more information.

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

llm_registry-0.1.0.tar.gz (544.2 kB view details)

Uploaded Source

Built Distribution

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

llm_registry-0.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_registry-0.1.0.tar.gz.

File metadata

  • Download URL: llm_registry-0.1.0.tar.gz
  • Upload date:
  • Size: 544.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_registry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd5d172461745964ea50aedd3f7c31e6e0a1fa0469a056c3a4eb42b4a5adbdc5
MD5 fa0c11dfd7f3f3c45a65956e5b048c3b
BLAKE2b-256 6e8f374597d8359aed9f64625e1a3411ffe8e1bbd5e5330a419c761b439b8f48

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_registry-0.1.0.tar.gz:

Publisher: publish.yml on yamanahlawat/llm-registry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_registry-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llm_registry-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_registry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89db76c10df3764d52955692eaa5e03709029e85ef3af8aa41dc0e50abaa91c3
MD5 e750566759d8e55b6f27df6dfd33b39f
BLAKE2b-256 b4c28d70ad7b68b745ea57d95adbd071929177bed2ffc69905e32e3115932af3

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_registry-0.1.0-py3-none-any.whl:

Publisher: publish.yml on yamanahlawat/llm-registry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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