DEV Community

Cover image for Raat Ki Kahani: a calm bedtime story maker, powered by open-source Gemma
Saurabh Singh
Saurabh Singh

Posted on

Raat Ki Kahani: a calm bedtime story maker, powered by open-source Gemma

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady 🦥

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Raat Ki Kahani ("Night Story") is a small web app that tells a child a calm bedtime story. A parent enters the child's name, age group, a topic ("a brave little elephant"), a lesson (kindness, honesty, courage, sharing or patience), a language (Hindi, English or Hinglish) and a length. The story appears word by word, and a Read aloud button reads it in a slow voice.

It does the work so a tired parent doesn't have to: no making up a story at the end of a long day, and no scrolling through videos.

Demo

There is no demo video for this one. I submitted it while travelling with only my phone, so I could not run Ollama.

  • Live page (interface only): https://saurabhh-cloud.github.io/raat-ki-kahani/
  • The AI runs locally, so the page needs Ollama running on your own computer to write stories. For anyone else it will show "Could not reach the model". Setup steps (4 short steps) are in the README.

Raat Ki Kahani interface. Writing the story needs Ollama on the computer.

Code

Raat Ki Kahani 🌙

A calm bedtime story maker for children. Enter the child's name, age, topic, lesson and language (Hindi, English or Hinglish) and get a gentle story, with a "Read aloud" button.

Open-source AI at the core: Google's open-weight Gemma model runs locally through Ollama. No internet, no account, no cost, and nothing about your child leaves your computer.

Run it

  1. Install Ollama: https://ollama.com/download
  2. ollama pull gemma3:1b
  3. Start Ollama with the page allowed:
    • Windows PowerShell: Stop-Process -Name "ollama*" -Force; $env:OLLAMA_ORIGINS="*"; ollama serve
    • Mac/Linux: OLLAMA_ORIGINS="*" ollama serve
  4. Open index.html in Chrome (or the GitHub Pages link) and click Tell me a story.

Built for the Hacktoberfest Open-Source AI Challenge: Week 3 (theme: Slow and Steady), Oct 19-25, 2026. HTML, CSS, JavaScript, Gemma, Ollama.




How I Built It

  • Frontend: plain HTML, CSS and JavaScript. I'm a first-year B.Sc. Mathematics student, so I kept it to one file.
  • AI: Google's open-weight Gemma (gemma3:1b) running locally through Ollama.
  • Streaming: the page reads Ollama's streaming response, so the story starts appearing almost immediately instead of after a long wait.
  • Prompt: it asks for a short, simple, sleepy story with no scary, violent or sad parts, and tells the model to output only the story.
  • Read aloud: the browser's built-in speech synthesis, slowed down, with a Hindi or English voice depending on the chosen language.
  • Settings: the model name and server address can be changed in the page.

Why Does Open Innovation Matter?

  • Privacy: a child's name, age and the topics they like never leave the family computer.
  • Offline and free: once the model is downloaded, it works without internet and costs nothing per story. A closed API would charge per request or need an account and a card.
  • Control: I can swap the model or change the prompt (for example to make stories calmer or shorter) without asking anyone.

Where it falls short: gemma3:1b is a very small model, so stories can be simple and Hindi quality is not perfect. A bigger model like gemma3:4b should do better but needs a stronger computer. Ollama also has to be installed, which is a barrier for non-technical parents. I have not tested the stories with children, so I can't say how they react to them.

An honest note: I wrote and submitted this while away from my laptop, so I have not run it end to end with Gemma yet. I checked that the page sends the request and shows a streamed reply using a stand-in server, but the real story quality is untested. If I change anything after testing at home, I will list it in the README.

The Lazy Payoff

Instead of inventing a story every night, a parent fills in four boxes in a few seconds and gets a fresh story, in the language the child understands best, that they can read or let the page read aloud.

No one has used it yet, so I can't give real numbers on time saved.

Prize Categories

Best Use of Gemma

Top comments (1)

Collapse
 
saurabh_0001 profile image
Saurabh Singh •

Thanks for reading! A few notes:

  • I wrote this while travelling with only my phone, so the app is untested with the real Gemma model. When I'm home I'll run it end to end and share what I find, including anything that breaks.
  • gemma3:1b is small and fast. A bigger model like gemma3:4b should write better Hindi stories but needs a stronger computer.
  • The live page only shows the interface. The story writing needs Ollama running locally, and the setup steps are in the README.

If you have kids, or remember a bedtime story you loved, what kind of story would you want it to tell? I'd love ideas for the next version. 🌙