Sub topic 3
Model details: version, type, license, and contacts
Prerequisites and scope
This chapter assumes you know basic supervised learning, can read Python and Markdown, and use Git. It covers the "Model details" section of a model card: the facts that identify a model and say who owns it, how it was built, and under what terms it can be used. Later chapters cover intended use, training data, and evaluation.
The model details section answers one question: what exactly is this artifact? A reader who finds a file named model.pkl or a hub entry called classifier cannot trust any other part of the card until they know which model the card describes.
What belongs in the model details section
The 2019 paper "Model Cards for Model Reporting" lists basic information about the model first. In practice, the following fields cover what readers need.
| Field | What it states | Why a reader needs it |
|---|---|---|
| Name | The stable identifier of the model | Lets people refer to the same thing |
| Version | Which release this card describes | Ties metrics and limits to one artifact |
| Date | When this version was trained or released | Helps judge how stale the data and assumptions are |
| Model type | Architecture, task, input and output format | Tells integrators what the model consumes and returns |
| Base model | The pretrained model this one was fine-tuned from, if any | Exposes inherited licenses, data, and biases |
| Training framework | Library and version used | Needed to load and reproduce the model |
| License | Terms of use for the weights and code | Decides whether you may use it at all |
| Contacts | Owner team and a way to report problems | Gives users somewhere to send questions and incidents |
| Citation | How to reference the model | Supports research and audit trails |
Keep this section short and factual. Opinions about quality belong in the evaluation and limitations sections.
Naming and versioning
Choose a stable name
The name should identify the model's purpose and not change between releases. support-ticket-classifier is a good name. model-final-v2-new is not, because it describes a moment in someone's workflow.
Version the artifact, not just the code
A model release depends on at least four things: the code, the training data snapshot, the hyperparameters, and the random seed. A change in any of them can change behavior. The version number on the card must refer to the trained artifact that users download or call.
Semantic versioning (MAJOR.MINOR.PATCH) works well if you define what each part means for a model. One workable convention:
- MAJOR: the input or output contract changed, or the task changed. Downstream code may break.
- MINOR: retrained on new data or with a new architecture, same contract. Metrics may move.
- PATCH: packaging or metadata fix, with weights unchanged.
Write your convention down in the card or a linked document. Without it, 1.2.0 to 1.3.0 tells the reader nothing about the risk of upgrading.
Bind the card to the weights with a hash
A version string can be reused by mistake. A checksum of the weights file cannot. Recording a SHA-256 digest in the card lets anyone confirm that the file they hold is the one the card describes.
import hashlib
from pathlib import Path
def sha256_of(path: str, chunk_size: int = 1 << 20) -> str:
digest = hashlib.sha256()
with Path(path).open("rb") as f:
while chunk := f.read(chunk_size):
digest.update(chunk)
return digest.hexdigest()
if __name__ == "__main__":
Path("demo_weights.bin").write_bytes(b"example weights")
print(sha256_of("demo_weights.bin"))The function reads the file in 1 MiB chunks, so it works for multi-gigabyte weights without loading them into memory.
Model type
State the model type in terms a downstream engineer can act on. A useful description has four parts:
- Task, for example multiclass text classification.
- Architecture, for example a DistilBERT encoder with a linear classification head.
- Input contract, for example UTF-8 text up to 512 tokens, English.
- Output contract, for example a probability for each of five queues, summing to 1.
The input and output contract matters more than the architecture name. Someone who calls the model needs to know the label set and order, whether outputs are calibrated probabilities or raw scores, and what happens to inputs that exceed the length limit.
Record the lineage
If you fine-tuned a pretrained model, name it and its version. This is the base model field. It matters for three reasons:
- The base model's license may restrict your model's license.
- The base model's training data and known biases carry over into your model.
- A vulnerability or recall notice for the base model affects every model built on it.
If you used a model only for labeling or distillation, say so too. Those relationships create the same inheritance problems even though the weights were not copied.
License
The license field is often the most consequential line in the card. A user who cannot tell whether they may use the model commercially will either avoid it or use it unlawfully.
Be specific
Use an identifier from the SPDX license list where one exists, such as apache-2.0 or mit. For licenses that are not standard, such as the OpenRAIL family or a custom community license, link to the full text and summarize the restrictions that matter most.
Separate the layers
A model release has several parts that may each carry different terms:
| Layer | Example question |
|---|---|
| Source code | Under what license is the training and inference code released? |
| Weights | May the weights be used commercially, redistributed, or fine-tuned? |
| Training data | Does the data's license limit the model's use? |
| Outputs | Does the license restrict how generated outputs may be used? |
Stating one license for "the model" hides these distinctions. If they differ, list each one.
Check compatibility with the base model
Your license cannot grant more rights than you received. If the base model carries a non-commercial license, a fine-tuned derivative generally cannot be released for commercial use. Check the base license before choosing yours, and have a legal reviewer confirm any uncertain case. The card documents the decision; it does not replace legal advice.
Contacts and ownership
A model with no named owner will not receive fixes. The card should say who is responsible and how to reach them.
- Owner: a team name, not only an individual. People change jobs, and a card that points to a departed person is worse than no contact.
- Reporting channel: a shared mailbox, issue tracker, or on-call alias.
- Escalation or security contact, if different, for reports of harmful behavior or vulnerabilities.
- Expected response, if you can promise one, for example "triaged within five business days".
Use role-based addresses such as [email protected] and review them whenever teams reorganize. Do not put personal phone numbers or private addresses in a card that will be published.
Generating the section from data
The details section is structured, so you can keep it as data and render it. This avoids drift between the card and the real release. The example below extends the idea from the model card dataclass shown in the overview of this tutorial, applied only to the details fields.
from dataclasses import dataclass, field
@dataclass
class ModelDetails:
name: str
version: str
release_date: str
model_type: str
base_model: str
framework: str
license: str
owner: str
contact: str
weights_sha256: str
citation: str = ""
extra_licenses: dict = field(default_factory=dict)
def to_markdown(self) -> str:
lines = [
"## Model details",
"",
f"- Name: {self.name}",
f"- Version: {self.version}",
f"- Release date: {self.release_date}",
f"- Model type: {self.model_type}",
f"- Base model: {self.base_model}",
f"- Framework: {self.framework}",
f"- License (weights): {self.license}",
]
for layer, value in self.extra_licenses.items():
lines.append(f"- License ({layer}): {value}")
lines += [
f"- Owner: {self.owner}",
f"- Contact: {self.contact}",
f"- Weights SHA-256: {self.weights_sha256}",
]
if self.citation:
lines.append(f"- Citation: {self.citation}")
return "\n".join(lines) + "\n"
details = ModelDetails(
name="support-ticket-classifier",
version="1.2.0",
release_date="2026-11-30",
model_type="DistilBERT encoder with a 5-class linear head",
base_model="distilbert-base-uncased",
framework="PyTorch 2.4",
license="apache-2.0",
owner="ML Platform team",
contact="[email protected]",
weights_sha256="0" * 64,
extra_licenses={"code": "mit"},
)
print(details.to_markdown())The placeholder hash of 64 zeros is for illustration. In a real pipeline, compute it with sha256_of on the released file.
How the pieces fit together
The details section links the card to the artifact, the lineage, and the people.
Common errors
- Missing or reused version. Two different weight files share
1.0because someone overwrote a release. Fix: never overwrite a published version, and record the hash. - Version describes the code only. The Git tag moved but the data changed silently. Fix: tag the data snapshot and record it alongside the version.
- Vague model type. "A neural network for text" gives an integrator nothing. Fix: state the task, the input and output contract, and the label order.
- Unstated base model. The derivative inherits restrictions that the card never mentions. Fix: always fill in the base model field, or write "none (trained from scratch)".
- One license for everything. Code, weights, and data have different terms. Fix: list each layer.
- Stale contact. The listed person has left. Fix: use a role-based alias and review it on a schedule.
- Date without meaning. A release date alone does not say when the training data ended. Fix: record the data cutoff in the training data section and refer to it.
Edge cases
- Ensembles and pipelines. If a release contains several models, either give each its own details entry or describe the pipeline as the unit and list its components with their versions. Do not report one version for a bundle of independently changing parts.
- Models served only through an API. Users cannot download weights, so a hash does not help them. Record the model identifier the API reports and a deprecation policy, and state how users are told about silent updates.
- Models that update continuously. If weights are retrained on a schedule, give each retrain a version or a date-based identifier. A card that says "latest" cannot be audited later.
- Third-party models you only wrap. Document the upstream model, its version, and its license, and say clearly that your team does not own the weights.
- Withdrawn models. If a version is recalled, keep its card, mark it as withdrawn with the reason, and point to the replacement.
Exercises
Exercise
A teammate fine-tunes a base model released under a non-commercial license and plans to publish the result as apache-2.0 for a commercial product. Which fields of the model details section should expose this problem, and what should you do?
Show answer
The base model field should name the upstream model and its version, and the license field should be checked against the base model's license. A non-commercial base license generally prevents a derivative from being licensed for commercial use, so the plan conflicts with it. Do not publish under apache-2.0. Choose a license that is compatible with the base model's terms, or switch to a base model whose license permits commercial use, and have a legal reviewer confirm the decision.
Exercise
Your card says the model is version 2.0.0, but a user reports different predictions from a file they downloaded last month under the same version. What went wrong in the details section, and how would you prevent it?
Show answer
The version was reused for different weights, and the card has no checksum to tell the files apart. Prevention: never overwrite a published version, publish changes under a new version, and record the SHA-256 digest of the weights in the card so users can confirm which file they hold. A CI check can recompute the hash and compare it to the card.
Exercise
Write the model type description for a binary fraud classifier so that an integrating engineer can call it correctly. Name the four parts to include.
Show answer
Include the task (binary classification of card transactions), the architecture (for example gradient-boosted trees), the input contract (a fixed list of named numeric and categorical features with units and allowed ranges), and the output contract (a probability of fraud between 0 and 1, whether it is calibrated, and the threshold the owners recommend). The input and output contracts matter most for integration.