Short answer
First list the rights you inherited from your base model, data and code, because they limit which licence you can honestly choose. Then convert the weights to safetensors, write a model card with the licence and base model in its metadata, upload it to a hub such as Hugging Face, and check whether rules like the EU's general-purpose AI obligations apply.
Follow-up question What do you owe others once your model is public?
Publishing a model takes about ten minutes. Working out what you are allowed to publish takes longer. Our guide to open-weight licences explains what licences mean when you download a model. This article takes the other side of the table: you are now the one offering it. It is general information and not legal advice, so for anything you will sell, ask a lawyer about your specific case.
Step 1: list what you inherited
Your model has three parents, and each may have conditions.
| Parent | Example | What it may require |
|---|---|---|
| Base model, if you fine-tuned | Llama 3 | Keep its licence and notice, display "Built with Meta Llama 3", and begin the model's name with "Llama 3" |
| Gemma | Pass on the use restrictions and terms | |
| An Apache 2.0 model | Keep the licence and notices, and mark changes | |
| Training data | ClimbMix | CC BY-NC 4.0: non-commercial, research and development only |
| FineWeb | ODC-By 1.0 attribution, plus Common Crawl's terms | |
| Code | nanochat | MIT: keep the copyright notice |
Here is the trap for this series' readers. A model trained with nanochat's default settings read ClimbMix. The code's MIT licence does not make the weights free for any use. Whether a model's weights count as a derivative of its training data is legally unsettled, so calling such a model "free for commercial use" would be claiming more than you can back up. Say what it was trained on, and label it for research, or retrain on data whose terms match your plans.
Also check your examples for outputs from closed services, whose terms can restrict training on them, as the distillation guide explains.
Step 2: choose a licence
Choose only among those your inheritance allows. The Hub identifier goes in your model card.
| Licence | Hub identifier | Suits |
|---|---|---|
| Apache 2.0 | apache-2.0 | Open use, with an explicit patent grant |
| MIT | mit | The shortest permissive option |
| CC BY-NC 4.0 | cc-by-nc-4.0 | Non-commercial sharing |
| Base model's licence | llama3, gemma | Fine-tunes that must keep it |
| Custom | other, with license_name and license_link | Your own terms, in a LICENSE file |
Avoid writing your own licence unless a lawyer is helping you, and people will hesitate to use a model under terms they have never seen. Remember that "open source" has a specific meaning too: if your terms limit uses or your data stays secret, "open weights" is the accurate phrase.
Step 3: convert the weights
Most PyTorch checkpoints are pickle files, and loading a pickle can run hidden code, which is why people are rightly wary of them. Safetensors is a format that only stores numbers. For a checkpoint that holds a plain dictionary of tensors, such as nanochat's model_*.pt files (pip install torch safetensors numpy):
import torch
from safetensors.torch import save_file
state = torch.load("model_000999.pt", map_location="cpu", weights_only=True)
save_file({k: v.contiguous() for k, v in state.items()}, "model.safetensors")
Weights in a custom format also need your model code and tokenizer files for anyone to run them. Models trained with Hugging Face tools save the right form with save_pretrained, and most people running models locally will want a GGUF file too. In Unsloth, it takes one line:
model.push_to_hub_gguf("your-name/your-model-GGUF", tokenizer, quantization_method="q4_k_m")
Unsloth's documentation notes that a model which works in training and then outputs gibberish elsewhere usually has the wrong chat template or end token, so test the exported file itself.
Step 4: write the card
A model card is the README.md in your repository. The top block is metadata that the Hub uses for search and for showing the licence; the text below is for people. Here is a card for an imagined fine-tune:
---
license: apache-2.0
language:
- fr
- en
base_model: your-base/model-name
datasets:
- your-name/your-dataset
tags:
- fine-tuned
library_name: transformers
---
Then write, in plain language: what it is for, what it is not for, how you trained it, what data you used, your evaluation results with their sample sizes, and known failures. Be direct about limits, for example "invents facts; do not use for medical or legal answers". The base_model field links your work to its origin, and for a fine-tune or adapter that is also a matter of honesty.
Step 5: upload
pip install -U huggingface_hub
hf auth login
hf upload your-name/your-model ./my-model
The command creates the repository if it does not exist. Free accounts get best-effort public storage and 100 GB of private storage. To control access, turn on gating in the model's settings, so that people must request access and optionally answer questions. If you collect their details, you become responsible for handling that personal information properly.
Try it: Before training your next model, fill in the Step 1 table for it. If any cell says "unknown", resolve that first, because it may change the data you train on and save you a full run.
What do you owe others once your model is public?
What your licence promises. Keep notices intact, and respond if someone reports a real problem, such as personal information that the model reveals.
In the European Union, rules can apply even to providers elsewhere if the model is placed on the EU market. Commission guidelines treat models trained with more than 10^23 floating-point operations, which can generate language, as indicatively general-purpose AI models. nanochat's speedrun, at about 4×10^19, is far below that, while the Commission says the line corresponds to one-billion-parameter models trained on large datasets. Fine-tuning makes you a provider only if the change used more than a third of the original model's training compute. Free and open-source releases are exempt from some documentation duties, but must still have a copyright policy and publish a summary of training content. The Commission's enforcement powers have applied since August 2, 2026.
In Canada, there is no equivalent law specific to general-purpose models in force today. Copyright and privacy law still apply: the federal government says it is working toward amending the Copyright Act for generative AI, and privacy authorities' principles cover personal information in these systems. See our overview of how Canada regulates AI.
Honesty about what it is. Publish your scores with the method, report the data you can name, and correct the card when someone finds a problem. Those who download your model cannot see how you built it, except through what you tell them.
Sources
- Model Cards — Hugging Face
- Licenses — Hugging Face
- Guidelines on obligations for general-purpose AI providers: questions and answers — European Commission
From the Guide to Artificial Intelligence, by Robert Scales, published by Holistic Hybrid Inc. Share and adapt it under CC BY-NC-SA 4.0: credit the guide, link to https://guidetoartificialintelligence.com/en/learn/publish-licence-your-model/, no commercial use without permission, and keep the same licence.