Skip to content

CLI Reference

Model Garage provides a retro-themed CLI built with Typer and Rich.

Installation

The CLI is installed automatically with the package:

pip install model-garage
garage --help

Commands

garage open

Load and display a model's architecture card.

garage open gpt2
garage open microsoft/phi-2
garage open meta-llama/Llama-2-7b-hf

Shows:

  • Model family and architecture type
  • Parameter count and layer structure
  • Hidden dimensions, attention heads, vocabulary size
  • Extractable component summary

garage extract

Extract components from a model.

# Extract attention from a specific layer
garage extract gpt2 --layer 6 --component self_attention

# Extract FFN from layer 3
garage extract gpt2 --layer 3 --component ffn

# Extract all components from a layer
garage extract gpt2 --layer 6

Options:

Flag Description
--layer, -l Layer index to extract from
--component, -c Component type: self_attention, ffn, embedding, layer_norm
--output, -o Output path for saved component

garage analyze

Analyze activations for a given prompt.

garage analyze gpt2 --prompt "The meaning of life is"
garage analyze microsoft/phi-2 --prompt "Hello world" --layers 0,6,11

Shows activation statistics per layer: mean, std, sparsity, and entropy.

Options:

Flag Description
--prompt, -p Input text to analyze
--layers Comma-separated layer indices (default: all)

garage compare

Compare two model architectures and find compatible parts.

garage compare gpt2 distilgpt2
garage compare microsoft/phi-2 microsoft/phi-1_5

Shows dimension comparison, layer counts, and lists compatible components.

garage registry list

List all models registered in the local registry.

garage registry list

garage registry add

Decompose and register a model.

garage registry add gpt2
garage registry add microsoft/phi-2

Output Examples

garage open
garage open gpt2
garage extract
garage extract gpt2 --layer 6 --component self_attention
garage analyze
garage analyze gpt2
garage compare
garage compare gpt2 distilgpt2