DEV Community

NIDHAN JAIN
NIDHAN JAIN

Posted on AI-assisted

ClassSloth: a local Gemma planner for the week's homework

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

This is my submission for the Hacktoberfest Open-Source AI Challenge: Week 3, Slow and Steady. ClassSloth is a new project built for this round.

What I built

ClassSloth answers the four questions I otherwise answer by opening every Classroom tab: what is due, what to do first, where the material is, and how to revise from notes I already have.

The lazy payoff is the tab-checking. The dashboard puts one next task on the screen. Due dates, titles, and links come from Classroom or from a clearly labeled demo set. If the app cannot tell whether something was turned in, the status stays unknown. Gemma's priorities and session lengths are estimates, and the source due date stays on the assignment.

Demo

About 63 seconds, recorded from the running app on a laptop. It uses the labeled demo week, a saved Gemma plan, course links, and a local Ollama check. The file in the repository is docs/demo.webm.

Watch the demo

The hosted copy is https://classsloth.onrender.com. Gemma 3 4B runs in that Render container for the labeled assignments and one bundled note. Real Classroom accounts and private uploads are not accepted there. The first plan after a cold start waits while the weights finish downloading.

Code

How I built it

Python, Streamlit, SQLite, PyMuPDF, and Ollama. The default model is Gemma 3 4B (gemma3:4b). Google Classroom is optional and read-only: courses, published coursework, course materials, and the student's own submission state. The app does not create, grade, or turn in work.

flowchart LR
    Student[Student] --> UI[Streamlit]
    UI --> DB[(SQLite)]
    UI -->|Only when you click plan, match, or revise| Gemma[Ollama + Gemma 3 4B]
    Classroom[Google Classroom read-only] -->|Sync needs internet| DB
    Notes[Uploaded PDF or text] --> DB
    Gemma -->|Validated JSON| UI

On a laptop, Ollama is the local daemon. On Render, the Docker image starts Ollama on 127.0.0.1:11434, pulls gemma3:4b onto a Render disk, and publishes only the Streamlit port. The instance is the 8 GB plan because the 4B weights are about 3.3 GB and need room to run. A $50 credit covers roughly a week at that size.

Inference runs only when you ask for a plan, a note match, a revision pack, or a search summary. A Streamlit rerun does not call the model again. Assignment text and uploaded notes are wrapped as data, not instructions.

Gemma 3 4B will sometimes return a valid plan shape with an empty items list and the real work sitting in study_sessions. ClassSloth keeps those session notes as the steps and still shows the due date from SQLite. Unknown page numbers are dropped. That matches what builders report about small local models and structured JSON: the schema helps, and you still validate. See Ollama structured outputs with Pydantic and this local Ollama plus SQLite dashboard, which keeps a non-model path when the model is down. A 4B model also needs several gigabytes of RAM even when the file looks small; this Ollama hardware note is why the Render service is not on the free 512 MB instance.

The test suite does not need Google, SerpApi, or ElevenLabs credentials. The last run here was 41 passed.

git clone https://github.com/Dev-Nidhan/classsloth.git
cd classsloth
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
Copy-Item .env.example .env
ollama pull gemma3:4b
streamlit run app.py
Enter fullscreen mode Exit fullscreen mode

With no OAuth client, choose Load demo week. Every synthetic title starts with Demo:.

Why open innovation matters

Coursework and notes are personal. On your own computer, the plan, the PDF text, and the revision pack stay on the machine. The public Render copy uses the labeled demo week and one bundled note, not a student's Classroom account. There is no analytics and no separate public model port.

Running Gemma yourself also means the weekly plan does not depend on a per-token API bill. It does depend on memory. On a laptop a plan came back in well under a minute, and one run omitted the per-assignment steps until the validator repaired them from the session notes Gemma did return.

Prize categories

  • Overall, Hacktoberfest Open-Source AI Challenge: Week 3, Slow and Steady.
  • Best Use of Gemma. Gemma 3 4B is the planner, the note matcher, and the exam-pack writer, both on a laptop and inside the Render container.
  • Best Use of Render. The live service is classsloth.onrender.com, a Docker web service on an 8 GB instance. Ollama and gemma3:4b stay on localhost, and the weights sit on a Render disk. Visitors only reach Streamlit. Google login and private uploads are disabled there.
  • Best Use of SerpApi. A topic search keeps the titles, URLs, and snippets SerpApi actually returned, prefers known educational hosts, and asks Gemma to order only those URLs. Invented links are dropped. It runs only from a button and needs SERPAPI_API_KEY. The public demo leaves this off.
  • Best Use of ElevenLabs. Exam Prep speaks a passage you select, after a checkbox that says the text leaves the computer. Passages over 2,500 characters are refused before any request. It needs ELEVENLABS_API_KEY. The public demo leaves this off.

Top comments (2)

Collapse
 
fgrandon profile image
Francisco Grandón •

Naming a study planner ClassSloth and powering it with a local 4B model just to avoid having 47 Classroom tabs feast on your RAM is peak 'productive laziness'—the very engine of great software engineering.

Running Gemma 3 purely local is a smart architectural choice: zero API meter anxiety, minimal latency for daily planning, and keeping coursework data strictly on-device. One lightweight thought for a future iteration: an ultra-lightweight heuristic fallback for when a laptop is down to 4% battery and spinning up the model might trigger emergency power saving. Best of luck in the Hacktoberfest challenge!

Collapse
 
robertpaschal profile image
Odinaka Robert Nnamani •

one next task on screen beats ten tabs.