An interactive reading comprehension game using AI to generate cloze (fill-in-the-blank) exercises from public domain literature. Deployed on Cloudflare Workers via Kale Deploy.
Live: cloze-reader.cuny.qzz.io
Passages from Project Gutenberg are streamed via the Hugging Face Datasets API. Gemma-3-27B (via OpenRouter) selects contextually meaningful words to remove, producing fill-in-the-blank exercises that test reading comprehension through contextual inference. Players can consult structured hints about part of speech, sentence role, and synonymy without being given the answer directly.
- Runtime: Cloudflare Workers (Hono, TypeScript)
- Frontend: Vanilla JS, ES6 modules, Tailwind CDN — no build process
- AI: Gemma-3-27B via OpenRouter, proxied server-side at
/api/ai/chat - Data: Project Gutenberg via HF Datasets API, cached in Workers KV
- Storage: D1 (SQLite) for leaderboard and gameplay analytics
npm install
npm run dev # wrangler dev — local Workers runtime
npm run check # TypeScript type checkCreate .dev.vars for local secrets:
OPENROUTER_API_KEY=sk-or-...
HF_TOKEN=hf_...
Push to main triggers Kale Deploy → cloze-reader.cuny.qzz.io. Secrets are set via the Kale MCP.
Ported from milwrite/cloze-reader (Python FastAPI + Redis on Railway) to Cloudflare Workers with D1/KV.