Spaces:
Sleeping
Sleeping
| # 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) | |