βTame the Chatter. Find the Signal.β You enjoy that hyper-focus. We organize it all.
ChatChonk is a privacy-first SaaS platform that transforms messy AI chat exports (ChatGPT, Claude, Gemini & more) into structured, searchable knowledge bundles ready for Obsidian, Notion, and other knowledge management systems.
Scope: Core voice and text interaction assistant embedded in the ChatChonk user experience. Serves as onboarding guide, assistant, and interaction layerβnot a general chatbot.
- Purpose
Sara is the user's persistent companion in ChatChonkβa coach, not a tool. She helps guide, explain, recall, and reframe the interface, workflows, and creative chaos.
Sara is not βcute AI.β Sheβs a personal system interface with memory and voice. She can clarify tasks, modify settings, and interpret user goals. Her design prioritizes voice-friendly UX, contextual help, and customizable persona logic. 2. Modes of Interaction
Text Mode: Default fallback for accessibility and silent interaction
Voice Mode: Powered by Kokoro-compatible TTS stack (ESPnet/open-source acceptable fallback)
Switchable by user at any time with:
Voice command: βType insteadβ or βMuteβ
Text command: /switch to text, /mute, /unmute, /change voice
-
Primary Capabilities (MVP) Feature Description π’ Voice/Typed Command Support Voice command interpreter with fallback to typed commands π’ Prompt-Driven Contextual Help βWhat does this do?β, βHow do I export?β, βCan I rename this?β π’ Configurable Persona Name, tone, voice model, and interaction style can be changed π’ Session Memory (short-term) Remembers current task/thread/folder in local session π’ File Awareness Can respond with file stats like βYou uploaded a 1.8GB video file yesterdayβ π’ Onboarding Flow Greets new users, explains interface, helps connect Discord/account/etc. π‘ Assistant Routing Layer Can invoke system-level commands (e.g., trigger export, call API) π‘ Help Layer API Generates help text from internal system knowledge or markdown docs
π‘ = Core MVP logic stubbed now, expandable later
-
Configuration / Customization
Users can adjust Saraβs identity and behavior: Configurable Parameter Example Options Name Sara, Sage, Quinn, Jin, Sora, etc. Voice Model Kokoro Default, ESPnet (soft female), robotic Prompt Personality Friendly guide / Technical operator / Stoic bot Default Mode Voice or typing Permission Scope Coach only / Coach + command / Silent only
Configuration interface must be accessible via UI modal or Saraβs own commands:
βChange your name to Soraβ
βTalk like a robot nowβ
βBe more conciseβ
βStop giving me onboarding tipsβ
- Integration Points
Saraβs logic lives in the Assistant Layer, not the model routing stack. It acts as a contextual dispatcher and interface bridge. Integration Description Frontend Wasp/React text + voice interface with mute and config toggles Backend API Calls helper API endpoints: file list, export status, queue AutoMCP Can reference which model was used (e.g., "That was Claude 3") Discord MCP Can send bug reports on command (e.g., βTell you this was slowβ) Supabase Stores persistent Sara prefs (voice, mode, config) 6. Architecture & Voice Stack
Use open-source Kokoro or ESPnet for TTS
Web Speech API or Whisper fallback for browser voice input
Local session memory stored per tab
Permissions gating: voice must be re-enabled per session unless persisted
All interactions should be logged (locally) for debugging but never stored unless user opts in
-
Future Phases (Post-MVP) Feature Phase π’ Threadkeeper integration v1.1 π’ Goal tracking & prompting v1.2 π’ Assistant Suggestions ("Want help organizing that?") v1.2 π‘ Voice-only input mode v1.3 π‘ Long-term memory v1.4 π‘ Coach Templates v1.5 π‘ LLM tone-tuning v1.5+
-
Constraints
Must respect all accessibility rules: keyboard accessible, color contrast, readable fonts
Must not require voice; always provide text fallback
Cannot speak or persist without explicit opt-in
Sara does not suggest data be sent to train the system unless prompted by the user
ChatChonk now includes a sophisticated AI model management system that provides:
- User tier-based access control (Free β Meowtrix)
- Multi-layer cost protection with $50 emergency circuit breaker
- Real-time spending tracking and automatic limits
- Encrypted API key storage for high-tier users
- Performance-based routing using real MSWAP database
- Cost optimization with automatic fallbacks
- Provider diversity (OpenAI, Anthropic, HuggingFace, Mistral, etc.)
- Task-specific model matching
- Pre-request cost estimation with approval gates
- Tier-based spending limits ($1/day β $500/day)
- Emergency circuit breakers prevent billing surprises
- Detailed usage analytics and cost breakdowns
chatchonk/
backend/
app/
api/routes/ # API endpoints (ModelSwapper, file processing)
automodel/ # AI model management system
providers/ # OpenAI, Anthropic, HuggingFace, etc.
models/ # Pydantic models (MSWAP database schema)
services/ # Core services (ModelSwapper, cache, Discord)
core/ # Configuration and utilities
main.py # FastAPI application entry point
requirements.txt # Python dependencies
frontend/
src/
app/
admin/ # Admin dashboard (users, models, analytics)
page.tsx # Main application page
components/ui/ # Reusable UI components
lib/ # Utilities and helpers
styles/ # Global CSS and Tailwind
next.config.js # Next.js configuration
package.json # Node.js dependencies
templates/ # YAML processing templates
scripts/ # Deployment and utility scripts
docs/ # Documentation and ADRs
Core Flow: Upload β ZIP Parse β AutoModel AI Processing β Template Apply β Export
New AutoModel Flow: Request β Security Check β Cost Estimation β Model Selection β API Call β Usage Tracking
git clone https://github.com/yourname/chatchonk.git
cd chatchonk
Requirements:
- Python 3.11+
- Node.js 18+ (with npm or pnpm)
- Supabase account (tables already provisioned)
- (Optional) ffmpeg & tesseract for rich media extraction
Create .env
in project root:
# ==== Supabase (ChatChonk Database) ====
SUPABASE_URL=https://xxxxxxxx.supabase.co
SUPABASE_ANON_KEY=xxxxxxxxxxxxxxxxxxxxxxxx
SUPABASE_SERVICE_ROLE_KEY=xxxxxxxxxxxxxxxx
# ==== MSWAP Database (ModelSwapper) ====
MSWAP_SUPABASE_URL=https://yyyyyyyy.supabase.co
MSWAP_SUPABASE_ANON_KEY=yyyyyyyyyyyyyyyyyyyy
MSWAP_SUPABASE_SERVICE_ROLE_KEY=yyyyyyyyyyyy
# ==== Backend Security ====
CHONK_SECRET_KEY=your-super-secret-key-here
JWT_SECRET_KEY=your-jwt-secret-key-here
ENCRYPTION_KEY=your-32-byte-encryption-key
# ==== AI Provider Keys (System-Level) ====
HUGGINGFACE_API_KEY=hf_xxxxxxxxxxxxx
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxx
MISTRAL_API_KEY=xxxxxxxxxxxxxxxx
DEEPSEEK_API_KEY=xxxxxxxxxxxxxxxx
# ==== File Processing ====
UPLOAD_DIR=./uploads
TEMP_DIR=./tmp
MAX_FILE_SIZE=2147483648 # 2GB
# ==== Application ====
ALLOWED_ORIGINS=http://localhost:3000,https://yourdomain.com
PORT=8000
ENVIRONMENT=development
# ==== Discord Integration (Optional) ====
DISCORD_BOT_TOKEN=your-discord-bot-token
DISCORD_GUILD_ID=your-discord-server-id
# ==== Cost Control ====
EMERGENCY_COST_THRESHOLD=50.00
DEFAULT_DAILY_LIMIT=25.00
python -m venv .venv
source .venv/bin/activate
pip install -r backend/requirements.txt
uvicorn backend.main:app --reload --port 8000
cd frontend
pnpm install
pnpm dev # http://localhost:3000
The app will proxy API requests to localhost:8000
.
Task | Command |
---|---|
Start backend (hot-reload) | uvicorn backend.main:app --reload |
Start frontend | pnpm dev |
Lint & format | ruff check , black . , eslint . |
Run unit tests | pytest |
Generate template docs | python scripts/template_preview.py |
Feature branches follow conventional commits + PR review.
ChatChonk is optimized for Render.com deployment with the included render.yaml
configuration:
-
Two Supabase Projects:
- CHCH3: Main ChatChonk database
- MSWAP: ModelSwapper database (with providers, models, task_types tables)
-
Environment Variables (set in Render dashboard):
# Supabase connections SUPABASE_URL=https://your-chch3-project.supabase.co SUPABASE_SERVICE_ROLE_KEY=your-chch3-service-key MSWAP_SUPABASE_URL=https://your-mswap-project.supabase.co MSWAP_SUPABASE_SERVICE_ROLE_KEY=your-mswap-service-key # Security CHONK_SECRET_KEY=your-production-secret JWT_SECRET_KEY=your-jwt-secret ENCRYPTION_KEY=your-32-byte-encryption-key # AI Providers (system-level) HUGGINGFACE_API_KEY=hf_your_key OPENAI_API_KEY=sk-your_key ANTHROPIC_API_KEY=sk-ant-your_key # Cost controls EMERGENCY_COST_THRESHOLD=50.00
- Connect GitHub repository to Render
- Set environment variables in Render dashboard
- Deploy - Render will automatically:
- Build the FastAPI backend
- Build the Next.js frontend
- Set up health checks and auto-scaling
- Populate MSWAP database with your AI provider configurations
- Test ModelSwapper endpoints via
/api/modelswapper/health
- Configure user tiers and spending limits
- Set up monitoring for cost controls
For self-hosted deployment on Ubuntu 22.04+ VPS:
# System setup
sudo apt update && sudo apt install python3.11-venv nodejs npm nginx git
# Clone and build
git clone https://github.com/ripj3/CHATCHONKBETA.git /opt/chatchonk
cd /opt/chatchonk
# Backend
python3.11 -m venv .venv && source .venv/bin/activate
pip install -r backend/requirements.txt
# Frontend
cd frontend && pnpm install --frozen-lockfile && pnpm build
# Process management with PM2
sudo pnpm add -g pm2
pm2 start "uvicorn backend.main:app --host 0.0.0.0 --port 8000" --name chatchonk-api
pm2 start "pnpm start" --name chatchonk-frontend --cwd frontend
pm2 save && pm2 startup
Layer | Technology | Implementation | Notes |
---|---|---|---|
Frontend | Next.js 14, Tailwind CSS | React components, Admin dashboard | Responsive, accessible UI |
Backend | FastAPI, Pydantic | RESTful API, async processing | Stateless, JWT auth ready |
AI Layer | AutoModel + ModelSwapper | Multi-provider routing | NEW: Intelligent model selection |
Security | Multi-tier access control | User authentication, API key encryption | NEW: Enterprise-grade security |
Cost Control | Real-time tracking | Spending limits, circuit breakers | NEW: $50 emergency threshold |
Data | Dual Supabase setup | CHCH3 (main) + MSWAP (models) | Postgres with edge functions |
Processing | Async ZIP parser | Media extraction, chunked uploads | Handles >2GB files |
Exports | Markdown/Notion JSON | Obsidian-ready with backlinks | Full knowledge graph linking |
graph TD
A[User Request] --> B[Security Check]
B --> C[Cost Estimation]
C --> D[Model Selection]
D --> E[Provider Routing]
E --> F[API Call]
F --> G[Usage Tracking]
G --> H[Response]
I[MSWAP Database] --> D
J[User Tier Limits] --> B
K[Performance Data] --> D
L[Cost Thresholds] --> C
Key Features:
- Intelligent Routing: Selects optimal model based on task, performance, and cost
- Security First: Multi-layer protection with user tier enforcement
- Cost Optimization: Real-time tracking with automatic fallbacks
- High-Tier Features: Custom API keys for Clawback+ users
- Colors β Imported via
tailwind.config.js
undercolors.chatchonk
. - Fonts β Inter (body) & Poppins (headings) loaded in
_app.tsx
. - Components β Re-usable
<Button>
,<Card>
,<Logo>
leverage brand classes (btn-primary
,card
, etc.). - CTA Section appears on landing page hero with gradient background
gradient-primary
. - Accessibility β All interactive elements meet WCAG 2.1 AA contrast;
focus-brand
utility added. - Tone β Playful yet professional copy; always reference benefit to hyper-focused creators.
Early dog-fooding is welcomeβopen issues for any pain-points, especially around ADHD usability or new chat export formats.
None β at this time Built with π±βπ & β by Rip Jonesy.
Version | Supported |
---|---|
5.1.x | β |
5.0.x | β |
Report to ripjonesy498+secchch@gmail.com - Subject: CHCHSECURITY | 4.0.x | β | | < 4.0 | β |
Changes here are minor -to trigger new kimi codereviewer.