Skip to content

zeenolife/ai-baby-monitor

Repository files navigation

👶🧠 AI Baby Monitor (Local Video‑LLM Nanny)

MIT License DeepWiki

Your second pair of eyes, powered by local video LLMs. Because, you know... it does take a village.

The AI Baby Monitor watches a video stream (webcam, RTSP camera, …) and a simple list of safety rules. If a rule is broken it issues a single gentle beep so you can quickly glance over and check on your baby.


📸 Demo

Obviously, I'm not going to put my child in danger just for the demo, so here're videos of:

  1. People using smartphones, when rules say you shouldn't ❌
  2. Baby being safe and playful with a parent ✅

📵 "No smartphones" rule – alert fired

👶 Baby walking – no alert

✨ Features

🛡️ Private‑first Everything runs locally; nothing ever leaves your network.
Realtime-ish Works on consumer GPUs at ~1 req/s.
🦾 Video LLM Uses the Qwen2.5 VL by default, served through vLLM.
🔔 One beep alert Deliberately minimal & quiet — just look when it beeps.
🖥 Live dashboard Streamlit viewer shows the live stream + LLM reasoning logs in real time.
📝 Easy rules "The baby shouldn’t climb out of the crib", "Baby should always be accompanied by adult" … just edit YAML.
🏘️ Multi-rooms Supports multiple rooms. Just add another YAML with instructions.

🚀 Quick start

Prerequisites • Docker + docker‑compose • One GPU • Python 3.12 with uv

# 1 — clone
$ git clone https://github.com/zeenolife/ai-baby-monitor.git && cd ai-baby-monitor

# 2 — copy .env.template into .env
$ cp .env.template .env

# 3 — build & start all services (Redis, vLLM, video streamer, Streamlit viewer)
$ docker compose up --build -d

# 4 — start the watcher on the **host**. unfortunately playing sound in Docker container and propagating to host is really painful. so no docker compose here
$ uv run scripts/run_watcher.py --config-file configs/living_room.yaml

# 5 — open the dashboard 👉 http://localhost:8501. You can also open the dashboard on your phone http://{host_network_ip}:8501

Heads‑up The first run downloads the model (~6 GB), builds docker image and may take a few minutes.


🛠 Configuration

Add or tweak rooms in configs/*.yaml:

name: "living_room"

camera:
  uri: "0"            # webcam index or RTSP URI

instructions:          # natural‑language rules for the nanny model
  - "The baby shouldn't do anything dangerous."
  - "An adult should be in the room if the baby is awake."
  • Multiple rooms? Edit docker-compose.yml and create stream_to_redis per room. Pass in new room config to streamlit viewer. Spawn new run_watcher.py process on host for new room config.
  • Swap the model? Set LLM_MODEL_NAME in .env. Check vLLM supported models

🏗 Architecture (high level)


  1. stream_to_redis.py captures frames and pushes them to Redis (short realtime & long subsampled frames queues).
  2. run_watcher.py pulls latest N frames, encodes instructions and frames into prompt and sends them to local vLLM server, receives structured JSON, writes logs & plays a beep if receives should_alert = True.
  3. Streamlit live‑updates the latest frame + llm logs.

🛑 Disclaimer

This project is NOT a replacement for adult supervision. You should NEVER leave your baby alone.

It's meant as an additional guard for situations when you inevitably get distracted for a tiny moment, and your child is doing something dangerous. Thus just a beep sound as a notification.

It’s an experimental hobby tool — use responsibly and at your own risk.


📝 License

MIT © 2025 @zeenolife

Credits

Notification sound from Mixkit, used under the Mixkit Free Sound Effects License.
Videos used for demo from Pexels, used under their license

About

Local Video-LLM powered AI Baby Monitor

Topics

Resources

License

Stars

Watchers

Forks

Languages