Davy
Davy is Keel's writing partner: it drafts prose into the leaf you are working on, one suggestion at a time, and nothing it writes ever enters your book until you accept it. The entire design hangs on one idea — you can always see exactly what the model is looking at. That is the trust story, and it is inspectable in the tool itself.
What Davy sees — the context recipe
Every generation call is assembled from the same recipe. A stable prefix (cached between calls — the single largest cost lever), a volatile middle that changes with the beat you are writing, and the task itself.
V8 earns its keep. The dominant AI failure in fiction is resolving tension too early. The do-not-reveal list costs a couple of hundred tokens and prevents most of it. Even before the Ledger has anything to embargo, the section is sent explicitly: “none recorded yet — still: never resolve tension the scene has not earned.” In a flashback it is the only thing keeping the scene from leaking the future.
The flow: instruct → inspect → stream → accept
In the Write view, ^g opens Davy panel on the right.
Type what you want:
^; opens the inspector — the recipe above, as it will
actually be sent, with a token estimate per section. Every section
can be pinned or unpinned before you generate.
Then the draft streams in. Esc cancels mid-stream. When it
finishes, you review:
a inserts
the suggestion at your cursor; r or Esc discards it
without a trace. Every accepted span is recorded in
.keel/provenance.jsonl, and the foot shows your leaf's
✎ AI-density — an honest answer if a publisher ever asks.
What it costs, and which model runs
Different jobs ride different models — prose rides the mid-tier, structural reasoning rides the top, mechanical lint rides the cheapest:
| DAVY.draft / continue | claude-sonnet-5 — $3 in / $15 out per MTok |
| editor.line · ledger.extract | claude-sonnet-5 |
| architect · continuity · reader | claude-opus-5 — $5 in / $25 out per MTok |
| editor.style_lint | claude-haiku-4-5 — $1 in / $5 out per MTok |
The cached prefix bills at a tenth of the input rate on reuse, which is why the stable sections exist. Every call is logged; the meter is one command away:
Setup — and writing without a key
| ANTHROPIC_API_KEY | set it in your environment and Davy is live |
| KEEL_AI_MOCK=<file> | offline mode: streams the file's text as the “draft” — used by every test, useful for demos |
| neither set | Davy tells you loudly, and everything else in Keel works untouched |
Davy also works from the command line — same recipe, streamed to stdout, nothing written to the store:
Proofreading — the Editor's pass
The same machinery powers proofreading, in the status chain rather than
the margin. keel proofread s-0068 runs a strict copy-editing
pass: objective errors only — spelling, grammar, doubled words — never
style. You see a word-level diff first; nothing applies without
--accept.
Accepting applies the corrections as a new revision and marks it
proofread. The mark is per revision — edit the leaf again and it
clears. Unproofread leaves show as ✂ in keel status
and as warnings on render and export. A human pass counts too:
--mark-only records it without the AI.
Keys
| ^g | open Davy (Write view) |
| Enter | generate from the instruction |
| ^; | inspect the context — j/k move, Space pin/unpin |
| Esc | back / cancel the stream / discard |
| a · r | accept · reject the finished draft |