CodeSync Knack
The local decision model behind CodeSync.
Every time you send CodeSync a message or it runs a shell command, it makes quick local judgments: Is this command risky? Does it start a server? What kind of error is this? Is a decision about to cost money or touch an external system? Knack runs locally with no API key, no cloud calls, and low latency.
Quick start (Ollama)
Install Ollama and pull the edition you need from ollama.com/devshub/knack:
ollama pull devshub/knack # v3 specialized (0.75B, 29 core command/turn ids, 816 MB)
ollama pull devshub/knack:v5 # v5 specialized (0.75B, 14 operational ids, 816 MB)
ollama pull devshub/knack:4b # 4B general decision model (any question + 10 Tier 2 ids, 2.7 GB)
Examples
Each command passes sample text as the last argument for Knack to judge. Nothing inside the quotes is executed.
General plain-English and safety decisions (devshub/knack:4b):
# Ask any plain-English yes/no question
ollama run devshub/knack:4b \
--ask "Is the mentioned city in Europe?" \
"The server is in Paris."
# -> yes 87%
# Classify text into custom choices
ollama run devshub/knack:4b \
--ask "What kind of ticket is this?" \
--choice bug_fix --choice feature --choice docs \
"Crash on login when email has uppercase letters"
# -> bug_fix 86%
# Check whether an action involves spending money (built-in Tier 2 id)
ollama run devshub/knack:4b \
--ask ask.cost \
'Rent a B300 GPU on Vast.ai for $8/hr? Options: Rent, Cancel'
# -> yes 67%
Core message and command decisions (devshub/knack):
# Classify a user request
ollama run devshub/knack \
--ask task.intent \
--choice bug_fix --choice feature --choice refactor --choice api_schema --choice config_deploy \
--choice test --choice documentation --choice investigation --choice unknown \
"fix the failing login test"
# -> bug_fix 90%
# Check whether a command string starts a long-lived server (text is judged, not run)
ollama run devshub/knack --ask serves "npm run dev"
# -> yes 97%
# Score the risk level of a command string
ollama run devshub/knack \
--ask risk \
--level safe --level "needs care" --level destructive \
"git push --force origin main"
# -> destructive 96% 1.9 / 2
Operational v5 decisions (devshub/knack:v5):
# Classify a tool or API error
ollama run devshub/knack:v5 \
--ask error.kind \
--choice api_rate_limit --choice api_overloaded --choice api_auth \
--choice tool_timeout --choice permission_denied --choice file_not_found \
--choice network_error --choice context_overflow --choice unknown \
'{"error_message":"429 Too Many Requests: rate limit exceeded"}'
# -> api_rate_limit 98%
# Check whether a file path is sensitive or critical
ollama run devshub/knack:v5 --ask file.critical ".env.production"
# -> yes 77%
# Check whether a status update still has unfinished work
ollama run devshub/knack:v5 \
--ask pending_work \
"Fixed the test and committed. Still need to update the migration script."
# -> yes 95%
API
cURL
curl http://localhost:11434/v1/systemone \
-H "Content-Type: application/json" \
-d '{
"model": "devshub/knack",
"state": "npm run dev",
"questions": {
"serves": {"type": "noul", "instructions": "serves"},
"long_running": {"type": "noul", "instructions": "long_running"}
}
}'
Python
import ollama
response = ollama.systemone(
model="devshub/knack",
state="npm run dev",
questions={"serves": {"type": "noul", "instructions": "serves"}},
)
print(response.answers["serves"].noul) # 0.9701
Editions and tags
| Tag | Size | Type | What it covers |
|---|---|---|---|
latest, v3, q8_0 | 816 MB | Specialized (0.75B, Q8_0) | 29 core shell-command and user-turn ids |
q4_k_m | 515 MB | Specialized (0.75B, Q4_K_M) | Same 29 v3 ids, smaller footprint |
v5 | 816 MB | Specialized (0.75B, Q8_0) | 14 v5 Tier 1 operational ids (error.kind, file.critical, pending_work, stuck, verification, etc.) |
v5-q4_k_m | 515 MB | Specialized (0.75B, Q4_K_M) | Same 14 v5 Tier 1 ids, smaller footprint |
4b, 4b-q4_k_m | 2.7 GB | General (4B, Q4_K_M) | Any plain-English yes/no or choice question + 10 Tier 2 ids (ask.*, loop, related, real_failure, etc.) |
4b-q8_0 | 4.5 GB | General (4B, Q8_0) | Higher-precision quantization of the 4B general model |
The specialized 0.75B tags (latest, v5) accept only their trained question ids and reject
unknown questions. Use devshub/knack:4b when you want to ask arbitrary plain-English questions.
Question ids
v3 (devshub/knack) - 29 ids:
- Shell commands (8):
risk,long_running,serves,activity,verifies,mutates_repo,deploys,runtime_check - User turns (21):
turn.chat_or_task,turn.actionable,turn.question_shaped,turn.change_intent,turn.new_task,turn.resume,turn.mission,turn.plan_authoring,turn.screencast,turn.demo,turn.skip_orientation,task.intent,task.execution_strategy,route.mode,route.tier,route.thinking,route.risk,browser,messaging,delivery.feature_task,delivery.slash_task
v5 Tier 1 (devshub/knack:v5) - 14 ids:
pending_work,file.critical,qa.kind,completion.intent,web.continuation,ask.redundant,stuck,quality,graph.edge_intent,task.hard_work,provider.failure_kind,error.kind,tool.activity_label,verification
Tier 2 (devshub/knack:4b) - 10 built-in ids + any plain-English question:
ask.cost,ask.destructive,ask.external,ask.out_of_scope,ask.security,loop,citation.relation,related,delivery.feature_task,real_failure
Passing wrong --choice or --level flags to a specialized tag prints the exact expected flags.
Benchmarks
v5-unified two-tier bundle (CodeSync runtime, locked gold set)
CodeSync ships knack-v5-unified.tar.gz (3.28 GB), combining Tier 1 (0.8B Q8_0 + 2 LoRAs,
~0.57 GB VRAM, p50 11.5 ms) and Tier 2 (4B Q4_K_M + 2 split LoRAs, ~2.75 GB VRAM, p50 88.9 ms)
over local llama.cpp:
Split (locked verified_gold.jsonl) | Knack v5-unified | Remote Jev | clef:27b |
|---|---|---|---|
| Tier 1 (14 questions, 2,276 rows) | 94.8% | 87.2% | 80.6% |
| Tier 2 (10 questions, 1,940 rows) | 94.7% | 91.4% | 89.4% |
| Overall (24 questions, 4,216 rows) | 94.8% | 89.1% | 84.7% |
v3 core set (29 questions, November 2026)
| Benchmark | Knack v3 | Ollama Q8_0 | Ollama Q4_K_M | Scope |
|---|---|---|---|---|
| Hand-labelled set | 97.9% | 97.9% | 97.4% | 233 hand-labelled decisions |
| Held-out set | 95.5% | 95.7% | 95.7% | 3,267 real-session decisions |
| Rare-case set | 93.7% | 93.6% | 93.6% | 4,120 hard/rare decisions |
| Median latency | 13 ms | 17 ms | ~17 ms | 8 command questions on a laptop GPU |
Use inside CodeSync
Install CodeSync and Knack is downloaded and enabled automatically:
curl -fsSL https://devshub.ai/cli/install.sh | bash
To disable local Knack inference: CODESYNC_KNACK_DISABLED=1.
Files in this repo
| File | Purpose |
|---|---|
knack-v5-unified.tar.gz | CodeSync two-tier local llama.cpp bundle (Tier 1 + Tier 2 + LoRAs) |
knack-v3-Q8_0.gguf, knack-v3-Q4_K_M.gguf | Standalone v3 Ollama / llama.cpp decision GGUFs |
knack.py | Zero-dependency Python CLI for running all v3 questions at once |
manifest.json | Release metadata used by CodeSync's auto-updater |