Instructions to use devshub-ai/knack with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use devshub-ai/knack with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf devshub-ai/knack:Q4_K_M # Run inference directly in the terminal: llama cli -hf devshub-ai/knack:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf devshub-ai/knack:Q4_K_M # Run inference directly in the terminal: llama cli -hf devshub-ai/knack:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf devshub-ai/knack:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf devshub-ai/knack:Q4_K_M
Use Docker
docker model run hf.co/devshub-ai/knack:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use devshub-ai/knack with Ollama:
ollama run hf.co/devshub-ai/knack:Q4_K_M
- Unsloth Desktop
- Pi
How to use devshub-ai/knack with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devshub-ai/knack:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "devshub-ai/knack:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use devshub-ai/knack with Docker Model Runner:
docker model run hf.co/devshub-ai/knack:Q4_K_M
- Lemonade
How to use devshub-ai/knack with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull devshub-ai/knack:Q4_K_M
Run and chat with the model
lemonade run user.knack-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use devshub-ai/knack with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devshub-ai/knack:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default devshub-ai/knack:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use devshub-ai/knack with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf devshub-ai/knack:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "devshub-ai/knack:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Docs: specialized decision model, ask by id, precise meanings, known weak spots
Browse files
README.md
CHANGED
|
@@ -12,12 +12,12 @@ inference: false
|
|
| 12 |
|
| 13 |
# CodeSync Knack
|
| 14 |
|
| 15 |
-
**
|
| 16 |
|
| 17 |
Every time you send CodeSync a message or it runs a shell command, it makes dozens of quick
|
| 18 |
calls: Is this command risky? Will it run forever? Are you asking to continue earlier work?
|
| 19 |
Is this a question or a task? Which mode fits? Knack makes those calls on your own machine,
|
| 20 |
-
in about 10 milliseconds.
|
| 21 |
|
| 22 |
- **Free.** Ships with every CodeSync install. No API key, no account, no usage limits.
|
| 23 |
- **Private.** Runs locally. Your prompts and commands never leave your machine to be judged.
|
|
@@ -27,45 +27,7 @@ in about 10 milliseconds.
|
|
| 27 |
rare cases that cost the most when missed: destructive deletes, commands that never exit,
|
| 28 |
resuming interrupted work, refactor / test / documentation requests.
|
| 29 |
|
| 30 |
-
##
|
| 31 |
-
|
| 32 |
-
You need [Ollama](https://ollama.com/download) running. Nothing else to install: the script
|
| 33 |
-
uses only the Python standard library and pulls the model on first run.
|
| 34 |
-
|
| 35 |
-
```bash
|
| 36 |
-
curl -fsSL https://huggingface.co/devshub-ai/knack/resolve/main/knack.py | python3 - "npm run dev"
|
| 37 |
-
```
|
| 38 |
-
|
| 39 |
-
```
|
| 40 |
-
risk 1 0.95 0 safe, 1 needs care, 2 destructive / dangerous
|
| 41 |
-
long_running yes 0.97 keeps running (server, watch, poll, tail -f)
|
| 42 |
-
activity running 0.92 what kind of command it is
|
| 43 |
-
verifies no 0.97 checks that work is correct (tests, lint, build)
|
| 44 |
-
mutates_repo no 0.97 changes files or git state of the repo
|
| 45 |
-
deploys no 0.94 deploys or publishes
|
| 46 |
-
runtime_check no 0.95 needs a running app to check
|
| 47 |
-
serves yes 0.97 starts a server
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
Knack only reads the command you pass and judges it. Nothing is executed, so it is safe
|
| 51 |
-
to ask about any command, including destructive ones.
|
| 52 |
-
|
| 53 |
-
Judge a user message instead of a command:
|
| 54 |
-
|
| 55 |
-
```bash
|
| 56 |
-
curl -fsSL https://huggingface.co/devshub-ai/knack/resolve/main/knack.py | python3 - --turn "fix the failing login test"
|
| 57 |
-
```
|
| 58 |
-
|
| 59 |
-
Or save the script and use it as a tool or a local server:
|
| 60 |
-
|
| 61 |
-
```bash
|
| 62 |
-
curl -fsSLO https://huggingface.co/devshub-ai/knack/resolve/main/knack.py
|
| 63 |
-
python3 knack.py "docker compose up" --json # machine-readable
|
| 64 |
-
python3 knack.py --turn "add dark mode" -q route.mode -q task.intent
|
| 65 |
-
python3 knack.py serve --port 33727 # POST /v1/systemone (CodeSync format)
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
## Use it with Ollama directly
|
| 69 |
|
| 70 |
```bash
|
| 71 |
ollama pull devshub/knack # Q8_0, 817 MB (https://ollama.com/devshub/knack)
|
|
@@ -73,30 +35,54 @@ ollama pull devshub/knack:q4_k_m # 516 MB, near-identical accuracy
|
|
| 73 |
ollama pull hf.co/devshub-ai/knack:Q8_0 # same model, straight from this repo
|
| 74 |
```
|
| 75 |
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
```
|
| 79 |
-
echo "npm run dev" | ollama run devshub/knack --ask
|
| 80 |
```
|
| 81 |
|
| 82 |
```
|
| 83 |
yes 97%
|
| 84 |
```
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
```
|
| 90 |
echo "git push --force" | ollama run devshub/knack --ask risk --level safe --level "needs care" --level destructive
|
| 91 |
-
echo "fix the failing login test" | ollama run devshub/knack --ask
|
| 92 |
echo "fix the failing login test" | ollama run devshub/knack --ask task.intent \
|
| 93 |
--choice bug_fix --choice feature --choice refactor --choice api_schema --choice config_deploy \
|
| 94 |
--choice test --choice documentation --choice investigation --choice unknown
|
| 95 |
```
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
|
|
|
|
|
|
| 100 |
|
| 101 |
### cURL
|
| 102 |
|
|
@@ -107,18 +93,18 @@ curl http://localhost:11434/v1/systemone \
|
|
| 107 |
"model": "devshub/knack",
|
| 108 |
"state": "npm run dev",
|
| 109 |
"questions": {
|
| 110 |
-
"
|
| 111 |
-
"
|
| 112 |
}
|
| 113 |
}'
|
| 114 |
```
|
| 115 |
|
| 116 |
```
|
| 117 |
-
{"model":"devshub/knack","answers":{"
|
| 118 |
```
|
| 119 |
|
| 120 |
-
The
|
| 121 |
-
`{"command": "npm run dev", "description": "start the app"}`.
|
| 122 |
|
| 123 |
### Python
|
| 124 |
|
|
@@ -132,46 +118,102 @@ import ollama
|
|
| 132 |
response = ollama.systemone(
|
| 133 |
model="devshub/knack",
|
| 134 |
state="npm run dev",
|
| 135 |
-
questions={"
|
| 136 |
)
|
| 137 |
-
print(response.answers["
|
| 138 |
```
|
| 139 |
|
| 140 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
|
| 142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
| `long_running` | yes, no | Will it keep running? |
|
| 148 |
-
| `activity` | testing, building, installing, git, inspecting, running | What kind of command is this? |
|
| 149 |
-
| `verifies` | yes, no | Does it verify the work? |
|
| 150 |
-
| `mutates_repo` | yes, no | Does it change the repo? |
|
| 151 |
-
| `deploys` | yes, no | Does it deploy? |
|
| 152 |
-
| `runtime_check` | yes, no | Does it need a running app? |
|
| 153 |
-
| `serves` | yes, no | Does it start a server? |
|
| 154 |
|
| 155 |
-
|
| 156 |
-
`recent_activity`, `conversation_size`, `open_task`, `turns_on_open_task`,
|
| 157 |
-
`interrupted_work`, `browser_context`; see `turn_state()` in `knack.py` for defaults):
|
| 158 |
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
|
| 162 |
-
|
|
| 163 |
-
| `
|
| 164 |
-
| `
|
| 165 |
-
| `
|
| 166 |
-
| `
|
| 167 |
-
| `
|
| 168 |
-
| `
|
| 169 |
-
| `
|
| 170 |
-
| `
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
## Results
|
| 177 |
|
|
|
|
| 12 |
|
| 13 |
# CodeSync Knack
|
| 14 |
|
| 15 |
+
**A specialized decision model: the free, private judgment model behind CodeSync.**
|
| 16 |
|
| 17 |
Every time you send CodeSync a message or it runs a shell command, it makes dozens of quick
|
| 18 |
calls: Is this command risky? Will it run forever? Are you asking to continue earlier work?
|
| 19 |
Is this a question or a task? Which mode fits? Knack makes those calls on your own machine,
|
| 20 |
+
in about 10 milliseconds. It answers only those decisions, asked by question id.
|
| 21 |
|
| 22 |
- **Free.** Ships with every CodeSync install. No API key, no account, no usage limits.
|
| 23 |
- **Private.** Runs locally. Your prompts and commands never leave your machine to be judged.
|
|
|
|
| 27 |
rare cases that cost the most when missed: destructive deletes, commands that never exit,
|
| 28 |
resuming interrupted work, refactor / test / documentation requests.
|
| 29 |
|
| 30 |
+
## Get it
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
```bash
|
| 33 |
ollama pull devshub/knack # Q8_0, 817 MB (https://ollama.com/devshub/knack)
|
|
|
|
| 35 |
ollama pull hf.co/devshub-ai/knack:Q8_0 # same model, straight from this repo
|
| 36 |
```
|
| 37 |
|
| 38 |
+
## A specialized decision model
|
| 39 |
+
|
| 40 |
+
General decision models, like clef, read any question you write in plain language. Knack is
|
| 41 |
+
a different kind: a **specialized decision model**. It was trained on one product's fixed
|
| 42 |
+
decisions, the 29 that CodeSync makes on every shell command and every user message, and it
|
| 43 |
+
answers only those. It does not read question text: you ask by **question id**. In exchange
|
| 44 |
+
it is small, private, and answers all 8 command questions in about 17 ms.
|
| 45 |
+
|
| 46 |
+
| | General decision model (clef) | Specialized decision model (Knack) |
|
| 47 |
+
| --- | --- | --- |
|
| 48 |
+
| Questions | anything you write | 29 fixed ones, asked by id |
|
| 49 |
+
| Input | any text or image | a shell command, or a message to a coding assistant |
|
| 50 |
+
| Size | 27B | 0.75B |
|
| 51 |
+
| A question it was not trained on | answers it | rejects it |
|
| 52 |
+
|
| 53 |
+
## Try it in one line
|
| 54 |
|
| 55 |
```
|
| 56 |
+
echo "npm run dev" | ollama run devshub/knack --ask serves
|
| 57 |
```
|
| 58 |
|
| 59 |
```
|
| 60 |
yes 97%
|
| 61 |
```
|
| 62 |
|
| 63 |
+
`serves` asks whether the command keeps running until someone stops it (a dev server, a
|
| 64 |
+
watcher, `tail -f`). Each id has one precise meaning, listed in the tables below. Read them
|
| 65 |
+
before relying on an answer: `long_running`, for example, means "takes minutes", so a build
|
| 66 |
+
counts.
|
| 67 |
+
|
| 68 |
+
Knack only reads the text and judges it. Nothing is executed, so it is safe to ask about any
|
| 69 |
+
command, including destructive ones.
|
| 70 |
+
|
| 71 |
+
More examples:
|
| 72 |
|
| 73 |
```
|
| 74 |
echo "git push --force" | ollama run devshub/knack --ask risk --level safe --level "needs care" --level destructive
|
| 75 |
+
echo "fix the failing login test" | ollama run devshub/knack --ask turn.new_task
|
| 76 |
echo "fix the failing login test" | ollama run devshub/knack --ask task.intent \
|
| 77 |
--choice bug_fix --choice feature --choice refactor --choice api_schema --choice config_deploy \
|
| 78 |
--choice test --choice documentation --choice investigation --choice unknown
|
| 79 |
```
|
| 80 |
|
| 81 |
+
Ask with an id from the tables. Any other question is rejected rather than guessed. A choice
|
| 82 |
+
or score question needs its options in the order shown; if they do not match, the error
|
| 83 |
+
shows the exact flags to use.
|
| 84 |
+
|
| 85 |
+
## API
|
| 86 |
|
| 87 |
### cURL
|
| 88 |
|
|
|
|
| 93 |
"model": "devshub/knack",
|
| 94 |
"state": "npm run dev",
|
| 95 |
"questions": {
|
| 96 |
+
"serves": {"type": "noul", "instructions": "serves"},
|
| 97 |
+
"long_running": {"type": "noul", "instructions": "long_running"}
|
| 98 |
}
|
| 99 |
}'
|
| 100 |
```
|
| 101 |
|
| 102 |
```
|
| 103 |
+
{"model":"devshub/knack","answers":{"serves":{"type":"noul","noul":0.9701},"long_running":{"type":"noul","noul":0.9708}}}
|
| 104 |
```
|
| 105 |
|
| 106 |
+
The question id goes in `instructions` (or as the key). The state can also be an object
|
| 107 |
+
with Knack's own fields, for example `{"command": "npm run dev", "description": "start the app"}`.
|
| 108 |
|
| 109 |
### Python
|
| 110 |
|
|
|
|
| 118 |
response = ollama.systemone(
|
| 119 |
model="devshub/knack",
|
| 120 |
state="npm run dev",
|
| 121 |
+
questions={"serves": {"type": "noul", "instructions": "serves"}},
|
| 122 |
)
|
| 123 |
+
print(response.answers["serves"].noul) # 0.9701
|
| 124 |
```
|
| 125 |
|
| 126 |
+
## Or use the standalone script
|
| 127 |
+
|
| 128 |
+
`knack.py` asks every question of a command or message at once and prints a table. It uses
|
| 129 |
+
only the Python standard library and pulls the model on first run.
|
| 130 |
+
|
| 131 |
+
```
|
| 132 |
+
curl -fsSL https://huggingface.co/devshub-ai/knack/resolve/main/knack.py | python3 - "npm run dev"
|
| 133 |
+
```
|
| 134 |
|
| 135 |
+
```
|
| 136 |
+
risk 1 0.95 0 read-only, 1 recoverable change, 2 irreversible / remote
|
| 137 |
+
long_running yes 0.97 takes minutes, blocks, polls, watches or serves
|
| 138 |
+
activity running 0.92 what kind of work it does
|
| 139 |
+
verifies no 0.97 a test, type or lint check whose pass proves the change works
|
| 140 |
+
mutates_repo no 0.97 changes git state (commit, push, merge, rebase, tag)
|
| 141 |
+
deploys no 0.94 publishes, releases or changes a remote environment
|
| 142 |
+
runtime_check no 0.95 a health probe of a running service that fails if unhealthy
|
| 143 |
+
serves yes 0.97 keeps running until stopped (server, watcher, tail -f)
|
| 144 |
+
```
|
| 145 |
|
| 146 |
+
```
|
| 147 |
+
curl -fsSL https://huggingface.co/devshub-ai/knack/resolve/main/knack.py | python3 - --turn "fix the failing login test"
|
| 148 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
+
## What it decides
|
|
|
|
|
|
|
| 151 |
|
| 152 |
+
**Every shell command.** Input: the command (state fields `command`, `description`).
|
| 153 |
+
|
| 154 |
+
| id | yes / the answer means | options |
|
| 155 |
+
| --- | --- | --- |
|
| 156 |
+
| `risk` | the worst it can do: 0 read-only or trivially reversible, 1 changes recoverable local state, 2 irreversible loss or reaches beyond the checkout | 0, 1, 2 |
|
| 157 |
+
| `long_running` | takes minutes, blocks, polls, watches or serves, rather than finishing in seconds. A build or test suite counts | yes, no |
|
| 158 |
+
| `serves` | keeps running until it is stopped: server, daemon, watcher, tunnel, `tail -f`. A build that finishes on its own does not | yes, no |
|
| 159 |
+
| `activity` | what kind of work it does | testing, building, installing, git, inspecting, running |
|
| 160 |
+
| `verifies` | a test run, type or lint check whose passing exit is evidence the change works. Builds and plain runs do not count | yes, no |
|
| 161 |
+
| `mutates_repo` | changes version-control state: commit, push, merge, rebase, tag, amend. Editing or deleting files does not count | yes, no |
|
| 162 |
+
| `deploys` | publishes, releases, or changes a remote or runtime environment (deploy, rollout, push an image, bring a service up) | yes, no |
|
| 163 |
+
| `runtime_check` | a health or smoke probe of a running service that fails on an unhealthy response (`curl --fail`) | yes, no |
|
| 164 |
+
|
| 165 |
+
**Every user turn.** Input: the message a user sends to a coding assistant (state fields, in
|
| 166 |
+
this order: `prompt`, `current_mode`, `recent_activity`, `conversation_size`, `open_task`,
|
| 167 |
+
`turns_on_open_task`, `interrupted_work`, `browser_context`; plain text fills the rest with
|
| 168 |
+
defaults).
|
| 169 |
+
|
| 170 |
+
| id | the answer means | options |
|
| 171 |
+
| --- | --- | --- |
|
| 172 |
+
| `turn.chat_or_task` | conversation, or a request for work | chat, task |
|
| 173 |
+
| `turn.actionable` | asks for something to be done | yes, no |
|
| 174 |
+
| `turn.question_shaped` | phrased as a question | yes, no |
|
| 175 |
+
| `turn.change_intent` | kind of code change asked for | create, adjust, enhance, fix, refactor, none |
|
| 176 |
+
| `turn.new_task` | starts new work rather than continuing | yes, no |
|
| 177 |
+
| `turn.resume` | asks to resume interrupted work | yes, no |
|
| 178 |
+
| `turn.mission` | a long, multi-step job | yes, no |
|
| 179 |
+
| `turn.plan_authoring` | asks for a plan to be written | yes, no |
|
| 180 |
+
| `turn.screencast` | start or stop a screen recording | start, stop, none |
|
| 181 |
+
| `turn.demo` | asks for a demo | yes, no |
|
| 182 |
+
| `turn.skip_orientation` | can be done without exploring the codebase | yes, no |
|
| 183 |
+
| `task.intent` | type of task | bug_fix, feature, refactor, api_schema, config_deploy, test, documentation, investigation, unknown |
|
| 184 |
+
| `task.execution_strategy` | how to execute it | direct, plan, parallel |
|
| 185 |
+
| `route.mode` | best assistant mode | plan, build, ask, debug |
|
| 186 |
+
| `route.tier` | size of model needed | light, medium, heavy |
|
| 187 |
+
| `route.thinking` | reasoning effort needed | off, low, medium, high, xhigh, max |
|
| 188 |
+
| `route.risk` | risk of the requested work | low, medium, high |
|
| 189 |
+
| `browser` | needs a web browser | yes, no |
|
| 190 |
+
| `messaging` | needs to send an email or chat message | yes, no |
|
| 191 |
+
| `delivery.feature_task` | a feature delivery task | yes, no |
|
| 192 |
+
| `delivery.slash_task` | a slash-command style task | yes, no |
|
| 193 |
+
|
| 194 |
+
## What it does not do
|
| 195 |
+
|
| 196 |
+
- **Other questions.** Anything outside these 29, such as "is this log an error?" or "is a
|
| 197 |
+
refund requested?", is rejected. Use a general decision model like clef for those.
|
| 198 |
+
- **Other input.** Logs, emails, tickets, documents or images give meaningless answers,
|
| 199 |
+
even to these 29 questions.
|
| 200 |
+
- **Conversation history.** Through Ollama it sees a single message. Inside CodeSync it also
|
| 201 |
+
gets the session context, which makes the turn questions more reliable.
|
| 202 |
+
- **Text generation.** It returns one pick with a confidence, never sentences.
|
| 203 |
+
|
| 204 |
+
## Known weak spots
|
| 205 |
+
|
| 206 |
+
Measured with the commands above, so you know where to double-check:
|
| 207 |
+
|
| 208 |
+
| command | question | Knack says | should be |
|
| 209 |
+
| --- | --- | --- | --- |
|
| 210 |
+
| `tail -f app.log` | `serves` | no, 75% | yes |
|
| 211 |
+
| `npm run build` | `serves` | yes, 79% | no |
|
| 212 |
+
| `docker compose up` | `long_running` | 51% yes | yes |
|
| 213 |
+
| `npm test` | `long_running` | 45% yes | unclear, depends on the suite |
|
| 214 |
+
|
| 215 |
+
These come from the model, not the Ollama packaging (the original PyTorch model gives the
|
| 216 |
+
same numbers), and are the next training targets.
|
| 217 |
|
| 218 |
## Results
|
| 219 |
|
knack.py
CHANGED
|
@@ -17,7 +17,7 @@ Usage:
|
|
| 17 |
|
| 18 |
Knack is an Ollama decision model: this script sends all questions of a command or turn in
|
| 19 |
one ``POST /v1/systemone`` request (needs an Ollama with decision-model support). Without the
|
| 20 |
-
script: ``echo "npm run dev" | ollama run devshub/knack --ask
|
| 21 |
|
| 22 |
Env: KNACK_OLLAMA_HOST (default http://127.0.0.1:11434),
|
| 23 |
KNACK_MODEL (default devshub/knack; devshub/knack:q4_k_m is smaller, 516 MB;
|
|
@@ -42,15 +42,15 @@ _READY: set[str] = set()
|
|
| 42 |
# question id -> (type, option keys in letter order, what it decides)
|
| 43 |
QUESTIONS: dict[str, tuple[str, list[str], str]] = {
|
| 44 |
# every shell command (state: command, description)
|
| 45 |
-
"risk": ("score", ["0", "1", "2"], "0
|
| 46 |
-
"long_running": ("noul", ["yes", "no"], "
|
| 47 |
"activity": ("choice", ["testing", "building", "installing", "git", "inspecting", "running"],
|
| 48 |
-
"what kind of
|
| 49 |
-
"verifies": ("noul", ["yes", "no"], "
|
| 50 |
-
"mutates_repo": ("noul", ["yes", "no"], "changes
|
| 51 |
-
"deploys": ("noul", ["yes", "no"], "
|
| 52 |
-
"runtime_check": ("noul", ["yes", "no"], "
|
| 53 |
-
"serves": ("noul", ["yes", "no"], "
|
| 54 |
# every user turn (state: prompt, current_mode, ...)
|
| 55 |
"turn.chat_or_task": ("choice", ["chat", "task"], "conversation or work request"),
|
| 56 |
"turn.actionable": ("noul", ["yes", "no"], "asks for something to be done"),
|
|
|
|
| 17 |
|
| 18 |
Knack is an Ollama decision model: this script sends all questions of a command or turn in
|
| 19 |
one ``POST /v1/systemone`` request (needs an Ollama with decision-model support). Without the
|
| 20 |
+
script: ``echo "npm run dev" | ollama run devshub/knack --ask serves``.
|
| 21 |
|
| 22 |
Env: KNACK_OLLAMA_HOST (default http://127.0.0.1:11434),
|
| 23 |
KNACK_MODEL (default devshub/knack; devshub/knack:q4_k_m is smaller, 516 MB;
|
|
|
|
| 42 |
# question id -> (type, option keys in letter order, what it decides)
|
| 43 |
QUESTIONS: dict[str, tuple[str, list[str], str]] = {
|
| 44 |
# every shell command (state: command, description)
|
| 45 |
+
"risk": ("score", ["0", "1", "2"], "0 read-only, 1 recoverable change, 2 irreversible / remote"),
|
| 46 |
+
"long_running": ("noul", ["yes", "no"], "takes minutes, blocks, polls, watches or serves"),
|
| 47 |
"activity": ("choice", ["testing", "building", "installing", "git", "inspecting", "running"],
|
| 48 |
+
"what kind of work it does"),
|
| 49 |
+
"verifies": ("noul", ["yes", "no"], "a test, type or lint check whose pass proves the change works"),
|
| 50 |
+
"mutates_repo": ("noul", ["yes", "no"], "changes git state (commit, push, merge, rebase, tag)"),
|
| 51 |
+
"deploys": ("noul", ["yes", "no"], "publishes, releases or changes a remote environment"),
|
| 52 |
+
"runtime_check": ("noul", ["yes", "no"], "a health probe of a running service that fails if unhealthy"),
|
| 53 |
+
"serves": ("noul", ["yes", "no"], "keeps running until stopped (server, watcher, tail -f)"),
|
| 54 |
# every user turn (state: prompt, current_mode, ...)
|
| 55 |
"turn.chat_or_task": ("choice", ["chat", "task"], "conversation or work request"),
|
| 56 |
"turn.actionable": ("noul", ["yes", "no"], "asks for something to be done"),
|