9 Downloads Updated 2 weeks ago
ollama run pointbreaklab/knot-ai
A task-specific model that reads a code diff and writes the commit message.
Fine-tuned from Qwen/Qwen2.5-Coder-7B-Instruct.
Runs 100% locally - no API, no data leaves your machine. It powers hands-free
auto-commit in Knot, a peer-to-peer version
control system by PointBreakLab.
git diff → Conventional-Commit messagesafetensors) + LoRA GGUF (llama.cpp / Ollama)Knot AI does one thing well: turn a diff into a clear, correctly-typed Conventional-Commit message. It is not a chat assistant or a general coding model - feed it a diff, get a message. That focus is the point: a small, private, owned specialist you run on your own hardware.
Inference: git diff (+ light file context) → prompt → Qwen2.5-Coder-7B + Knot AI LoRA → commit message
Training: permissively-licensed public repos → mine (diff→message pairs) → filter + rebalance → QLoRA SFT → LoRA adapter → GGUF
Two held-out gold sets of 60 hand-reviewed commits each (the model never saw them), scored through the shipping GGUF path. Three models compared under one identical harness:
| Metric | Base Qwen | Knot AI v3 | Knot AI (v4) |
|---|---|---|---|
| Type accuracy | 0.0% | 40.0% | 55.0% |
| Title word-overlap | 0.4% | 18.3% | 30.3% |
| Exact title | 0.0% | 0.0% | 6.7% |
| Exact full message | 0.0% | 0.0% | 6.7% |
| Scope accuracy | 0.0% | 70.0% | 75.0% |
| Unparseable replies / 60 | 59 | 4 | 0 |
The base model is not “bad at commits” - zero-shot with the same prompt it returns unstructured prose 59 times out of 60, so it can’t be wired into an automated pipeline at all. Fine-tuning’s first job is to make the reply reliably parseable (59 → 4 → 0 errors); its second is to pick the right type.
| Type | n | Base | v3 | Knot AI (v4) |
|---|---|---|---|---|
| chore | 6 | 0% | 83% | 100% |
| ci | 6 | 0% | 67% | 100% |
| feat | 6 | 0% | 33% | 83% |
| fix | 6 | 0% | 67% | 83% |
| test | 5 | 0% | 80% | 80% |
| docs | 6 | 0% | 83% | 67% |
| perf | 6 | 0% | 0% | 50% |
| build | 5 | 0% | 0% | 0% |
| refactor | 6 | 0% | 0% | 0% |
| style | 6 | 0% | 0% | 0% |
| revert | 2 | 0% | 0% | 0% |
Honest read: strong on the high-signal types (chore, ci, feat, fix, test); still developing on the inherently ambiguous ones - refactor vs feat, build vs chore, style, revert - which is exactly what v5 targets.
| Language | n | Base | v3 | Knot AI (v4) |
|---|---|---|---|---|
| Rust | 20 | 0% | 10% | 55% |
| Go | 20 | 0% | 55% | 45% |
| Python | 20 | 0% | 55% | 60% |
The added multilingual training pays off: Knot AI holds ~53% type accuracy overall on this separate Rust/Go/Python set - close to its 55% JS/TS score - and lifts Rust from 10% → 55%, where the base model still scores 0% (unparseable).
Note: these are single-reference metrics - they compare to one human label, though a commit has many valid messages and a change can honestly be
fixorrefactor. So the scores understate real usefulness; sample outputs below are representative.
Sample outputs
| Change | Knot AI |
|---|---|
| Added a divide-by-zero guard | fix: prevent division by zero |
| Added a new function | feat: add divide function |
ollama run pointbreaklab/knot-ai "$(git diff --staged)"
llama-server --model qwen2.5-coder-7b-instruct-q4_k_m.gguf \
--lora knot-ai-lora-f16.gguf
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "Qwen/Qwen2.5-Coder-7B-Instruct"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, "pointbreaklab/knot-ai")
This is v1 (built on Knot AI’s v4 adapter). A v5 is planned - a larger, higher-quality corpus for better accuracy and closer matching, with a focus on the ambiguous types (refactor / build / style / revert). Knot AI improves in the open.
Built on Qwen2.5-Coder-7B-Instruct (Apache-2.0) by Alibaba Qwen. Knot AI is a LoRA fine-tune by PointBreakLab, trained only on permissively-licensed public commit history.