tutordesk-ai / progress.md
naazimsnh02's picture
Custom UI redisgn
cb92a5d
|
Raw
History Blame Contribute Delete
8.13 kB
# TutorDesk AI β€” Progress Tracker
Update this as work completes. Status: ⬜ not started Β· 🟨 in progress Β· βœ… done Β· β›” blocked
Last updated: 2026-06-14 (Phases 4 + 5 + 6 complete + UI redesign)
---
## Phase 0 β€” Project setup
- βœ… Repo scaffolding (folders per CLAUDE.md), `requirements.txt`, `.env.example` (stubs compile clean)
- βœ… Architecture decided: all models self-hosted on Modal; Space = thin Gradio client
- βœ… `serving/modal_app.py` skeleton (one scale-to-zero fn per model)
- ⬜ HF account + empty Space live
- βœ… Modal account + CLI auth (`modal token set`)
- βœ… `modal deploy serving/modal_app.py` succeeds
- ⬜ **Exit:** "hello" Gradio app live on the Space
## Phase 1 β€” Core text generation (base Qwen3-4B)
- βœ… `serving/modal_app.py::Qwen` β€” Qwen3-4B on Modal (A10G, scale-to-zero)
- βœ… `models/qwen.py` β€” Modal client (+ offline stub)
- βœ… `agents/` β€” curriculum, question_gen, difficulty, answer, report, grader (all wired)
- βœ… `pipelines/weekly_pack.py` β€” 5-agent orchestration + localization + PDF export
- βœ… `utils/pdf.py` β€” print-ready A4 PDF (reportlab)
- βœ… `app.py` β€” Weekly Teaching Pack tab wired; other features show "Coming soon"
- βœ… Deploy: `modal deploy serving/modal_app.py` and smoke-test the pack
- βœ… **Exit:** Feature 2 end-to-end live (Modal β†’ Gradio β†’ PDF download)
## Phase 2 β€” Vision (Feature 1)
- βœ… `models/minicpm.py` β€” MiniCPM-V 4.5 Modal client (+ offline guard)
- βœ… `pipelines/worksheet_from_textbook.py` β€” photo/PDF β†’ MiniCPM extract β†’ weekly_pack
- βœ… `utils/image.py` β€” PDF rasterization via PyMuPDF
- βœ… `serving/modal_app.py::MiniCPM` β€” load + read_image implemented (A10G, trust_remote_code)
- βœ… `app.py` β€” Worksheet-from-Textbook tab fully wired (photo + PDF upload)
- βœ… Deploy: `modal deploy serving/modal_app.py` and smoke-test with a textbook photo
- βœ… **Exit:** Feature 1 β€” chapter photo β†’ worksheet+quiz+key
## Phase 3 β€” Dataset + fine-tune on Modal
- βœ… `data/prep_generation.py` β€” NCERT β†’ ChatML (objective β‘ , ~3k examples)
- βœ… `data/prep_difficulty.py` β€” difficulty labels (objective β‘‘, ~1k examples)
- βœ… `data/prep_grading.py` β€” grading triples via Qwen starmap (objective β‘’, ~600 examples)
- βœ… `finetune/train_modal.py` β€” LoRA SFT on Modal A10G, push to HF Hub
- βœ… `serving/modal_app.py` β€” reads QWEN_FINETUNED_MODEL env var to swap fine-tune in
- βœ… Run data prep: 3k generation + 1k difficulty + 600 grading examples
- βœ… Run training: `modal run finetune/train_modal.py` (A10G, 3 epochs, ~4.6k examples)
- βœ… Publish fine-tuned Qwen3-4B to HF Hub (**Well-Tuned**) β†’ naazimsnh02/tutordesk-qwen3-4b
- βœ… Professional model card pushed to HF Hub
- βœ… Set QWEN_FINETUNED_MODEL=naazimsnh02/tutordesk-qwen3-4b in .env + redeploy Modal
- βœ… **Exit:** model live in serving pipeline
## Phase 4 β€” Photo Auto-Grading (Feature 5)
- βœ… `agents/grader.py` β€” structured MARKS: X/Y output contract, `extract_score()`, `parse_scheme()` (regex + Qwen fallback)
- βœ… `pipelines/auto_grade.py` β€” multi-question loop: MiniCPM-V extract β†’ per-Q Qwen grading β†’ `GradeResult` with summary, markdown table, PDF
- βœ… `app.py` β€” Photo Auto-Grading tab fully wired (photo upload, marking scheme textbox, student name, grade/subject selectors, PDF download)
- βœ… **Exit:** Feature 5 works on neat/printed sheets
## Phase 5 β€” Multilingual + Diagrams
- βœ… `serving/modal_app.py::TinyAya` β€” load + localize implemented (L4, CohereLabs/tiny-aya-fire)
- βœ… `serving/modal_app.py::Flux` β€” load + generate_diagram implemented (A100, FLUX.1-schnell, bfloat16, 4 steps)
- βœ… `models/aya.py` β€” Modal client wired; English pass-through + offline no-op
- βœ… `models/flux.py` β€” Modal client wired; None fallback on offline/error
- βœ… `pipelines/illustrated_worksheet.py` β€” Qwen extracts ≀3 diagram prompts β†’ FLUX generates β†’ embedded in PDF; graceful text-only fallback
- βœ… `utils/i18n.py` β€” UI label dictionary for English / Hindi / Tamil
- βœ… `app.py` β€” Regional Language tab (Tiny Aya translator) + Illustrated Worksheets tab (FLUX pack) fully wired
- βœ… Offline graceful fallback β€” Aya returns English; FLUX returns None β†’ text-only PDF
- βœ… **Exit:** Features 3 & 4 β€” Cohere + BFL claims satisfied
## Phase 6 β€” Badge layer & polish
- βœ… Local mode via llama.cpp (**Off the Grid + Llama Champion**) β€” `models/qwen.py` `_local_llm()`, `QWEN_GGUF_PATH` + `GGUF_N_GPU_LAYERS` in config; `llama-cpp-python>=0.3` added to requirements; offline path calls `create_chat_completion` with chatml format
- βœ… `traces/` capture + publish HF dataset (**Sharing is Caring**) β€” `data/export_traces.py` reads `traces/raw/agent_traces.jsonl` and pushes to `naazimsnh02/tutordesk-agent-traces`
- βœ… Fully custom frontend (**Off-Brand**) β€” `app.py` now uses `gr.Server` (FastAPI) serving a hand-written single-page UI `static/index.html`; each of the 5 features posts to its own JSON/multipart endpoint, PDFs served via `/api/download/<token>`; `@app.api("health_check")` kept for gradio-client compat. Replaces the old `gr.Blocks` + `frontend/theme.py` approach (deleted). Pins `gradio==6.16.0`.
- βœ… Full UI redesign β€” saffron/green design-token CSS carried over from the old theme; gradient header w/ badges, JS feature-nav + output sub-tabs, pill radios, drag-drop dropzones w/ image preview, animated orbit loading card, marked.js markdown rendering, green-accented grade/PDF panels, footer with model badges
- βœ… Field Notes blog post β€” `field_notes.md` (submit to HF Field Notes)
- βœ… **Exit:** all badges claimable, app polished
## Phase 7 β€” Submission
- ⬜ Demo video (90-min β†’ 10-min story)
- ⬜ Social post
- ⬜ Final Space deploy + README w/ sponsor/badge checklist
- ⬜ **Submit before June 15, 2026**
---
## Feature status (at a glance)
| # | Feature | Status |
|---|---|---|
| 1 | Worksheet-from-Textbook (OpenBMB) | βœ… |
| 2 | Weekly Teaching Pack (Best Agent) | βœ… |
| 3 | Regional-language (Cohere) | βœ… |
| 4 | Illustrated worksheets (BFL/FLUX) | βœ… |
| 5 | Photo Auto-Grading (OpenBMB + Well-Tuned) | βœ… |
## Badge status
| Badge / Award | Status | Notes |
|---|---|---|
| OpenBMB | βœ… ready | MiniCPM-V 4.5 in Features 1 + 5 |
| Modal (training) | βœ… ready | `finetune/train_modal.py` on A10G |
| Cohere | βœ… ready | Tiny Aya self-hosted on Modal |
| Black Forest Labs | βœ… ready | FLUX.1-schnell self-hosted on Modal |
| Best Agent | βœ… ready | 5-agent weekly pack pipeline |
| Well-Tuned | βœ… ready | `naazimsnh02/tutordesk-qwen3-4b` on HF Hub |
| Tiny Titan (≀4B) | βœ… ready | Qwen3-4B (4B params) |
| Sharing is Caring | βœ… ready | `data/export_traces.py` β†’ push to HF dataset |
| Off the Grid | βœ… ready | `TUTORDESK_OFFLINE=1` + `QWEN_GGUF_PATH` β†’ llama.cpp |
| Llama Champion | βœ… ready | Qwen3-4B via llama.cpp GGUF |
| Off-Brand | βœ… ready | `gr.Server` (FastAPI) + custom `static/index.html` single-page frontend |
| Best Demo | ⬜ | Demo video needed (Phase 7) |
| Field Notes | βœ… ready | `field_notes.md` β€” submit to HF Field Notes |
---
## Decision log
- 2026-06-11 β€” Track: **Backyard AI**. Skipped OpenAI/NVIDIA/JetBrains.
- 2026-06-11 β€” Feature 5 changed from manual Parent Report β†’ **Photo Auto-Grading**.
- 2026-06-11 β€” Vision: **MiniCPM-V 4.5 (8B)** default; 4.6 (1.3B) offline fallback.
- 2026-06-11 β€” Text model: **fine-tuned Qwen3-4B** (chosen for Tiny Titan ≀4B).
- 2026-06-11 β€” Scope narrowed: **Classes 6–10, Math + Science, CBSE/NCERT, English + Hindi**.
- 2026-06-11 β€” Base dataset: **ParthKadam2003/NCERT_Dataset** (MIT).
- 2026-06-11 β€” **Hosting: all models self-hosted on Modal** (laptop can't hold them); Space =
thin Gradio client; no external APIs.
- 2026-06-11 β€” Multilingual model: **Tiny Aya `CohereLabs/tiny-aya-fire` (3.35B)**, South-Asian
tuned. Total stack β‰ˆ27B (< 32B).
## Open questions β€” resolved
- βœ… Cohere award accepts self-hosted Aya (confirmed 2026-06-11)
- βœ… 32B cap is **per-model** (each model individually) β€” all ours are well under
## Notes / blockers
- (none yet)