Skip to main content

HF Model Inspector

A package and GitHub Action to generate quality reports on Hugging Face model stats and usage, addressing ambiguity in open model releases.


Overview

hf_model_inspector is a Python package and GitHub Action designed to provide clear, structured reports for models hosted on Hugging Face. Open model releases often come with incomplete or inconsistent metadata, making it hard to quickly assess model size, architecture, quantization, and usage statistics.

This tool helps you:

  • Inspect model metadata including architecture, parameters, and downloads.
  • Handle quantization info cleanly, even when formats differ across releases.
  • Generate JSON and Markdown reports for documentation or review purposes.
  • Recommend suitable models for your GPU based on memory constraints.
  • Automate reporting with a GitHub Action for CI/CD pipelines.

Installation

pip install hf_model_inspector

Optional: For private models, you can use a Hugging Face token.


Quick Start

Example 1: Inspect a model and print summary

from hf_model_inspector import get_model_report_json

repo_id = "openai/gpt-oss-20b"
report = get_model_report_json(repo_id)

total_params = report["parameters"]["total"]
param_str = f"{total_params:,}" if total_params else "Unknown"

quant_info = report.get("quantization", {})
if quant_info.get("quantized"):
    methods = ", ".join(quant_info.get("quant_methods", [])) or "Unknown"
    precision = quant_info.get("precision", "Unknown")
    quant_status = f"{methods} ({precision})"
else:
    quant_status = quant_info.get("dtype", "Not Quantized") or "Not Quantized"

print(f"Model: {report['repo_id']}")
print(f"Architecture: {report['architecture']}")
print(f"Parameters: {param_str}")
print(f"Quantization: {quant_status}")
print(f"Downloads: {report['metadata']['downloads']}")
print(f"Tags: {', '.join(report['metadata']['tags']) if report['metadata']['tags'] else 'None'}")

Example 2: Full inspection and Markdown report

from hf_model_inspector import get_model_report_md, save_model_report
from hf_model_inspector.loader import authenticate_hf

token = authenticate_hf()
repo_id = "openai/gpt-oss-20b"

# Generate and save Markdown report
report_md = get_model_report_md(repo_id, token)
save_model_report(repo_id, md_path="model_report.md", token=token)

print("Markdown report saved as 'model_report.md'")

Features

  • ✅ Inspect public and private models.
  • ✅ Clean handling of quantization and parameter counts.
  • ✅ Save JSON or Markdown reports.
  • ✅ Recommend models suitable for your GPU.
  • ✅ Automate with GitHub Actions for reproducible reporting.

Release files for hf-model-inspector 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hf-model-inspector 1.2.2
File Size Uploaded
hf_model_inspector-1.2.2.tar.gz 21.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for hf-model-inspector 1.2.2
File Interpreter ABI Platform
hf_model_inspector-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 MB

Release files / hf_model_inspector-1.2.2.tar.gz

Download URL hf_model_inspector-1.2.2.tar.gz
Size 21.2 MB
Tags Source
SHA-256 checksum
How to use checksums
0f01d70418b18df58e6ea5a843aa356d11d097d0bf4d36056a022802429c2287
BLAKE2b-256 checksum
How to use checksums
841e3137ee5559787add415b539a2172b6e4437cfe44b6a2c52aec6ac6b47555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / hf_model_inspector-1.2.2-py3-none-any.whl

Download URL hf_model_inspector-1.2.2-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac46010ee3bc312942a8889c9141a721fb1b6117b890b557f364847e44a3fb46
BLAKE2b-256 checksum
How to use checksums
8a9deb593a99c5b1171358640ef5893871a36f561592563726c63b47f97a98ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page