What if we used our screen breaks to reconnect with the outdoors instead of scrolling through another feed?
That's the idea behind GreenBreak AI โ a project that encourages people to step away from their screens and enjoy small, meaningful outdoor activities.
๐ฑ The problem
We spend a lot of time looking at screens, even when we only intended to check something for a few minutes. Taking a break can easily turn into more scrolling.
I wanted to build something that makes it easier to choose an outdoor activity instead.
๐ฟ What GreenBreak AI does
- Personalized break plans: Generate outdoor activities based on the available time, activity type, and difficulty.
-
Local AI generation: Uses Ollama with the
gemma2:2bmodel to generate break-plan suggestions locally. - Template fallback: If the local model is unavailable or returns an invalid response, the application can fall back to predefined activity templates.
- Daily nature missions: Encourages users to complete small outdoor activities.
- Progress tracking: Stores activity progress in browser local storage.
The goal is simple: make it easier to replace a few minutes of scrolling with a refreshing break outdoors.
๐ง How I built it
GreenBreak AI combines a Python backend with a web frontend.
When a user requests a break plan, the backend sends a structured generation request to a locally running Ollama service. The model's response is validated before being returned to the frontend. If AI generation fails, the application can use the template-based fallback.
This approach keeps the core experience available even when the local model cannot generate a response.
The local AI integration
I used Gemma 2 2B (gemma2:2b) through Ollama.
Instead of relying on a paid, hosted AI API, the application can generate suggestions using a model running on the user's own computer. This avoids per-request cloud inference charges, although running the model still requires suitable local hardware and resources.
The model is distributed under Google's Gemma Terms of Use. It is an open-weight model with specific license conditions, so I am not claiming that it is OSI-approved open-source software.
๐ ๏ธ Tech stack
- Backend: Python, FastAPI
- AI: Ollama, Gemma 2 2B
- Frontend: HTML, CSS, JavaScript
- Validation: Pydantic
- Progress storage: Browser local storage
- Testing: Pytest
๐ Run it locally
1. Clone the repository
git clone https://github.com/Sri-Indu/GreenBreak-AI.git
cd GreenBreak-AI
2. Install the dependencies
Create and activate a Python virtual environment if desired, then install the project's requirements:
python -m pip install -r requirements.txt
3. Set up Ollama
Install Ollama and make sure the gemma2:2b model is available locally.
If you do not already have the model, run:
ollama pull gemma2:2b
If it is already installed, you do not need to download it again. Ensure the Ollama service is running.
4. Start the backend
From the project directory, run:
python -m uvicorn backend.main:app --host 127.0.0.1 --port 8000
5. Open the frontend
Follow the frontend instructions in the repository README to open the application locally.
If Ollama is unavailable, the template fallback can provide break plans instead.
๐งช Testing
I ran the Python test suite after integrating local AI generation:
- 67 Python tests passed
- JavaScript syntax check completed without errors
These results verify the tested application behavior. Actual AI generation also depends on the local Ollama service and model being available.
๐ Project links
- GitHub repository: https://github.com/Sri-Indu/GreenBreak-AI
- Demo video: https://drive.google.com/file/d/1m0QsAE5tY1_h85-CpulkI_5whhALjc4h/view?usp=drivesdk
๐ Why open innovation matters
I wanted to explore how AI could support healthier digital habits without requiring a paid hosted AI API.
Local inference gives developers an opportunity to experiment with AI on their own machines, understand how model integration works, and build useful applications with fewer external service dependencies.
This project also helped me learn about structured model responses, backend validation, error handling, and fallback behavior.
๐ The goal
A short break outside can be more meaningful than another few minutes scrolling.
With GreenBreak AI, I hope to make those small breaks easier to plan โ one outdoor activity at a time.
Thanks for reading! ๐ฑ
Top comments (0)