Inspiration

Dense text is a real barrier. A benefits notice, a medication leaflet, a tenancy agreement, a paper you need to cite — a general chatbot will happily simplify any of them, but it gives you no way to know whether a number, a name, or a hedge like "may" quietly disappeared. For anything you have to act on, "sounds simpler" is not the same as "still true".

I wanted a tool that treats fidelity as the product, not a disclaimer — and one that a person with dyslexia, ADHD, or limited English could actually use to read something they have to act on.

What it does

Plainly rewrites dense text sentence by sentence at a reading level you choose — Simple (G5–6), Everyday (G7–8), Clear (G9–10), or University (G11–12) — and checks every rewrite against its original before showing it as trustworthy.

Live preview: https://omar11-ai.github.io/plainly/ — no install, no Ollama, no account. Walk the whole interface, replay a recorded 3B → 7B verified run, or paste your own Google API key to simplify your own text.

Three phases, one model load each:

  1. Write. A 3B model rewrites one unit at a time. Results stream into the page immediately, marked Checking meaning, with the original kept beside the rewrite.
  2. Swap. The writer is unloaded once and the 7B model loads once.
  3. Check. Each rewrite is compared against its original in reading order, looking for dropped qualifiers, changed numbers or names, stronger certainty, and added claims.

A rewrite that fails either check gets one escalation: the 7B rewrites it with the failures as feedback, the result is verified again, and the better version wins.

Every card shows its work: the original, the plain version, the grade it moved from and to, a Why? button with the change audit and the verifier's note, and a strip of the facts that were checked — # 20 percent ✓, NAME Walker ✓, SCOPE roughly ~. A ✓ means the token survived verbatim. A ~ marks a soft hedge whose wording changed but whose meaning the verifier accepted, so it is deliberately not an error. A ✕ means the fact is genuinely gone, and the card says Needs review with a button to keep the original.

How we built it

Stack: Vite + React + TypeScript on the front, Node + Express streaming NDJSON on the back, qwen2.5:3b writer and qwen2.5:7b verifier served by Ollama, pdfjs-dist for selectable PDF text.

The two halves I'd point at:

Batching by phase. The obvious implementation interleaves the two models per sentence. On a 6 GB GPU that is a disaster — swapping between a 3B and a 7B costs 12–24 seconds per reload, and it happened on every sentence. Batching by phase turns N swaps into one: an 8-sentence passage takes 73 seconds end to end, including both model loads and any escalations. Measured on an RTX 2060.

Two independent check layers. Deterministic first, before any LLM: numbers, dates, acronyms, proper names, and qualifiers are extracted from the source and matched against the rewrite, so a number can never disappear without a flag regardless of what the model says. Then a 7B verifier that judges whether a reader would learn exactly the same thing, accepting synonyms and split sentences while rejecting changed scope, certainty, or facts.

One pipeline, two back ends. The same pipeline runs two ways. Locally it talks to Ollama; with no local API it runs in the browser against a hosted model, installed into the pipeline's model seam. Same prompts, same entity layer, same escalation — not a second implementation of the idea, the actual one. The API key belongs to whoever is using the site and is kept in their browser, never in the repo, because a key shipped to the browser is a key on the internet.

Design: a Japanese digital-instrument poster built from pixel primitives, tuned for dyslexic and ADHD readers — layout edge to edge, two deliberate type roles (Silkscreen for every label and readout so the interface feels like an instrument; Inter and a Flesch–Kincaid–friendly reading scale for the sentences people actually read), one gradient frame instead of two boxes, hard offset shadows instead of soft blurs, warm amber for live states and no traffic-light neon.

Challenges we ran into

The GPU could not hold both models. The 3B and 7B don't fit together on a 6 GB card, so Ollama partially offloaded the 7B to the CPU and every check crawled. The fix was to unload the writer before loading the checker — which is exactly why the phases are batched rather than interleaved. It also turned a measurement into a design constraint I could reason about instead of guessing.

Reading level is a prompt, not a guarantee. The 3B re-rolls up to three times but is a small model and misses the target. I chose to display the achieved grade and never claim the requested one. The same instinct gave the ~ marker: a hedge whose wording changed but whose meaning was accepted is not an error, and calling it one would have trained people to ignore the whole strip.

A hosted model exposed a bug in my own check. The pipeline compared the two model names to decide whether to run the verification phase at all. With one model serving both roles — the hosted case, where the swap is free — that test is false, so verification silently never ran and the run was reported as fast. Found by proving the hosted path works, then fixed so verified mode means the check runs. Locally the names differ, so the measured results are unchanged and both suites still pass.

