Rewriter
An AI-assisted reading workspace that rewrites literature for a chosen reading level and adds natural text-to-speech without losing the flow of the original story.

Classic literature is valuable but its vocabulary and sentence structure can exclude younger readers and adults who want a gentler entry point.
Make reading level, source text, and narration part of one calm workflow instead of presenting model controls or exposing a chatbot interface.
A working responsive product with text transformation, speech playback, persistent reading context, and recoverable generation states.
Adapt the book without turning it into a chatbot
Rewriter is for readers who want the story, not an explanation of how a language model works. The interface starts with a small library, keeps the reading column central, and presents four plain-language reading levels alongside the untouched original.
The product choice was to make adaptation feel like a reading preference—next to theme, type size, and line height—rather than a prompt box. Progress, bookmarks, and preferences stay in a versioned local session so the product remains useful without an account.
Preserve structure before preserving style
Chapters are parsed into stable blocks with identifiers and content types. Gemini receives plain text plus strict reading-level guidance and must return every block exactly once, in the original order. The service rejects missing, reordered, duplicated, or malformed blocks before any adapted text reaches the reader.
Safety boundary
Providers return plain text, never HTML. The application escapes the response and rebuilds safe paragraph, heading, or quotation markup from the trusted source structure.
A cache key includes the source hash, reading level, model, and prompt version. That keeps repeat reads fast while ensuring a content or prompt change cannot silently reuse an old adaptation.
Failure is part of the reading experience
Rewrite and speech requests have schema validation, per-actor limits, abortable timeouts, provider-specific failure handling, and actionable messages. The original text remains available when adaptation fails, so an unreliable model does not strand the reader.
Text-to-speech starts from the reader’s current block, selects a bounded passage, and uses the matching canonical or adapted text. ElevenLabs returns an MP3 that is revoked when the selection or chapter changes instead of leaking object URLs across a long session.
Reading controls that belong to the reader
- Paper, sepia, night, and high-contrast themes.
- Bounded font-size and line-height controls.
- Keyboard-operable level, bookmark, chapter, settings, and audio controls.
- Polite live regions for adaptation and speech status.
- Persistent progress without requiring identity or transmitting reading history.
The live product proves the interaction and service boundaries. The next validation step is structured testing with readers across the four stated reading levels; the portfolio deliberately does not present those age bands as clinically validated outcomes.