From 3618086af0dce5dbcb59c72c34573ad543b7a084 Mon Sep 17 00:00:00 2001 From: Ziad Date: Tue, 1 Dec 2026 15:07:19 -0700 Subject: [PATCH] pi-spark: seed small-model operating rules, raise Spark context to 64k Baseline test: the 4B model made zero tool calls and invented mise syntax. With an APPEND_SYSTEM of tool-first rules plus a golang-mise skill it built, tested and ran a working CLI in 36 tool calls. Rules now live in config/pi/small-model-APPEND_SYSTEM.md and are seeded per project; Ollama serves 64k context, which measured equal or faster than 32k. --- bin/pi-spark | 7 ++++++- config/pi/models.json | 4 ++-- config/pi/small-model-APPEND_SYSTEM.md | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 config/pi/small-model-APPEND_SYSTEM.md diff --git a/bin/pi-spark b/bin/pi-spark index 05c64dd..a875205 100755 --- a/bin/pi-spark +++ b/bin/pi-spark @@ -21,7 +21,12 @@ if tmux has-session -t "$SESSION" 2>/dev/null; then exit 0 fi -mkdir -p "$DIR" +mkdir -p "$DIR/.pi" +# Small models need explicit tool-first rules; seed them into a new project. +if [ ! -f "$DIR/.pi/APPEND_SYSTEM.md" ] && [ -f "$HOME/.dotfiles/config/pi/small-model-APPEND_SYSTEM.md" ]; then + cp "$HOME/.dotfiles/config/pi/small-model-APPEND_SYSTEM.md" "$DIR/.pi/APPEND_SYSTEM.md" + echo "seeded $DIR/.pi/APPEND_SYSTEM.md (small-model rules)" +fi # Drop the free-pi session environment so pi uses ~/.pi/agent, not the free-pi agent dir. tmux new-session -d -s "$SESSION" -x "${PI_SPARK_COLS:-210}" -y "${PI_SPARK_ROWS:-50}" -c "$DIR" \ "env -u PI_CODING_AGENT_DIR -u PI_SESSION_FILE -u PI_SESSION_ID -u PI_MODEL -u PI_PROVIDER -u PI_REASONING_LEVEL PI_SKIP_VERSION_CHECK=1 pi --model $MODEL --thinking $THINKING" diff --git a/config/pi/models.json b/config/pi/models.json index 079fddb..0f1a678 100644 --- a/config/pi/models.json +++ b/config/pi/models.json @@ -8,7 +8,7 @@ { "id": "spark:ablit", "name": "Spark-X2.6-4B abliterated (GTX 1080)", - "contextWindow": 32768, + "contextWindow": 65536, "maxTokens": 8192, "reasoning": true, "input": [ @@ -18,7 +18,7 @@ { "id": "spark:4b", "name": "Spark-X2.6-4B official (GTX 1080)", - "contextWindow": 32768, + "contextWindow": 65536, "maxTokens": 8192, "reasoning": true, "input": [ diff --git a/config/pi/small-model-APPEND_SYSTEM.md b/config/pi/small-model-APPEND_SYSTEM.md new file mode 100644 index 0000000..b16c85a --- /dev/null +++ b/config/pi/small-model-APPEND_SYSTEM.md @@ -0,0 +1,14 @@ +# Working rules (small-model session) + +Text you write is not the work — tool calls are the work. + +1. **Act with tools.** Create or change files with `write`/`edit`. Never paste file contents or commands as prose. +2. **One step at a time.** One tool call, read the result, then the next. Do not plan more than two steps ahead. +3. **Verify before you deliberate.** After writing code, run the build or test immediately. Decide design questions from the command output, not from memory. +4. **Read a file at most once per task.** Use `edit` with a unique anchor instead of re-reading. +5. **Keep output small.** Pipe long output through `| tail -20` or `| head -20`; prefer `-count`, `-q` and `--json` flags. Your context is limited. +6. **Do not invent syntax.** Unsure of a command or file format? Run `--help`, `ls-remote`, or read the relevant skill. +7. **Cap deliberation.** If two options are acceptable, take the first and continue; the test result decides. +8. **Stop with evidence.** When acceptance criteria are met, run the final verification command and report the exact commands and their output. Nothing else. + +Go projects: use the `golang-mise` skill for the exact `mise.toml` format and command list.