Repository navigation
Releases
v0.1.0
First release. classif asks a local model one question about a text and answers with a label, a probability and an exit code, so a shell pipe can branch on meaning.
git diff --staged | classif -p "Does this change handle secrets or access control?" > review.patchCommands
| Command | Questions | Texts |
|---|---|---|
classif |
1 | 1 |
classif tag |
many | 1, read once |
classif each |
1 | many, printed best first |
Answers are yes, no and unknown by default, your own options with -e, or a grade on ordered levels with -s. -c adds context such as a policy or the date, -p passes the input through when the first label wins, -t sets a probability floor, -w prints the lines the answer rests on, and -j prints JSON. classif completion bash or zsh prints tab completion. The reference covers every flag.
Exit codes
| Exit | Meaning |
|---|---|
0 |
The first label or option won: yes by default |
1 |
Another label or option won, including unknown or none |
2 |
Unscored, for example a connection failure |
3 |
Insufficient evidence or coverage, a deadline cut, or a score below -t |
Requirements
- Python 3.12. No third-party packages.
- Ollama with log-probability support, tested on 0.34.3, at
localhost:11434unlessCLASSIF_HOSTSor~/.config/classif/hostssays otherwise. - The default model,
winnow:12b-q4_K_M, built from Piotr1215/Winnow-12B-GGUF with the Modelfile in the README. It loads in about 8 GB on a 12 GB GPU. Other Ollama models work at different accuracy; CPU is unmeasured. embeddinggemmafor the passage search on long input.
Long input
classif never truncates. Text past the 32,768-token window goes to bounded reads: a passage search for a question one scene settles, a full read for a claim about every line. A "no" from the search means the closest passages do not show it, and the output says so. A full read of a large text takes minutes, and a reader can still dismiss decisive evidence. Architecture lists the recorded costs and limits.
Tests
395 unit tests run against fake Ollama servers and 41 e2e tests replay a recorded cassette, so neither needs a model. CI runs both on Python 3.12 from #3.
MIT licensed. The model card is Apache-2.0.