InnerSpace is a private, local-first cognitive journal and AI reflection companion. It runs a fine-tuned 1.2B parameter language model inside the Hugging Face Space runtime. There is no serverless inference fallback, so journal text is not sent to an external inference API.
The model analyzes journal entries through the lens of Cognitive Behavioral Therapy (CBT): surfacing emotions, identifying affected life areas, flagging cognitive distortions, and responding with a gentle reflective question to help the writer think more clearly.
InnerSpace is a reflective journaling tool, not medical advice, diagnosis, crisis counseling, or a replacement for a licensed mental-health professional. If someone may be in immediate danger or crisis, they should contact local emergency services or a crisis hotline.
| Requirement | InnerSpace implementation |
|---|---|
Gradio Space in build-small-hackathon | build-small-hackathon/innerspace |
| Track | Backyard AI |
| Sponsor focus | OpenBMB MiniCPM5 with OpenAI-linked safety context |
| Merit targets | Well-Tuned, Off-Brand, Tiny Titan, Off the Grid |
| Multimodal input | Text upload and local file entry for journal prompts |
| Fine-tuning | Modal QLoRA adapter trained on CBT reflection examples |
| Demo/social links | Demo video and LinkedIn post are already published |
Write or upload a journal entry (.txt or .md) and set your current distress level. InnerSpace will return a structured reflection in six parts:
| Section | Description |
|---|---|
| Emotions | Dominant emotional states present in the entry |
| Life Areas | Affected domains β career, relationships, health, etc. |
| Cognitive Distortions | Patterns like Catastrophizing, Mind Reading, or All-or-Nothing Thinking |
| Balanced Reframe | A grounded alternative interpretation that does not dismiss the writer's feelings |
| Tiny Next Step | One realistic action the writer can try in the next 10 minutes |
| Reflection | A gentle open-ended question to prompt deeper self-awareness |
The inference engine is powered by a QLoRA-adapted version of openbmb/MiniCPM5-1B-SFT, trained specifically on CBT reflection patterns.
Why fine-tune instead of prompting? The base model is general-purpose. Fine-tuning teaches it the core CBT output structure and vocabulary β producing more consistent, therapeutically-grounded responses without relying on long system prompts. The current app extends that flow with a balanced reframe, a tiny next step, and distress-level context.
Training details:
The fine-tuned LoRA adapter is published at build-small-hackathon/inner-space-1b-sft-cbt and is loaded automatically on top of the base model at Space startup.
User Input (text or file)
β
βΌ
βββββββββββββββββββββββ
β Gradio UI β ui.py β dark-violet mindful dashboard
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Analyzer β analyzer.py β prompt construction & ZeroGPU dispatch
ββββββββββββ¬βββββββββββ
β
βββββββ΄βββββββ
βΌ βΌ
βββββββββββ ββββββββββββ
βInferenceβ β Parser β inference.py β model execution
β Engine β β Engine β parser.py β file reading & section splitting
ββββββ¬βββββ ββββββββββββ
β
βββ ZeroGPU / local runtime: base model + LoRA adapter via PeftModel
Inference priority:
MiniCPM5-1B-SFT in bfloat16 and applies the fine-tuned LoRA adapter via PeftModel. Runs on an NVIDIA A10G in the Space.Setup:
./run.sh setup
Run locally:
./run.sh app
This launches through app.py so Gradio receives the custom theme and CSS.
Quality checks (Ruff formatting, Ruff linting, Pyright type checking, Python compilation):
./run.sh verify
| File | Purpose |
|---|---|
app.py | Gradio launch entry point |
env/ β App infrastructure| File | Purpose |
|---|---|
env/config.py | Central constants β model IDs, repo URLs, limits |
env/runtime.py | Env var loader and asyncio cleanup patch |
core/ β Business logic| File | Purpose |
|---|---|
core/analyzer.py | Journal analysis orchestrator with ZeroGPU decorator |
core/inference.py | Lazy model loader β applies LoRA adapter, runs local inference |
core/parser.py | File reader and CBT section splitter |
ui/ β Presentation| File | Purpose |
|---|---|
ui/layout.py | Gradio layout, components, and event hooks |
ui/styles.py | Custom dark-violet CSS theme |
modal/ β Remote fine-tuning| File | Purpose |
|---|---|
modal/tune.py | QLoRA fine-tuning orchestrator (Modal.com) |
modal/dataset.py | CBT training dataset and prompt builders |
modal/CARD.md | Hugging Face model card for the LoRA adapter |
| File | Purpose |
|---|---|
requirements.txt | Python dependencies |
run.sh | Local dev utility β setup, verify, launch |
openbmb/MiniCPM5-1B-SFT + custom LoRA adapter (build-small-hackathon/inner-space-1b-sft-cbt)peft + trl SFTTrainer on Modal A10Gtransformers + peft (PeftModel) + accelerateInnerSpace is a private, local-first cognitive journal and AI reflection companion. It runs a fine-tuned 1.2B parameter language model inside the Hugging Face Space runtime. There is no serverless inference fallback, so journal text is not sent to an external inference API.
The model analyzes journal entries through the lens of Cognitive Behavioral Therapy (CBT): surfacing emotions, identifying affected life areas, flagging cognitive distortions, and responding with a gentle reflective question to help the writer think more clearly.
InnerSpace is a reflective journaling tool, not medical advice, diagnosis, crisis counseling, or a replacement for a licensed mental-health professional. If someone may be in immediate danger or crisis, they should contact local emergency services or a crisis hotline.
| Requirement | InnerSpace implementation |
|---|---|
Gradio Space in build-small-hackathon | build-small-hackathon/innerspace |
| Track | Backyard AI |
| Sponsor focus | OpenBMB MiniCPM5 with OpenAI-linked safety context |
| Merit targets | Well-Tuned, Off-Brand, Tiny Titan, Off the Grid |
| Multimodal input | Text upload and local file entry for journal prompts |
| Fine-tuning | Modal QLoRA adapter trained on CBT reflection examples |
| Demo/social links | Demo video and LinkedIn post are already published |
Write or upload a journal entry (.txt or .md) and set your current distress level. InnerSpace will return a structured reflection in six parts:
| Section | Description |
|---|---|
| Emotions | Dominant emotional states present in the entry |
| Life Areas | Affected domains β career, relationships, health, etc. |
| Cognitive Distortions | Patterns like Catastrophizing, Mind Reading, or All-or-Nothing Thinking |
| Balanced Reframe | A grounded alternative interpretation that does not dismiss the writer's feelings |
| Tiny Next Step | One realistic action the writer can try in the next 10 minutes |
| Reflection | A gentle open-ended question to prompt deeper self-awareness |
The inference engine is powered by a QLoRA-adapted version of openbmb/MiniCPM5-1B-SFT, trained specifically on CBT reflection patterns.
Why fine-tune instead of prompting? The base model is general-purpose. Fine-tuning teaches it the core CBT output structure and vocabulary β producing more consistent, therapeutically-grounded responses without relying on long system prompts. The current app extends that flow with a balanced reframe, a tiny next step, and distress-level context.
Training details:
The fine-tuned LoRA adapter is published at build-small-hackathon/inner-space-1b-sft-cbt and is loaded automatically on top of the base model at Space startup.
User Input (text or file)
β
βΌ
βββββββββββββββββββββββ
β Gradio UI β ui.py β dark-violet mindful dashboard
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Analyzer β analyzer.py β prompt construction & ZeroGPU dispatch
ββββββββββββ¬βββββββββββ
β
βββββββ΄βββββββ
βΌ βΌ
βββββββββββ ββββββββββββ
βInferenceβ β Parser β inference.py β model execution
β Engine β β Engine β parser.py β file reading & section splitting
ββββββ¬βββββ ββββββββββββ
β
βββ ZeroGPU / local runtime: base model + LoRA adapter via PeftModel
Inference priority:
MiniCPM5-1B-SFT in bfloat16 and applies the fine-tuned LoRA adapter via PeftModel. Runs on an NVIDIA A10G in the Space.Setup:
./run.sh setup
Run locally:
./run.sh app
This launches through app.py so Gradio receives the custom theme and CSS.
Quality checks (Ruff formatting, Ruff linting, Pyright type checking, Python compilation):
./run.sh verify
| File | Purpose |
|---|---|
app.py | Gradio launch entry point |
env/ β App infrastructure| File | Purpose |
|---|---|
env/config.py | Central constants β model IDs, repo URLs, limits |
env/runtime.py | Env var loader and asyncio cleanup patch |
core/ β Business logic| File | Purpose |
|---|---|
core/analyzer.py | Journal analysis orchestrator with ZeroGPU decorator |
core/inference.py | Lazy model loader β applies LoRA adapter, runs local inference |
core/parser.py | File reader and CBT section splitter |
ui/ β Presentation| File | Purpose |
|---|---|
ui/layout.py | Gradio layout, components, and event hooks |
ui/styles.py | Custom dark-violet CSS theme |
modal/ β Remote fine-tuning| File | Purpose |
|---|---|
modal/tune.py | QLoRA fine-tuning orchestrator (Modal.com) |
modal/dataset.py | CBT training dataset and prompt builders |
modal/CARD.md | Hugging Face model card for the LoRA adapter |
| File | Purpose |
|---|---|
requirements.txt | Python dependencies |
run.sh | Local dev utility β setup, verify, launch |
openbmb/MiniCPM5-1B-SFT + custom LoRA adapter (build-small-hackathon/inner-space-1b-sft-cbt)peft + trl SFTTrainer on Modal A10Gtransformers + peft (PeftModel) + accelerate