CLI reference tool for open-weight AI models. Search, inspect, and compare Hugging Face model cards — all from your terminal.
The open-weight AI model landscape is exploding. Every week brings a new release — Qwen, DeepSeek, Llama, Mistral, Phi, Gemma, and more. Keeping track of their specs (parameters, context window, license, architecture, hardware requirements) across scattered Hugging Face pages is tedious.
model-cards solves this by bringing the Hugging Face model registry to your terminal. One command to search, one to inspect details, one to compare models side-by-side. No browser tabs, no clicking around — just structured specs at your fingertips.
pip install model-cardsgit clone https://github.com/your-username/model-cards.git
cd model-cards
pip install -e .
# For development (includes pytest):
pip install -e ".[dev]"model-cards search qwenOutputs a rich terminal table with results sorted by download count:
┌────────────────────────────────────────────────────────────┐
│ Search Results: qwen │
├──────────────────────────────┬────────┬──────────┬────────┤
│ Model ID │ Task │ Downloads│ Likes │
├──────────────────────────────┼────────┼──────────┼────────┤
│ Qwen/Qwen2.5-7B-Instruct │ text- │ 18.5M │ 12.3K │
│ │ gener. │ │ │
│ Qwen/Qwen2.5-32B-Instruct │ text- │ 3.2M │ 3.1K │
│ │ gener. │ │ │
│ Qwen/Qwen3-8B │ text- │ 1.8M │ 2.8K │
│ │ gener. │ │ │
└──────────────────────────────┴────────┴──────────┴────────┘
Columns: Model ID | Task | Downloads | Likes | License | Last Updated
model-cards search llama --limit 20Controls how many results to return (default: 10, max: 50).
model-cards show Qwen/Qwen2.5-7B-InstructRenders a detailed information panel:
╭─────────────────────── Model Details ───────────────────────╮
│ │
│ Overview │
│ Model ID: Qwen/Qwen2.5-7B-Instruct │
│ Task: text-generation │
│ License: apache-2.0 │
│ Created: 2024-09-18 │
│ Visibility: Public │
│ │
│ Hardware │
│ Parameters: 7.6B │
│ Recommended Hardware: Moderate (<=16GB) (~15.2 GB VRAM)│
│ │
│ Specs │
│ Context Window: 32K │
│ Architecture: Qwen2ForCausalLM │
│ Precision: bfloat16 │
│ Framework: transformers │
│ │
│ Benchmarks │
│ - MMLU: 85.4 │
│ - GSM8K: 92.0 │
│ │
│ Card Metadata │
│ Datasets: [datasets list] │
│ Languages: en, zh │
│ Base Model: N/A │
│ CO2 Emissions: N/A │
│ │
│ Stats │
│ Downloads: 18.5M │
│ Likes: 12.3K │
╰──────────────────────────────────────────────────────────────╯
model-cards compare qwen3-coder kimi-k2.6 deepseek-v4Displays a comparison table with the best value in each row highlighted in bold green:
┌──────────────────┬──────────────────┬──────────────────┬──────────────────┐
│ Field │ qwen3-coder │ kimi-k2.6 │ deepseek-v4 │
├──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ Task │ text-generation │ text-generation │ text-generation │
├──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ Parameters │ 8.2B │ 2.6B │ 30.0B ▲ │
├──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ Context Window │ 128K ▲ │ 128K ▲ │ 128K ▲ │
├──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ License │ apache-2.0 │ mit │ custom │
├──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ Downloads │ 1.2M │ 890.5K │ 4.3M ▲ │
├──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ Likes │ 1.8K │ 2.1K ▲ │ 1.5K │
├──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ Hardware Rating │ Moderate │ Easy ▲ │ Very Heavy │
└──────────────────┴──────────────────┴──────────────────┴──────────────────┘
Supports 2–4 models per comparison. The ▲ marker indicates the best performer in each numeric row.
model-cards listFetches a curated list of trending open-weight models (Qwen, DeepSeek, Llama, Mistral, and more) from the Hugging Face API, sorted by download popularity:
┌──────────────────────────────────────────────────────────────────┐
│ Trending Open-Weight Models (fetched from API) │
├────────────────────────────────┬────────────────┬────────┬───────┤
│ Model ID │ Task │ Downl. │ Likes │
├────────────────────────────────┼────────────────┼────────┼───────┤
│ Qwen/Qwen2.5-7B-Instruct │ text-generation│ 18.5M │ 12.3K │
│ deepseek-ai/DeepSeek-R1... │ text-generation│ 15.2M │ 9.1K │
│ meta-llama/Llama-3.1-8B-Instr.│ text-generation│ 12.8M │ 8.5K │
│ ... │ │ │ │
└────────────────────────────────┴────────────────┴────────┴───────┘
Every command supports --json for integration into scripts and pipelines:
model-cards search qwen --json | jq '.[].model_id'
model-cards show Qwen/Qwen2.5-7B-Instruct --json > model.json
model-cards compare qwen3-coder kimi-k2.6 --json | jq .
model-cards list --json| Field | Description | search / list |
show |
compare |
|---|---|---|---|---|
| Model ID | Full Hugging Face model identifier | ✅ | ✅ | ✅ |
| Task | Pipeline tag (e.g., text-generation) | ✅ | ✅ | ✅ |
| Parameters | Parameter count (M/B notation) | — | ✅ | ✅ |
| Context Window | Maximum sequence length (K notation) | — | ✅ | ✅ |
| License | Model license (apache-2.0, mit, etc.) | ✅ | ✅ | ✅ |
| Architecture | Model architecture class | — | ✅ | — |
| Hardware | Estimated RAM requirement & rating | — | ✅ | ✅ |
| Downloads | Total download count | ✅ | ✅ | ✅ |
| Likes | Heart/like count on Hugging Face | ✅ | ✅ | ✅ |
| Benchmarks | Reported benchmark scores (MMLU, GSM8K...) | — | ✅ | — |
| Precision | Weight dtype (bfloat16, int8, etc.) | — | ✅ | — |
| Last Updated | Last modification date | ✅ | — | — |
| Variable | Required | Description |
|---|---|---|
HF_TOKEN |
No | Hugging Face access token. Set this for authenticated requests — unlocks higher API rate limits from Hugging Face. |
export HF_TOKEN=hf_your_token_heremodel-cards/
├── model_cards/
│ ├── cli.py # argparse entry point
│ ├── api.py # Hugging Face API client + data normalization
│ ├── display.py # Rich table / panel rendering
│ └── compare.py # Side-by-side comparison table
├── tests/
│ └── test_model_cards.py
├── pyproject.toml
└── README.md
-
CLI (
cli.py) — Built withargparse(zero extra dependencies). Exposessearch,show,compare, andlistsubcommands. Each dispatches to the async API client viaasyncio.run(). -
API Client (
api.py) — Anhttpx.AsyncClient-based client that talks tohttps://huggingface.co/api/models. Features:- Async architecture: Concurrent model fetches via
asyncio.gather()for speed. - Rate limiting: Enforces 1 request/second by default (Hugging Face free-tier friendly).
- In-memory caching: Deduplicates repeated requests within a CLI session.
- Data normalization: Extracts and normalizes fields from the raw Hugging Face API response — parameters, context window, architecture, precision, benchmarks, and hardware estimates.
- Async architecture: Concurrent model fetches via
-
Display (
display.py) — Usesrichfor terminal output:render_models_table()— Tabular output for search and list commands.render_model_panel()— Detailedrich.panel.Panelfor model inspection.print_json()— Structured JSON output for pipelines.
-
Comparison (
compare.py) —build_comparison_table()generates a side-by-siderich.table.Tablewith automatic highlighting of the best value per row (bold green).
The API client normalizes raw Hugging Face payloads into a clean schema:
- Parameters — Extracted from
cardData.metadata,config.json, or estimated from.safetensorsfile sizes (2 bytes/param approximation). - Context Window — Resolved from
metadata.max_length,config.max_position_embeddings, or fallback fields. - Architecture — Parsed from
config.architectures[0]orconfig.model_type. - Hardware Estimate — RAM required for inference, calculated from parameter count × precision bytes (with 20% overhead). Categorized as Easy (≤8 GB), Moderate (≤16 GB), Heavy (≤24 GB), or Very Heavy.
- Benchmarks — Metric values from
cardData.metrics.
MIT — see LICENSE for details.
Contributions are welcome! Please open an issue or pull request on GitHub.
git clone https://github.com/your-username/model-cards.git
cd model-cards
pip install -e ".[dev]"
pytest