markdown · 2857 bytes Raw Blame History

Writing partner

Train a model on prose you've already written so it can continue in your voice. Useful for drafting newsletter intros, email replies, tech-blog paragraphs.

Goal

Heavy-prose document, minimal Q&A. The model learns cadence, verb choice, sentence length, and the specific idioms you reach for.

Template

---
# dlm_id is minted by `dlm init`; value below is illustrative only.
dlm_id: 01KPM618S7ZS91NVJH3XBK3WSG
base_model: smollm2-1.7b
system_prompt: |
  Continue the passage in the author's voice. Prefer short sentences.
training:
  lora_r: 8
  sequence_len: 2048
  num_epochs: 2
  learning_rate: 1e-4      # softer — style, not content
export:
  default_quant: Q4_K_M
  default_temperature: 0.8   # creative continuation
  default_top_p: 0.95
---

# Sample essays

Most architectural debates are linguistic debates in disguise. Two
people say "service" and mean different things. One means a process
with an HTTP endpoint; the other means a business capability owned
by a team. They argue for an hour before noticing.

Writing software is editing software. The first version is always a
draft. The trick is deciding when to stop polishing and ship.

...

# Newsletter intros

**Week of 2025-12-08.** The holiday lull is a scam. Everyone slows
down, then January hits like a freight train with unrealized Q1
goals. I spent the week writing a migration plan I'd rather not have
written.

**Week of 2025-12-15.** Three conversations this week converged on
the same idea: "the simple version is almost always right, and the
simple version is almost always harder to find than the complex one."

Walk-through

$ uv run dlm init writer.dlm --base smollm2-1.7b
$ # Paste essays + newsletter drafts under a few prose headings
$ uv run dlm train writer.dlm
$ uv run dlm prompt writer.dlm --temp 0.8 "Week of 2026-01-05. I've been thinking about"
Week of 2026-01-05. I've been thinking about how much of product work
is just sitting with a question long enough that the answer becomes
obvious in hindsight…

Prose length rule of thumb

  • Under 20 KB of prose: style doesn't really take. Add more.
  • 50–200 KB: converges nicely in 2 epochs; generations feel recognizably yours.
  • Over 500 KB: training wall-clock grows linearly; the replay corpus handles this fine, but start with a smaller cut and add on retrains.

Tips

  • Keep prose in logical sections — one essay per # heading. The parser treats them as one big prose section but humans reading the file thank you later.
  • Don't mix genres unless you want the model to mix genres. A .dlm with both legal memos and jokes produces generations that can't decide which to be.
  • The temperature: 0.8 in the export frontmatter is a hint for ollama rundlm prompt reads --temp from the CLI and ignores this.
View source
1 # Writing partner
2
3 Train a model on prose you've already written so it can continue in
4 your voice. Useful for drafting newsletter intros, email replies,
5 tech-blog paragraphs.
6
7 ## Goal
8
9 Heavy-prose document, minimal Q&A. The model learns cadence, verb
10 choice, sentence length, and the specific idioms you reach for.
11
12 ## Template
13
14 ```dlm
15 ---
16 # dlm_id is minted by `dlm init`; value below is illustrative only.
17 dlm_id: 01KPM618S7ZS91NVJH3XBK3WSG
18 base_model: smollm2-1.7b
19 system_prompt: |
20 Continue the passage in the author's voice. Prefer short sentences.
21 training:
22 lora_r: 8
23 sequence_len: 2048
24 num_epochs: 2
25 learning_rate: 1e-4 # softer — style, not content
26 export:
27 default_quant: Q4_K_M
28 default_temperature: 0.8 # creative continuation
29 default_top_p: 0.95
30 ---
31
32 # Sample essays
33
34 Most architectural debates are linguistic debates in disguise. Two
35 people say "service" and mean different things. One means a process
36 with an HTTP endpoint; the other means a business capability owned
37 by a team. They argue for an hour before noticing.
38
39 Writing software is editing software. The first version is always a
40 draft. The trick is deciding when to stop polishing and ship.
41
42 ...
43
44 # Newsletter intros
45
46 **Week of 2025-12-08.** The holiday lull is a scam. Everyone slows
47 down, then January hits like a freight train with unrealized Q1
48 goals. I spent the week writing a migration plan I'd rather not have
49 written.
50
51 **Week of 2025-12-15.** Three conversations this week converged on
52 the same idea: "the simple version is almost always right, and the
53 simple version is almost always harder to find than the complex one."
54 ```
55
56 ## Walk-through
57
58 ```sh
59 $ uv run dlm init writer.dlm --base smollm2-1.7b
60 $ # Paste essays + newsletter drafts under a few prose headings
61 $ uv run dlm train writer.dlm
62 $ uv run dlm prompt writer.dlm --temp 0.8 "Week of 2026-01-05. I've been thinking about"
63 Week of 2026-01-05. I've been thinking about how much of product work
64 is just sitting with a question long enough that the answer becomes
65 obvious in hindsight…
66 ```
67
68 ## Prose length rule of thumb
69
70 - **Under 20 KB of prose**: style doesn't really take. Add more.
71 - **50–200 KB**: converges nicely in 2 epochs; generations feel
72 recognizably yours.
73 - **Over 500 KB**: training wall-clock grows linearly; the replay
74 corpus handles this fine, but start with a smaller cut and add
75 on retrains.
76
77 ## Tips
78
79 - Keep prose in logical sections — one essay per `#` heading. The
80 parser treats them as one big prose section but humans reading the
81 file thank you later.
82 - Don't mix genres unless you want the model to mix genres. A `.dlm`
83 with both legal memos and jokes produces generations that can't
84 decide which to be.
85 - The `temperature: 0.8` in the export frontmatter is a hint for
86 `ollama run``dlm prompt` reads `--temp` from the CLI and ignores
87 this.