How mapembert/bolt.new-any-llm works
Main Components
a) Frontend Layer:
• React-based UI components (under app/components/)
• Key modules:
• Chat interface
• Code editor (CodeMirror integration)
• Workbench
• Terminal emulator
• File tree viewer
b) Core Services Layer:
• LLM Integration Service
• Multiple model providers (OpenAI, Anthropic, Ollama, Groq, etc.)
• Model switching capability
• Streaming response handling
c) Runtime Environment:
• WebContainer System
• Node.js runtime
• Package management
• File system operations
• Terminal emulation
d) State Management:
• Multiple stores for:
• Chat
• Editor
• Files
• Previews
• Settings
• Terminal
• Theme
• Workbench
┌─ User Interface Layer ─────────────────────────────┐
• ┌─────────┐ ┌──────────┐ ┌────────┐ ┌──────────┐ │
• Chat │ │ Editor │ │Preview │ │ Terminal │ │
• ┘ └──────────┘ └────────┘ └──────────┘ │
• ┬───────────────────────────┘
┌───────────────────────▼───────────────────────────┐
• Core Services Layer │
• ┌─────────────────┐ ┌────────────────────────┐ │
• LLM Integration │ │ Message Parser/Runtime │ │
• OpenAI │ │ - Action Runner │ │
• Anthropic │ │ - Stream Processing │ │
• Ollama │ └────────────────────────┘ │
• Groq │ │
• ┘ │
• ┬───────────────────────────┘
┌───────────────────────▼───────────────────────────┐
• WebContainer Runtime │
• ┌─────────┐ ┌──────────┐ ┌────────────────────┐ │
• Node.js │ │ NPM │ │ File System Access │ │
• ┘ └──────────┘ └────────────────────┘ │
• ┘
Important Flows to Highlight
a) User Input Flow:
• Chat input → LLM Processing → Action Generation → Runtime Execution
b) File Operation Flow:
• Editor Changes → File System → Preview Updates
c) Terminal Command Flow:
• Terminal Input → WebContainer Execution → Output Display
Additional Elements
• Version/environment indicators
• External service connections (API endpoints)
• Security boundaries
Implementation Notes
• Use double lines for data streaming
• In-browser full-stack development capability
• Multi-model LLM integration
• Real-time preview and execution
• Seamless state management across components