Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.78 KB

File metadata and controls

52 lines (34 loc) · 1.78 KB

Using modctl with ModelPack

This guide shows you how to use modctl to package, distribute, and manage AI models using the ModelPack specification.

Installation

Follow the instructions to install modctl from the modctl GitHub repository to install the CLI tool.

Download A Model

To package a model, you need to download it to your local directory. The following example shows how to download a model from Huggingface.

export HF_MODEL="Qwen/Qwen3-0.6B"
export MODEL_PATH=my-model-directory

# Install the huggingface cli
pip install 'huggingface_hub'

# Login the huggingface cli
hf auth login --token <your-huggingface-token>

# Download a model
hf download $HF_MODEL --local-dir $MODEL_PATH

Package Your First Model

The following script will walk through how to build a ModelPack format model artifact and push it to the model registry.

# Please modify the MODEL_REGISTRY environment variable to point to your OCI model registry
export MODEL_REGISTRY=myregistry.com

# If $MODEL_REGISTRY needs authentication, please login first
modctl login -u <username> -p <password> $MODEL_REGISTRY

# Generate a sample Modelfile, and edit the fields as needed
modctl modelfile generate $MODEL_PATH

# Build a model artifact from your model files
modctl build -t $MODEL_REGISTRY/mymodel:v1.0 $MODEL_PATH

# Push to an OCI registry
modctl push $MODEL_REGISTRY/mymodel:v1.0

Next Steps