AI drafting
Last updated: 1 September 2026
Diagon ships with a small AI model that turns a sentence into diagram code, and turns a second sentence into a change to that code. It runs on your computer. It's part of the download, not a service you connect to — which is most of why the installer is around 2 GB.
This page covers how to use it, what it's good at, where it stops, and exactly what it does and doesn't send anywhere.
Using it
Click ✨ Generate in the toolbar. A panel drops down with a mode line, a box to type in, and a button.
Describe what you want in plain words, then press Generate:
a signup flow: sign up, verify email by clicking a link, then the account is active. an expired link sends you back to sign up.
You get Diagon code in the editor and the diagram beside it:
diagon
signup: Sign up { shape: pill }
verify: Verify email
active: Active account { shape: pill }
signup -> verify: send link
verify -> active: link clicked
verify -> signup: expiredFrom there it's yours — rename things, add shapes and colours, drag nodes around. The output is ordinary text in the Diagon language, not a black box.
Two modes
The panel notices what's already in your editor.
+ New diagram — the editor is empty, or holds something that doesn't parse. Your description produces a diagram from scratch, replacing whatever's there.
✎ Editing the current diagram — the editor holds a working Diagon diagram with at least one node. Now the model sees your current diagram and your sentence, and your sentence is read as a change: add a retry path from the error box back to the form, make the database a cylinder, drop the caching layer.
The mode line tells you which one is active, and the link next to it (start fresh instead / edit current instead) overrides the guess. The override lasts for one run; each time you reopen the panel it re-detects.
After a successful run the editor holds that diagram, so the next thing you type is read as an edit to it.
What happens to the result
The model is asked once, conservatively. If what comes back doesn't parse, Diagon asks a second time with a little more variety. The first attempt that parses cleanly is the one you get — nothing scores the two candidates against each other, and the second attempt is only ever a retry. If neither parses, the mode decides what happens:
- In new-diagram mode, you always get something in the editor: the first attempt, put back verbatim, with the status line showing its parse error so you know where to fix it. A near-miss you can repair in ten seconds beats an empty screen.
- In edit mode, a result that doesn't parse is thrown away and your diagram is left untouched. The status reads
⚠ edit failed, diagram kept. The AI never destroys a working diagram.
On success the view refits, and any in-memory pins and manual sizes are cleared.
Identifiers in the output are tidied before parsing: code fences and internal markers are stripped, and accented or awkward characters in ids are turned into plain ones consistently across the whole diagram. Your labels are left exactly as written, so this stays intact:
diagon
saute: Sauté the onions
serve: Serve
saute -> serveThe model
| Property | Detail |
|---|---|
| What it is | A fine-tune of Qwen2.5-1.5B, Apache 2.0 licensed |
| Format | GGUF, q8_0 quantisation, about 1.6 GB |
| Runs via | node-llama-cpp, inside Diagon's main process |
| Where it lives | Inside the installed application folder |
It's a completion model trained on one job: Diagon diagrams, in two shapes — describe-then-diagram, and diagram-plus-instruction-then-diagram. It isn't a chat assistant and won't answer questions.
It's small enough not to need a graphics card. The model loads the first time you press Generate — that run takes a few seconds longer — and then stays loaded for the rest of the session.
Privacy
The AI makes no network calls. There's no HTTP client in the code path, no telemetry, no opt-out to hunt for — your description and your diagram go from the editor to the model and back, inside one process on your machine. Turn off your network and it works exactly the same.
That's the AI. To describe the rest of the app with the same precision: Diagon does make network calls in three other places, and none of them carries your diagram text.
- Icons. If you write
icon: https://…in a diagram, Diagon fetches that URL from that host, in the preview and again at export. Those requests reveal the icon URLs you chose, to whoever serves them. - Licence renewal. Near expiry, Diagon sends your licence key — and nothing else — to soverain.cz to ask for a renewed one. See Licensing & updates.
- Update checks. It asks GitHub whether a newer release exists. Nothing about your machine goes with the question.
Your diagram files never leave your computer through any of these.
Limits
- Edit mode has a size ceiling of 6,000 characters. Past that it declines rather than working on a truncated copy — the message reads
diagram too large for AI editing. Generating a new diagram has no such limit. - One at a time. A second request while one is running is turned away with a note to wait a moment.
- Roughly 400 tokens per answer. It drafts diagrams of a workable size, not enormous ones. For a big architecture picture, generate the skeleton and grow it by editing.
- It won't edit D2. In D2 input mode the panel forces new-diagram mode and the output is Diagon code.
- It answers in your language. If a completion drifts into a script your request didn't use — which the base model occasionally does — Diagon retries once and then tells you rather than handing you a diagram in the wrong alphabet. Czech and other Latin-alphabet diacritics never trigger this.
If the button is disabled with the tooltip AI model not found — please reinstall Diagon, the model file is missing from your installation. Everything else in the app works normally; reinstalling from the download page restores it.
Getting better results
- Name the things. "order service, payment service, ledger" gives better nodes than "the backend".
- Say what connects to what, and what the arrow means: "the worker reads from the queue".
- Keep one idea per request. A first pass with six nodes, then three small edits, beats one paragraph describing twenty.
- Edit rather than regenerate. Once a diagram is roughly right, editing preserves the ids, labels and colours you've already fixed.
- Treat it as a first draft. It saves you the typing of the skeleton. Shapes, colours, containers and layout are quicker to do by hand, and the language is small enough to learn in an afternoon.
Cost
Nothing beyond your subscription. There's no per-generation charge, no credits, and no usage counter anywhere in the app — during the 30-day trial and afterwards alike, you can run it as often as you like. Diagon isn't paying anyone per request, because nothing leaves your machine.
While the trial is running, the panel notes how many days are left. A subscriber sees nothing there.