| --- |
| title: The Compliment Forest |
| emoji: 🌿 |
| colorFrom: green |
| colorTo: yellow |
| sdk: gradio |
| sdk_version: 6.16.0 |
| python_version: 3.12 |
| app_file: app.py |
| fullWidth: true |
| header: mini |
| pinned: true |
| license: apache-2.0 |
| short_description: Turn a worry into a grounded, illustrated path forward. |
| models: |
| - build-small-hackathon/compliment-forest-minicpm5-1b |
| - build-small-hackathon/compliment-forest-flux-lora |
| - openbmb/MiniCPM4.1-8B |
| - black-forest-labs/FLUX.1-schnell |
| - thangvip/compliment-forest-watercolor-flux-lora-v2 |
| - thangvip/compliment-forest-paper-cut-flux-lora-v2 |
| - thangvip/compliment-forest-moonlit-gouache-flux-lora-v2 |
| - thangvip/compliment-forest-botanical-ink-flux-lora-v2 |
| datasets: |
| - build-small-hackathon/compliment-forest-sft |
| - build-small-hackathon/compliment-forest-watercolor |
| - build-small-hackathon/compliment-forest-traces |
| - thangvip/compliment-forest-multistyle-v2 |
| tags: |
| - gradio |
| - build-small-hackathon |
| - minicpm |
| - modal |
| - text-to-image |
| - llama.cpp |
| - track:backyard |
| - sponsor:openbmb |
| - sponsor:openai |
| - sponsor:modal |
| - achievement:welltuned |
| - achievement:offbrand |
| - achievement:sharing |
| - achievement:fieldnotes |
| --- |
| |
| # The Compliment Forest |
|
|
| The Compliment Forest turns a worry into a five-chapter illustrated walk. It |
| asks five adaptive questions, separates facts from fearful predictions, offers |
| realistic options, suggests one small action, and ends with a simple plan the |
| visitor can carry back into the day. |
|
|
| This is whimsical encouragement, not therapy or a substitute for professional |
| support. Crisis and acute-risk inputs stop before model generation and direct |
| the visitor toward human help. |
|
|
| ## Backyard AI: The Real Problem |
|
|
| The Compliment Forest is built for the **Backyard AI** track. It addresses an |
| everyday problem in modern society: people carry worries about test results, |
| changing jobs, belonging, comparison, and an uncertain future, but the support |
| they receive is often vague or disconnected from what actually happened. |
|
|
| The product gives a person a private place to explain one real concern in their |
| own words. It asks what feels at stake, separates known facts from fearful |
| predictions, and turns the conversation into understandable options and one |
| small action. The illustrated forest makes that difficult reflection feel less |
| clinical and easier to approach, while the practical content remains grounded |
| in the person's situation. |
|
|
| ## Try It |
|
|
| - Hackathon Space: |
| https://huggingface.co/spaces/build-small-hackathon/compliment-forest |
| - Build article: |
| [Growing the Compliment Forest](docs/build-small-hackathon-article.md) |
| - Demo video: [public video link](https://youtu.be/La6JwK4nQ9c) |
| - Social post: [lpublic post link](https://huggingface.co/blog/build-small-hackathon/compliment-forest ) |
|
|
| ## Why It Is AI-Native |
|
|
| A fixed template cannot know whether a low test score hurts because of identity, |
| comparison, uncertainty, or a specific learning gap. The forest uses an |
| adaptive intake and a planner-author-critic pipeline to build a different path |
| for each visitor. |
|
|
| The five roles have distinct jobs: |
|
|
| 1. `arrive` acknowledges the feeling and concrete concern once. |
| 2. `steady` separates known facts from the outcome fear predicts. |
| 3. `widen` offers realistic interpretations or options. |
| 4. `step` gives one small, optional, low-risk action. |
| 5. `carry` leaves a simple plan or decision rule. |
|
|
| Local validators reject repeated prose, repeated long source phrases, invented |
| dates or actions, unsupported biography, stock abstraction, and a `step` |
| chapter without practical help. Failed chapters are regenerated selectively. |
| If repair still fails, the app tries one fresh forest and then returns an honest |
| error instead of canned encouragement. |
|
|
| ## Small-Model Stack |
|
|
| The live text and image stack is about 25B parameters in total, below the |
| hackathon's 32B total limit. |
|
|
| - **Text:** `openbmb/MiniCPM4.1-8B`, hosted on a Modal A100 endpoint. |
| - **Images:** `black-forest-labs/FLUX.1-schnell` with four rank-16 style LoRAs, |
| hosted on a separate Modal A100 80GB endpoint. |
| - **Local path:** the published 1.08B MiniCPM5 fine-tune is available as a |
| Q4_K_M GGUF through `llama.cpp`. |
| - **Training:** the MiniCPM and FLUX adapters, validation runs, and deployment |
| experiments used Modal. |
|
|
| Text and image inference scale independently. The canonical hackathon Space is |
| a CPU orchestrator: it serves the custom interface, validates requests, streams |
| NDJSON progress, and HMAC-signs calls directly to the two Modal services. No |
| credential is stored in the public repository. |
|
|
| ## Published Artifacts |
|
|
| - [MiniCPM5-1B fine-tune](https://huggingface.co/build-small-hackathon/compliment-forest-minicpm5-1b) |
| - [MiniCPM text adapter](https://huggingface.co/build-small-hackathon/compliment-forest-minicpm5-1b-lora) |
| - [Text SFT dataset](https://huggingface.co/datasets/build-small-hackathon/compliment-forest-sft) |
| - [Watercolor FLUX LoRA](https://huggingface.co/build-small-hackathon/compliment-forest-flux-lora) |
| - [Watercolor dataset](https://huggingface.co/datasets/build-small-hackathon/compliment-forest-watercolor) |
| - [Sanitized linked-model traces](https://huggingface.co/datasets/build-small-hackathon/compliment-forest-traces) |
| - [Multi-style dataset](https://huggingface.co/datasets/thangvip/compliment-forest-multistyle-v2) |
|
|
| ## Sponsor Work |
|
|
| **OpenBMB:** MiniCPM is the core language model family for planning, authoring, |
| critique, adaptive intake, and the published local fine-tune. |
|
|
| **Modal:** Modal powered text and image inference, LoRA training, GGUF |
| validation, and the independently scaling GPU endpoints used by the live app. |
|
|
| **OpenAI Codex:** Codex was used throughout implementation and debugging: |
| reading the codebase, writing tests, tracing malformed structured output, |
| redesigning the prompt and quality gates, deploying Space revisions, and |
| verifying full live flows. |
|
|
| ## Run Locally |
|
|
| ```bash |
| uv sync --extra dev |
| uv run python app.py |
| ``` |
|
|
| The default local backend is deterministic. To run the published local text |
| model through `llama.cpp`: |
|
|
| ```bash |
| CF_TEXT_BACKEND=llama_cpp |
| CF_IMAGE_BACKEND=flux |
| uv run --extra inference python app.py |
| ``` |
|
|
| ## Verification |
|
|
| ```bash |
| uv run pytest -q \ |
| --ignore=tests/test_build_multistyle_dataset.py \ |
| --ignore=tests/test_dataset_builder.py |
| ``` |
|
|
| Current maintained result: **155 passed**. |
|
|