Model Card Writer
Write or update the Hugging Face model card for a fine-tuned model: the repo's README.md with a YAML metadata block (license, language, library_name, pipeline_tag, base_model, datasets, metrics, tags, and a model-index for eval results) followed by the sections of Hugging Face's model card template. Every value comes from the training config, dataset references, and eval output in the repo; anything the repo cannot support is written as [More Information Needed], and no eval number is ever invented. Use when publishing a fine-tune or adapter to the Hub, or when an existing card has no metadata, no limitations section, or scores nobody can trace.
Point this skill at a fine-tuned model and it writes the Hugging Face model card: a README.md whose YAML block sets license, language, library_name, pipeline_tag, base_model, datasets, and model-index, then the template's sections. Every value comes from the training config and eval files; gaps become [More Information Needed], and no score is invented.
Install to ~/.claude/skills/model-card-writer/SKILL.md
npx agentscamp add skills/model-card-writerOn the Hugging Face Hub, a model card is the README.md in the model repo: Markdown with a YAML metadata section at the top. The metadata is what the Hub works with (filtering by task and license, choosing the inference widget, linking the model to its base model, showing evaluation results), and the Hub validates it when you push the README. The prose tells a reader what the model is for, what it was trained on, how it was evaluated, and where it fails. This skill writes both halves for a model you fine-tuned, taking every fact from the repo: the training config, the dataset references, the eval output, and the base model's own card. When a fact is not in the repo, the card says [More Information Needed], the template's own placeholder, instead of a plausible guess.
When to use this skill
- You trained a fine-tune or adapter and are about to push it to the Hub.
- A model repo has a README with no YAML block, or a YAML block missing
license,base_model, ordatasets. - The card reports eval scores and nobody can say which run, dataset, or split produced them.
- An internal model registry wants the same structure (uses, limitations, training, evaluation) for models that never leave the company.
When NOT to use this skill
- Choosing which base model to fine-tune: the open-model-scout agent shortlists Hub models against license, size, context, and gating constraints.
- Running training or evaluation: the qlora-finetune-runner skill and the finetuning-engineer agent produce the config and held-out results this card reports.
- Dataset cards. A dataset repo's README is a dataset card with its own YAML keys (
task_categories,size_categories,source_datasets, and others); this skill writes model cards only. - Deciding whether a license permits your use. The skill records licenses and flags mismatches; it does not give legal sign-off.
Instructions
-
Inventory the evidence. In the model directory (or the repo root), find the training config (YAML or JSON configs, a training script's arguments, a launch script or
Makefiletarget), the dataset references and preprocessing code, the eval output (result JSON or CSV files, eval logs, saved notebook output), any existingREADME.md, and the license file. Record each fact with the file it came from. This list is the only material the card may use. -
Read the base model's card. Take the base model ID from the training config, then pull that card's metadata and text with the
hfCLI that ships withhuggingface_hub:hf models card <base-model-id> --metadata --format json hf models card <base-model-id> --textNote its
license(pluslicense_nameandlicense_linkif the license isother),language, andpipeline_tag, and any limitations it states. If the license the user intends for the fine-tune differs from the base model's, stop and flag it. Do not pick a license on the user's behalf. -
Write the YAML metadata block at the top of
README.md, between---lines, with the exact keys from the Hub's model card spec:Key What goes in it Where the value comes from licenseA Hub license ID such as apache-2.0; for a custom license,license: otherpluslicense_nameandlicense_link(a URL, orLICENSE/LICENSE.mdfor a file in the repo)the repo's license file and the user's decision languageA list of ISO 639-1 codes ( en,fr)training and eval data library_nameThe library that loads the weights. Set it even for transformers: for model repos created after August 2024 the Hub no longer assumes it, so writelibrary_name: transformersexplicitlythe training and loading code pipeline_tagThe task. It drives task filtering on the Hub and the widget; for transformersmodels it is inferred fromconfig.json, so set it for anything elsethe training objective base_modelOne model ID, or a list of base models the training config base_model_relationOptional: adapter,merge,quantized, orfinetune, when you want to state the relation instead of leaving it to the Hub's inferencehow the weights were produced datasetsHub dataset identifiers ( owner/name); describe private or local data in the text insteadthe data-loading code metricsMetric IDs used in evaluation, for example accuracyorwerthe eval code tagsFree-form discovery tags the user You do not need to add paper tags: the Hub turns arXiv links in the card into
arxiv:<PAPER ID>tags itself. -
Report eval results in
model-index, and only results you can trace. Each result needstask.type,dataset.type,dataset.name, and for each metric atypeand avalue. Adddataset.split,dataset.config, anddataset.revisionwhen the eval output records them. Asourceblock is optional, but once present it needssource.url. Copy every value from an eval output file and note which file in your report. Never round, recompute, average, or fill in a metric. If the repo has no eval output, leavemodel-indexout and write[More Information Needed]under Evaluation > Results. The Hub's newer.eval_results/*.yamlformat is a work in progress as of November 2026, so usemodel-indexunless the repo already uses the new format. -
Write the sections in the template's order. Hugging Face's template (
modelcard_template.mdinhuggingface_hub) runs:# Model Card for <model id>→## Model Details(### Model Descriptionwith Developed by, Funded by, Shared by, Model type, Language(s) (NLP), License, Finetuned from model;### Model Sourceswith Repository, Paper, Demo) →## Uses(### Direct Use,### Downstream Use,### Out-of-Scope Use) →## Bias, Risks, and Limitations(### Recommendations) →## How to Get Started with the Model→## Training Details(### Training Data,### Training Procedurewith Preprocessing, Training Hyperparameters, and Speeds, Sizes, Times) →## Evaluation(### Testing Data, Factors & Metrics,### Results,#### Summary) →## Model Examination→## Environmental Impact→## Technical Specifications→## Citation→## Glossary→## More Information→## Model Card Authors→## Model Card Contact.The template marks Funded by, Shared by, Finetuned from model, Model Sources, Downstream Use, Preprocessing, Speeds/Sizes/Times, Model Examination, Technical Specifications, Citation, Glossary, More Information, and Model Card Authors as optional; drop those when the repo has nothing for them. Keep the rest, with
[More Information Needed]where a fact is missing. -
Fill each section from the evidence.
- Training Hyperparameters: copy the values from the config (learning rate, epochs, batch size, adapter rank and alpha, precision, seed) as a list, and name the config file.
- Training Data: name the dataset by Hub ID, or describe the private source, its size if recorded, and the preprocessing the code actually performs. Do not describe data you cannot see.
- Out-of-Scope Use: the template asks for "misuse, malicious use, and uses that the model will not work well for". Derive the last part from the evidence (languages or domains absent from the training data, input lengths never evaluated) and ask the user to confirm the misuse cases.
- Bias, Risks, and Limitations: the template means both technical and sociotechnical limits. Write the technical ones you can support (data coverage, gaps in the evaluation, limits stated on the base model's card) and leave
[More Information Needed]for a person to complete the rest. - How to Get Started: a minimal loading snippet for the
library_nameyou set. Run it if the environment allows; if you could not, say so in the report. - Environmental Impact: Hardware Type, Hours used, Cloud Provider, Compute Region, Carbon Emitted. Fill hardware and hours from logs when they were recorded. Fill carbon only if someone computed it; the template asks for grams of CO2eq and points to the ML Impact calculator (Lacoste et al., 2019).
-
Validate before anyone pushes. With
huggingface_hubinstalled:from huggingface_hub import ModelCard card = ModelCard.load("README.md") card.validate() # checks the metadata the way the Hub will; needs internet accessFix whatever it reports and run it again. If you would rather generate the card from code,
ModelCard.from_template(card_data, ...)renders the same Jinja2 template from aModelCardDataobject. Pushing (card.push_to_hub(...)or a git push) stays with the user. -
Report. List every metadata key and section as Filled (with its source file), Needs information, or Flagged (a license mismatch, a number with no file behind it).
WARNING
Scores on a model card get copied into comparisons and spreadsheets by people who never see your repo. A number with no eval file behind it is worse than an empty Results section. If the only source for a score is someone's memory or a chat message, write [More Information Needed] and list it in the report.
NOTE
The Hub validates metadata when you push changes to README.md. Running validate() locally catches the same problems before the push, while the training context is still fresh.
TIP
The /model-card command runs this procedure on a model directory from inside Claude Code. If the model is not chosen yet, start with the open-model-scout agent and the open-weights entry for what "open" does and does not promise.
Output
The README.md, written new or edited in place (keeping prose the user already wrote), and a report table with columns Item, Status (Filled, Needs information, Flagged), and Source.
Example
Excerpt for a fictional full fine-tune, acme/support-tone-8b:
---
license: apache-2.0
language:
- en
library_name: transformers
pipeline_tag: text-generation
base_model: acme/acme-base-8b
base_model_relation: finetune
datasets:
- acme/support-replies-2026
metrics:
- accuracy
tags:
- customer-support
model-index:
- name: support-tone-8b
results:
- task:
type: text-generation
dataset:
type: acme/support-replies-2026
name: Acme support replies (held-out)
split: test
metrics:
- type: accuracy
value: 0.81 # copied from eval/heldout_results.json
name: Format accuracy
---
# Model Card for acme/support-tone-8b
## Environmental Impact
- **Hardware Type:** 1x A100 80GB (from logs/train.log)
- **Hours used:** 6.5 (from logs/train.log)
- **Cloud Provider:** [More Information Needed]
- **Compute Region:** [More Information Needed]
- **Carbon Emitted:** [More Information Needed]| Item | Status | Source |
| --- | --- | --- |
| license | Flagged | base model card says `license: other`; the user confirmed apache-2.0, so the pair needs a license review before release |
| model-index accuracy | Filled | eval/heldout_results.json |
| Out-of-Scope Use | Needs information | misuse cases need the owner's confirmation |Filed under
claude · hugging-face · model-cards · fine-tuning · documentation · ai-engineers
Related
- Hugging FaceThe Git-based hub for open models, datasets and Spaces, with serverless Inference Providers, dedicated Inference Endpoints and Apache-2.0 libraries.
- Open Model ScoutUse this agent to shortlist open-weight models on the Hugging Face Hub for a task under hard constraints (license, parameter count or GPU memory budget, context length, language, gated access). It queries the Hub with huggingface_hub or the hf CLI, reads each candidate's model card and license, and returns a comparison table with caveats. It is read-only and never quotes a benchmark number that is not on the card. Examples — "find an Apache-2.0 text-generation model under 10B parameters that handles Spanish", "which non-gated embedding models fit on one 24 GB GPU?", "shortlist code models with long context that we can use commercially".
- Model CardWrite or update the Hugging Face model card (README.md with YAML metadata) for a fine-tuned model directory, using only its training config and eval files and marking every gap as needed.
- Fine-TuningFine-tuning continues training a pretrained model on your own examples, changing its weights to teach durable behavior, format, or domain style.
- Finetuning EngineerUse this agent to fine-tune an open-weight model end to end — confirming fine-tuning is the right tool, preparing the dataset, choosing the method (LoRA/QLoRA vs. full), running training, and proving the result beats the prompted baseline on a held-out eval set. Examples — "fine-tune a small model to match our support tone and answer format", "we have 800 labeled examples — LoRA-tune and show it beats prompting", "our fine-tune overfits and forgot general ability — fix the data and run".
- Open WeightsAn open-weights model publishes its parameters for anyone to download and run — unlike API-only models — with licenses from permissive to restricted.
- Finetune Dataset BuilderTurn raw examples into a training-ready fine-tuning dataset — normalize to the trainer's chat/instruction format, deduplicate (including near-duplicates), strip PII, balance, validate the schema and token lengths, and carve a leak-free eval split. Use when you have raw examples and need a clean, formatted, split dataset before training.
- Qlora Finetune RunnerRun a QLoRA (4-bit LoRA) fine-tune of an open-weight model from a prepared dataset — set up the config, train memory-efficiently (e.g. with Unsloth/PEFT), watch for overfitting, save the adapter, and run a quick eval against the prepared split. Use when you have a clean dataset and want to execute a parameter-efficient fine-tune on a single GPU.