Making the demo honest. I wanted people to try it without installing anything. The only free path that doesn't contradict the project's premise — that the text never leaves your machine — is a bring-your-own-key hosted run. So the key is entered by the visitor, held in their browser, and checked against Google before anything is sent. There is no key in the repo, and I checked the built bundle to confirm none leaked in.

Accomplishments that we're proud of

Three harnesses, all in the repo, all run against the live pipeline:

  • 17 hand-built fidelity pairs — 11 faithful rewrites and 6 with one specific broken fact. npm run eval → 17/17 correct, 0 false alarms on good rewrites, 0 missed errors. It grew out of real failures during the build, including one where the 3B dropped "tested conditions" and the 7B caught it and rewrote the sentence correctly.
  • 14 live API checks — node scripts/verify-api.mjs → 14/14.
  • 12 passages across three difficulty tiers — npm run eval-passages, with Flesch–Kincaid grade before and after, fidelity, escalation rate, and latency:
tier n FK before FK after drop fidelity escalations
everyday 4 9.3 5.0 −4.3 0.92 2
clear 4 15.8 9.2 −6.6 0.89 3
university 4 31.7 13.7 −18.0 0.40 0
all 12 18.9 9.3 −9.6 0.81 5

Reading level falls in every tier, and falls further in harder text — the correct direction, and the opposite of what a fixed template would do.

And the part I'd actually defend: the verifier is deliberately conservative, because a false alarm costs you one glance while a missed change costs you trust. It catches "roughly 20 percent" → "20 percent" (approximation made exact), "at least 7 hours" → "7 hours" (lower bound dropped), and "in mice" → "in people".

What we learned

Output has to be measured, not trusted. Most of the engineering in this repo exists because I measured rather than assumed. The 17-case fidelity suite, the 14 live API checks, the latency/VRAM benchmark, and the 12-passage tier run were all built to answer "does it actually do what it claims?" — and they are what surfaced the reading-level gap, the soft-hedge display bug, the level-dial misalignment, and the hosted-verification bug above. Every performance and accuracy number quoted here was measured on a single RTX 2060 with Chrome running.

A tool that claims to preserve meaning has to say where it stops. Long nested sentences are the hard limit: university-tier fidelity is 0.40, and both failures are single 80–100-word sentences with the main clause buried three subordinations deep. The pipeline rewrites sentence by sentence, so there is no smaller unit to work on, and the checker cannot verify a rewrite of a sentence it cannot itself hold — so it flags. The direction of that failure is the point: the tool refuses to mark it verified rather than trusting a rewrite it cannot check. Fail-closed by design, and the reason dense legal prose still needs a human reader.

Latency is the real usability cost. About 51 s per passage — fine for a reading session, not for a quick check.

What's next for Plainly

  • A human review pass on the verifier. The checker is prompt-based, and its judgement on hedge wording deserves hand-labelled adversarial pairs — the same way the 17-case suite caught real failures during the build.
  • Splitting long sentences before rewriting them, which is the actual fix for the university-tier failures rather than a prompt patch over them.
  • Achieved grade as the headline number. Report what was delivered rather than what was requested, per document, so the gap is visible instead of averaged away.
  • More languages and a proper PDF pipeline — English only and one unit at a time are both limitations I'd want gone before this is useful outside a demo.
  • A bundled key option for the hosted demo, with the quota warnings that would need, so a judge doesn't have to fetch their own key to try it.

Run it

npm install
ollama pull qwen2.5:3b
ollama pull qwen2.5:7b
npm run dev      # API on :8787, Vite on :5173

Or build once and serve everything from the API: npm run build && npm start

AI disclosure

AI used at runtime: the models that rewrite and verify text run locally and are open-weight (Qwen2.5 3B writer, 7B verifier), served by Ollama on the user's own machine. No hosted AI service is contacted at runtime, and no text ever leaves the computer. The hosted path is optional, bring-your-own-key, and off the default route.

AI used to build the project: Plainly was built by a student working with an AI coding assistant. The assistant wrote the pipeline, the streaming API, the eval and benchmark harnesses, and the UI wiring; the project owner set the problem, audience, scope and architecture, supplied the final visual design, and defined the reading-level and protected-terms behaviour.

Built With

Share this project:

Updates

Submission history