Last Updated: 2026-03-27 Status: Phase 1-6 Complete (Future Enhancements Pending)
This document captures the implementation plan for the Flashchat unified management framework. As implementation progresses, changes will be documented here with reasons for any scope modifications.
- Single entry point:
flashchathandles everything - Auto-setup: Missing components detected and prompted on first use
- No separate setup command: Setup is implicit in any command that needs it
| Item | Value |
|---|---|
| Config location | ~/.config/flashchat/config |
| Config created | Automatically on first run |
| PID file | ~/.config/flashchat/server.pid |
| Sessions | ~/.config/flashchat/sessions/ |
| Reset | flashchat config → re-run setup wizard (retains sessions) |
flashchat [command] [options]
Commands:
chat Start chat (auto-sets up if missing)
chat --resume ID Resume session
serve Start API server (auto-sets up if missing)
serve --stop Stop running server
prompt "..." Single prompt (auto-sets up if missing)
config Edit configuration
status Show system status
sessions List sessions
help Show this help
Options:
--config FILE Use specific config
-v, --verbose Verbose output
-q, --quiet Quiet mode| Phase | Description |
|---|---|
| 1 | Config system (directory, template, loader, env support) |
| 2 | flashchat core (entry point, dispatcher, help) |
| 3 | Auto-setup (check/prompt for missing components) |
| 4 | Server & Chat (serve, chat, prompt, auto-start) |
| 5 | Session management (list, resume, delete) |
| 6 | Interactive menu (no command = menu mode) |
- Check if port is in use
- If in use: notify user, suggest next available port (port+1, port+2)
- Let user choose
Changes from original plan:
- None yet - initial implementation matches plan exactly
Completed:
- Phase 1: Config System
- Phase 2: flashchat core
- Phase 3: Auto-setup integration
- Phase 4: Server & Chat
- Phase 5: Session Management
- Phase 6: Interactive Menu
- RUN.md documentation updated
Files created:
flashchat- Unified management CLIlib/config.sh- Configuration loader
Files modified:
metal_infer/infer.m- Added env var supportmetal_infer/extract_weights.py- Added env var supportmetal_infer/export_tokenizer.py- Added env var supportrepack_experts.py- Added env var supportRUN.md- Updated documentation
-
Config reset via
flashchat config✅ IMPLEMENTED- Added
--resetto re-run setup wizard (preserves sessions) - Added
--full-resetto delete all data - Added full config prompts: model repo, max tokens, temperature, top-p, server port, server host, show thinking, color output
- Interactive prompts when run from terminal, defaults when piped
- Added
-
Remove streamchat ✅ COMPLETED
- streamchat has been removed
-
Server persistence validation ✅ COMPLETED
- Server starts and stops correctly
- Status shows running with PID
- Verified serve --stop functionality
-
Chat client integration ✅ COMPLETED
- Verified: chat auto-starts server, connects seamlessly, returns to menu
- Future: Show chat status in full TUI (see below)
-
Enhanced Session Resume in Interactive Menu ✅ COMPLETED
- Shows numbered list of sessions when resuming
- Accepts number (1, 2, 3) or session ID directly
- Example:
Select a session to resume: [1] chat-1234567890 (5 turns) [2] chat-0987654321 (12 turns) Enter number or session ID:
-
Benchmark Commands ✅ COMPLETED
- Added
flashchat benchmarkcommand - Supports: run, verify, bench, moe, moebench, full, fullbench
- Usage:
flashchat benchmark <target>
- Added
- Configuration follows XDG Base Directory Specification
- Model path auto-detection from HuggingFace cache
- Environment variables override config file settings
- Interactive menu provides user-friendly interface
When converting flashchat to a full TUI application, consider:
- Show chat status - Display if chat is active in status view
- Inline chat - Run chat within the TUI instead of spawning separate binary
- Rich status - Show model info, GPU usage, token count, etc.
- Keybindings - Vim-style keybindings (j/k for navigation)
- Themes - Color schemes for light/dark mode
- Split views - Server logs, session history, settings panels