Buff is a privacy-first AI workspace that runs entirely on your machine. Built as a modern monorepo using Bun and pnpm, it provides a clean local environment for chat, model management, and history workflows across API, web, and CLI surfaces.
Key Features:
- 🔒 Privacy-First: All data stays on your machine
- 🚀 Local-First: No cloud dependencies required
- 🎯 Multi-Surface: API, Web UI, and CLI interfaces
- 🔧 Extensible: Clean architecture with pluggable AI providers
Inspired by Complexia, Buff aims to provide a universe of AI-simulated worlds for universal forecasting through society simulation.
# Clone the repository
git clone https://github.com/betheer/buff.git
cd buff
# Install dependencies
pnpm install# Start the API server
pnpm dev:api
# Start the web interface (in a new terminal)
pnpm dev:web
# Use the CLI
pnpm cli -- modelsBuff is structured as a monorepo with clear separation of concerns:
buff/
├── apps/
│ ├── api/ # NestJS API server
│ ├── web/ # React + Vite web interface
│ └── cli/ # Bun-powered CLI
└── packages/
├── config/ # Shared configuration
├── shared/ # Common utilities
├── ui/ # React components
├── ai/ # AI provider contracts
└── db/ # Database layer
API (apps/api)
NestJS server exposing local AI workspace endpoints at http://localhost:3000
Web (apps/web)
React application with Vite, providing a browser-based workspace interface at http://localhost:5173
CLI (apps/cli)
Terminal interface for quick interactions:
buff chat <message>- Chat with AIbuff models- List available modelsbuff history- View conversation history
# Development
pnpm dev:api # Start API server (http://localhost:3000)
pnpm dev:web # Start web UI (http://localhost:5173)
pnpm cli -- <cmd> # Run CLI commands
# Quality
pnpm typecheck # Type check all packages
pnpm test # Run all tests
# Build
pnpm build # Build all packagesPhase 1: ✅ Complete - Scaffold and foundation Phase 2: 🚧 In Progress - Local chat with SQLite and AI providers
Current implementation includes:
- Runnable foundation with three app surfaces
- Clean monorepo boundaries
- Health endpoints and scaffold verification
- Local-first data storage patterns
- Runtime: Bun
- Package Manager: pnpm
- Backend: NestJS
- Frontend: React + Vite
- Database: SQLite with Prisma
- AI Providers: Anthropic, Groq, DeepSeek, Alibaba (pluggable)
- Language: TypeScript
We welcome contributions! Please see our Contributing Guide for details on:
- Code of conduct
- Development workflow
- Pull request process
- Coding standards
This project is licensed under the MIT License - see the LICENSE file for details.
Inspired by Complexia and the vision of universal forecasting through AI-simulated societies.
Made with ❤️ by the Buff team