Pedigree tells you which licence terms an open model inherits from the models it was built on, before you or your coding agent download it. It is for the platform engineer who adds a model to a product, and for the coding agent that writes the line that loads it. The family tree of 213,928 Hugging Face models is one Relate file, and every answer is Cypher on it: which licence, from which ancestor, by which path, under which clause. On the Hub, 12,038 third-party models inherit Llama 3.1's terms, and 2,516 of them declare that licence.

The pedigree of a fine-tune of a merge of nine 70B models, each with its licence stamp

Inspiration

I led AI use cases for an internal-audit function, and the first question about any open model was what we were allowed to do with it.

The model card answers with one licence. An open model on Hugging Face is rarely an original, though. It is a fine-tune of an instruct model, quantised by someone else, merged with a third model. The terms that travel with it come from every model it was built on. Llama 3.1 asks a derivative to display "Built with Llama" and to begin its name with "Llama". Gemma passes its prohibited-use policy down. Qwen's research licence allows research and evaluation only.

The Hub records the family tree: every card that names a base model is tagged base_model:finetune:, adapter:, merge: or quantized:. That is a graph, and the question is a walk up it.

What it does

Give Pedigree a model id. It returns every obligation the model inherits, the nearest ancestor whose licence carries it, the path to that ancestor, and the clause quoted from the licence text. It flags three things:

  1. Declared terms that differ from upstream terms. An upstream term differs when the declared licence has no term of the same kind in the same words. Hermes 3 declares Llama 3 and is a fine-tune of Llama 3.1: the two licences word attribution and naming differently, so those two are flagged and the others are not.
  2. The naming clause. A fine-tune, adapter or merge under Llama 3.1, 3.2 or 3.3 whose name does not begin with "Llama".
  3. Non-commercial terms upstream, such as the Qwen Research License or CC BY-NC 4.0.

A model that declares license:other names its licence only in its card, so Pedigree reports it as such and claims no difference.

Licence Third-party models that inherit its terms Declare the same licence Declare another Declare none
Gemma 18,201 4,435 6,616 7,150
Llama 3.1 12,038 2,516 4,697 4,825
Llama 3.2 8,598 2,415 2,490 3,693
Llama 3 4,336 1,858 1,231 1,247

Among third-party fine-tunes, adapters and merges, 4,662 of 10,366 under Llama 3.1 begin their name with "Llama". 6,363 models sit below a model under the Qwen Research License.

How I built it

How Relate is used

The graph is one file, pedigree.rl. It is rebuilt from a daily public snapshot of the Hub, so it ships as one versioned file that a coding-agent hook, CI or a notebook opens read-only.

(:Model {id, licence, downloads})-[:DERIVED_FROM {relation}]->(:Model)   finetune | adapter | merge | quantized
(:Model)-[:DECLARES]->(:Licence {id, name})
(:Licence)-[:REQUIRES]->(:Obligation {kind, clause, text, source})
  • Python, embedded (relate-db 1.0.1): the builder writes 213,928 models and 220,768 lineage edges, and relate clone compacts the file to 16.5 MB.
  • Cypher ANY SHORTEST quantified paths: a model's inherited terms are one statement, a shortest path up DERIVED_FROM to each ancestor, then its licence and obligations. A full check took 0.6 milliseconds at the median over 24 models.
  • Read-only opens: the CLI, the hook and the MCP server never write.
  • WebAssembly (@relate/relate-wasm): the live page loads a slice of 1,280 models and runs the same Cypher in the tab; a parity test checks 9 of 9 models against the Python engine.
  • CLI and MCP: relate --database pedigree.rl explores the graph, and relate serve --mcp serves it read-only.

The data

Lineage comes from the 914,842 model cards of librarian-bots/model_cards_with_metadata, pinned at commit be6e076. Only the lineage columns are read, never the card text. The parser resolves ids written with other casing, drops the 1,235 cards that name the model as its own base, and keeps two parents for a merge. The obligations table holds 41 obligations from 14 licences, each with its clause, a quote and the source URL. I committed it before the engine existed.

Agents

  • A pre-download hook for coding agents. Before any command or file edit, it finds the model ids the agent is about to download, in nine forms (from_pretrained, pipeline, hf download, snapshot_download, vllm serve, ollama run hf.co/... and more), and returns their inherited terms.
  • An MCP server with four tools, and an agent skill that tells the agent to quote the clause the tool returns.

In a real session, I asked a coding agent to write serve.py loading Hermes 3 for a product's chat feature. The hook returned the Llama 3.1 terms before the file was written, and the agent stopped to ask before shipping them.

The page tracing three models: a fine-tune of Llama 3.1, a merge family with three Llama licences, and a model below a research-only licence

Evaluation

Qwen 3.8 Flash answered the same question about 21 real models, three times each: which licences' terms does this model inherit? The models were chosen by a fixed rule, and the answers came from the graph, committed before the model ran.

How the model answered Correct Median seconds per answer Output tokens per answer
Reading the model's own Hugging Face card 27 of 63 63 9,003
Calling the Pedigree tools on Relate 63 of 63 27 766

On the 5 models whose family tree carries more than one licence, the card gave 0 of 15 right answers; the tools gave 15 of 15.

Challenges I ran into

Gated models. Every Meta Llama model is gated, and the snapshot leaves gated repositories out, so thousands of fine-tunes named a base model that was not a row. The Hub API lists gated models with their licence and base tags, and adding the five families' 775 own models closed the gap.

Dense merge families. One family of merges has 426 descendants and far more paths than ancestors. A plain variable-length match enumerated every path and reached Relate's 256 MB value limit. ANY SHORTEST keeps one path per ancestor and answers in milliseconds.

Agent code. In the real session, the agent put the id in a constant, MODEL_ID = "...", then called from_pretrained(MODEL_ID). The hook now reads every quoted id in code that calls a loader, and a test covers it.

Accomplishments that I'm proud of

  • One file holds the family trees of five model families on the Hub, and one Cypher statement answers the question an auditor asks first.
  • A real coding agent was stopped before the code that loads the model was written.
  • 46 tests cover 99% of the decision core's lines and 95% of its branches, and 9 browser tests drive the page in Chromium with an axe-core scan.

What I learned

A licence travels along edges. The card shows one node; the obligations sit two or three steps up, in a merge parent or the instruct model below a quantisation. Reading the card, a capable model got every multi-licence family wrong.

What's next

  • Rebuild pedigree.rl daily from the snapshot in CI and publish it as a release asset.
  • Add licences to the obligations table as families publish new ones.
  • Check a whole repository's model ids in one CI step.

Built With

Share this project:

Updates

Submission history