Sharing and export
Save local folders with save_pretrained, publish with push_to_hub, and export when a production runtime needs ONNX, ExecuTorch or another format.
Adapted for this playbook from the π€ Transformers documentation by Hugging Face. Official page: https://huggingface.co/docs/transformers/model_sharing. Images Β© Hugging Face (
documentation-images) unless noted. This is not a substitute for the upstream docs β verify against the current version.Covers Hugging Face pages: model_sharing, serialization

Source: Hugging Face documentation images.
Save locallyβ
model.save_pretrained("./my-model")
tokenizer.save_pretrained("./my-model")
Push to the Hubβ
model.push_to_hub("org/my-model")
tokenizer.push_to_hub("org/my-model")
Authenticate with huggingface-cli login or HF_TOKEN. Add a model card (README.md) covering intended use, limitations and evaluation.

Source: Hugging Face documentation images.
Exporting for productionβ
Transformers documents exporters and serialisation paths for moving beyond eager PyTorch β see Exporting to production and the Exporters guide. Typical targets:
- ONNX / Optimum for portable graphs
- Runtime-specific formats (TensorRT, ExecuTorch, llama.cpp GGUF via conversion tools)
- Serve with engines that load HF definitions directly (vLLM)
Enterprise checklistβ
- Licence compatible with redistribution
- Model card and eval evidence attached
- Secrets and training data not accidentally uploaded
- Revision tag created for the release
Discussion
Commentsβ
Share feedback or questions about this page. No account required.
Loading commentsβ¦