Local AI Safety Audit

How it works

The short version

A chat model is trained to read text laid out in one exact way. Think of a form where every box has its place. The model’s maker publishes a small program, the chat template, that lays your conversation out in that format.

By the time your words reach a model in Ollama, that layout has been copied twice:

  1. The maker’s original. It lives on the maker’s Hugging Face page.
  2. The copy inside the model file. It’s made when someone converts the model into the GGUF file format that Ollama and similar apps use.
  3. What Ollama actually uses. Ollama packages often carry their own version of the template, in a different language (Go instead of Jinja). A rule inside Ollama decides which one to use.
How a chat template travels from its maker to the model: the maker's template on Hugging Face, the copy in the model file (GGUF), what Ollama runs, then the model. Of the 32 of 43 library models that differ, 24 differ because of Ollama's own version, 6 start with an older copy in the file, and 2 have no template in the file

The project puts the same twelve harmless practice conversations through all three, and compares the exact text the model would receive. When the texts differ, it sorts the difference into a plain category. For example:

What makes the numbers trustworthy

How the check-up decides

The quick check-up is separate from the measurement. It only reads:

It never opens a file’s contents, apart from your models’ chat templates, and it changes no settings.

Running the full measurement yourself

This part is for people comfortable with a terminal. The quick check-up needs none of it.

You need:

Install the project:

pip install -e .

Then run any of these:

tda local
tda library --mapping population/mapping.yaml
tda hf --mapping population/mapping.yaml
tda report runs/<run-id>

The technical record

The design and each stage’s results are kept in the repository, in the order they were made: