How the AI works
The models are the press, not a feature.
01
The idea is read before anything is written
A word list runs first, then a model sorts the idea into cozy, needs a gentler hand, or no, and explains itself in one sentence. Refusals are written kindly and always offer another way in.
lib/ai/safety.ts
02
A character sheet is written once
Your chips become one paragraph about shape and colour and nothing else: no mood, no setting, no action. It is stored with the book and never rewritten. This one decision is why the child on page four is the child from page one.
lib/ai/story.ts, buildCharacterSheet
03
One call writes the whole book
Title, dedication, palette, and every page, with each page's illustration prompt written by the same model in the same pass. A separate pass that reads finished prose and guesses at a picture is where drift starts.
validated with zod before anything is stored
04
Each page is painted on its own
Scene, then character sheet, then house style, in that order, every time. One request per page so a book arrives while you watch rather than after a long silence.
gpt-image-2, about thirty seconds a page
05
Failures are handled as pages, not as books
A page that does not paint is retried once, then left with a re-paint button. The rest of the book carries on. A missing picture is a ten second fix, and a stranger on page four is a book that gets put down.
retry once, then ask
Model routing
Model-agnostic on purpose, in one file.
| Task | Model | Chosen for | Live |
|---|---|---|---|
| Write the book | gpt-4.1openaifalls back to gpt-4.1-mini, gpt-4.1-nano | writing the book, holding one voice across every spread, keeping the reading level inside the age band | live |
| Read the idea for tone | gpt-4.1-miniopenaifalls back to gpt-4.1-nano, gpt-4.1 | reading a story idea for tone, naming a book | live |
| Name the book | gpt-4.1-miniopenaifalls back to gpt-4.1-nano | reading a story idea for tone, naming a book | live |
| Paint every page | gpt-image-2openaifalls back to gpt-image-1 | character consistency, house style, warm light | live |
Writing the book goes to the frontier model, because the difference between a story a four year old asks for twice and one they sit through once is entirely in the language. Reading an idea for tone is cheaper work and goes to the balanced model. Every route is overridable by environment variable, so a deployment can move a step with no code change.
The character sheet
Three fixed parts and one moving part.
1. Scene, from the story pass
A child pulls a wooden handcart loaded with mismatched flour bags and jars along a village street in low golden morning light, neighbours waving from doorways.
2. Character sheet, written once, never edited
Theo, a child of about 9 years old, curly black hair, deep brown skin, brown eyes, round glasses, wearing a forest green apron over simple clothes. The same child appears in every illustration with exactly these features.
3. House style, identical on every page
Soft gouache children's picture book illustration, warm afternoon light, cream paper texture, terracotta and soft green and pale blue palette, gentle rounded shapes, hand-painted brush edges, storybook composition with generous space, friendly and calm. Not photorealistic. No photograph. No text, no letters, no numbers, no words, no logos, no watermark, no signature, no borders or frames. One child only unless the scene says otherwise.

The page those three parts produced. Same apron, same glasses, same hair as the other two spreads in that book, which is the entire test.
What we do not do
No photographs, no per-child training, no faces from life.
We looked at training a small model per child from photographs. It would hold images of real children, which is exactly what we have promised not to do, so there is no photo upload in Quillow and nowhere to put one.
A text character sheet holds far less about a real child than a photograph does, and it turns out to be enough. The illustrations are painted in a house style that is deliberately not photorealistic.
Your books are not training data. We route to model providers whose API terms exclude API traffic from training, and we do not train anything of our own on your family's books.