Push the adapter, not the merged model
model.push_to_hub("your-name/support-hi-lora")
tok.push_to_hub("your-name/support-hi-lora")A LoRA adapter is a few megabytes. The merged model is several gigabytes of mostly somebody else’s weights, republished. Publish the adapter:
- It is honest about what you made.
- It is fast to download and cheap to store.
- It stays usable when the base is updated, and it makes clear which base it needs.
- Several adapters can share one loaded base at serving time.
Publish a merged version as well only when there is a reason: a serving stack that cannot load adapters, or a GGUF conversion for people running on CPUs. Say in the card that it is a merge of your adapter and name the base.
The adapter card
adapter_config.json records base_model_name_or_path, and the Hub uses it to link your repository to its parent. Add the metadata that makes it findable and usable:
---
base_model: Qwen/Qwen2.5-7B-Instruct
library_name: peft
tags:
- lora
- sft
language:
- hi
- en
license: apache-2.0
datasets:
- your-name/support-conversations
---The license field needs a moment’s thought and the next module covers it properly. The short version: your adapter inherits obligations from the base model’s licence. A LoRA trained on a model with a restrictive licence does not become permissive because you wrote Apache 2.0 in your own front matter. State the base’s terms as well as your own.
What the prose must contain
Six things, and a card without them is not usable by a stranger:
- A runnable snippet, with the base model named and the revision pinned:
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct",
dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(base, "your-name/support-hi-lora")
tok = AutoTokenizer.from_pretrained("your-name/support-hi-lora")- What it was trained on: how many examples, from where, in what languages, and the dataset repository if you can publish it.
- The training configuration: rank, alpha, target modules, learning rate, epochs, base precision. Six lines, and without them nobody can reproduce or extend your work.
- A measured result. Even “macro-F1 0.78 on 300 held-out tickets, against 0.61 for the base model” is infinitely better than “works well”. Say what the baseline was.
- A named limitation. The thing it does badly, from your own testing. Every model has one and a card without one reads as untested.
- Whether the training data contained personal information, and what you did about it.
Before you push
- Check for secrets in the output directory. A
.env, a notebook with a token in a cell, a config with a connection string.git statusinoutput_dirbefore uploading, and useignore_patternsonupload_folder. - Check for training data you cannot publish. Checkpoint directories sometimes contain a copy of the tokenised dataset.
- Start private. Make it public when you have read your own card back.
Serving several adapters on one base
model.load_adapter("your-name/support-hi-lora", adapter_name="hi")
model.load_adapter("your-name/support-ta-lora", adapter_name="ta")
model.set_adapter("hi")One base in memory, several behaviours, switched per request. For a product serving several languages or several customers, this is the architecture that makes fine-tuning affordable: one 14 GB base and a directory of 20 MB adapters, rather than one 14 GB model per variant.
The maintenance you are signing up for
An adapter is pinned to its base. When a better base arrives in a few months, your adapter does not transfer: the weight shapes may match and the behaviour will not, because the thing it learned to correct has changed. You retrain.
This is why the dataset matters more than the adapter. Keep the training data, the configuration and the evaluation set in a repository, and retraining against a new base is an afternoon. Keep only the adapter and you are starting again.
Do this now
Publish an adapter privately, then open it in a fresh Colab session and load it from the card’s snippet alone. If it does not work, your card is wrong, and that is exactly the test every model card should have to pass before it goes public.
Every lesson here is open. Your progress is recorded once you pass the Image Generation, in Practice exam.
Check your understanding
Why is publishing a LoRA adapter generally preferable to publishing the merged full model?
Pick the one you would defend. Your answer stays private.
Stuck on something?Ask Arjun, your AI tutor
