--- title: Spruce emoji: 🌲 colorFrom: green colorTo: blue sdk: gradio sdk_version: 6.17.3 python_version: '3.12' app_file: app.py pinned: false license: apache-2.0 short_description: 'AI-native CRM you talk to, powered by small models' tags: - build-small-hackathon - track:backyard - sponsor:modal - sponsor:openbmb - sponsor:nvidia - achievement:offbrand - achievement:sharing - achievement:fieldnotes - badge-tiny-titan - best-agent --- # Spruce **Demo video:** _TODO — add link (YouTube / uploaded to the Space)_ **Social post:** _TODO — add link_ An agent-native CRM for a health coach who runs message-based coaching with the occasional checkup call. It does two jobs, each with a genuinely small model: 1. **Structure every client.** Paste anything a client sent (a message thread, a call note, an intake) and **MiniCPM3-4B** (OpenBMB, 4B) turns it into a structured record: goals and current protocol, history of what was tried, flags to watch, and open follow-ups. It also harvests any reusable method the coach stated, growing a knowledgebase that starts empty. 2. **Brief the coach before they reply.** Cornerman retrieves the relevant knowledgebase entries and **Nemotron-3-Nano-4B** (NVIDIA, 4B) writes a short brief: which of the coach's own methods apply, what was already tried, what to watch for. The coach writes the actual message. ## Honest small-model fit Neither model does medicine. One restructures natural language into a record. The other reasons over text the coach supplied (the client's record and the coach's own knowledgebase) and is told never to introduce outside clinical claims. Both tasks are squarely what small instruction-tuned models do well, which keeps the small-model story honest. The brief always ends with "Not medical advice. Coach reviews before sending," and nothing is ever sent to a client automatically. ## Two models, two jobs | Job | Model | Why this model | | --- | --- | --- | | Extract + harvest | `openbmb/MiniCPM3-4B` | Strong at format-following and JSON output | | Coaching brief | `nvidia/NVIDIA-Nemotron-3-Nano-4B-BF16` | Built for compact agentic reasoning | Both are 4B or under. They need different `transformers` versions, so the backend runs them as two separate Modal services, each warm-loaded and scaling to zero between calls. ## How it works - **Frontend (this Space):** `app.py`. A custom Gradio cockpit: client list, per-client record, paste-to-ingest, a knowledgebase panel, and a "Brief me" flow. It owns the data (SQLite) and the keyword retrieval; the models stay stateless. - **Model backend:** `modal_app.py`. Two Modal GPU services exposing small HTTP endpoints for extraction, harvesting, and briefing. ## Running it Backend: ``` modal deploy modal_app.py # prints two web endpoint URLs ``` Then set two Space secrets to those URLs: ``` EXTRACT_URL -> the Extractor.web URL (MiniCPM3-4B) COACH_URL -> the Coach.web URL (Nemotron-3-Nano-4B) ``` ## Built for Build Small **Track — Backyard AI.** A practical, problem-solving tool for the daily work of a solo health coach: it removes the manual CRM upkeep so they can spend their time coaching, not bookkeeping. **How each prize is earned:** - **Modal** — both models run entirely on Modal. `modal_app.py` defines two GPU services (L4), each warm-loaded and scaling to zero between calls; the cockpit is a thin client that reaches them over HTTP. Modal is the whole runtime, not a side call. - **OpenBMB (MiniCPM3-4B)** — the write path. One model does routing, structured extraction, stage classification, and method harvesting, leaning on MiniCPM3's strong format- and JSON-following. - **NVIDIA (Nemotron-3-Nano-4B)** — the read path. Compact agentic reasoning over the coach's own data to answer questions and write grounded briefs. - **Tiny Titan** — every model the app depends on is ≤4B parameters. - **Best Agent** — an update flows through a multi-step pipeline: route → extract → classify stage → log timeline → harvest reusable methods, then surfaces what needs attention. Planning and tool use, not a single prompt. - **Off Brand** — a purpose-built CRM cockpit (command bar, pipeline board, needs-attention panel, knowledgebase), not the default Gradio look. **Honest small-model fit.** Neither model does medicine. One turns natural language into a structured record; the other reasons only over text the coach supplied and is told never to introduce outside clinical claims. Every brief ends with "Not medical advice. Coach reviews before sending," and nothing is ever sent to a client automatically. Models by OpenBMB and NVIDIA, GPUs by Modal.