Join the HubClone community
and get access to the augmented documentation experience
- Collaborate on models, datasets and Spaces
- Faster examples with accelerated inference
- Switch between documentation themes
to get started
Uploading models
To share a model you first create a model repository, then add its files. You can do this from the browser, from Python, from the CLI or with plain Git.
Using the web interface
Create a repository from the New → Model menu, then use Add file → Upload files on the Files and versions tab. This is fine for small checkpoints and README edits.
Using the client library
The Python client uploads folders in parallel, retries failed parts and works well for multi-gigabyte checkpoints.
from huggingface_hub import HfApi
api = HfApi()
api.create_repo("your-username/my-model", exist_ok=True)
api.upload_folder(
folder_path="./checkpoint",
repo_id="your-username/my-model",
commit_message="Upload checkpoint",
)Supported formats
| Format | Recommended for |
|---|---|
| Safetensors | Default choice: fast to load and cannot run code on load |
| GGUF | Quantized models for local runtimes |
| ONNX | Cross-framework inference engines |
| PyTorch pickle | Legacy checkpoints only (scanned for unsafe code) |
Upload from a library
Many libraries can push directly to the Hub with a push_to_hub method. They also write a basic model card and the metadata the Hub needs to show the right widget.
Safetensors is preferred for security and performance; the Hub shows a dedicated parameter count for it.