- Define Message, Conversation, ContextBudget, and ContextWindow classes
- Implement MessageRole and MessageType enums for classification
- Add Pydantic models for validation and serialization
- Include importance scoring and token estimation utilities
- Support system, user, assistant, and tool message types
File: src/models/conversation.py (147 lines)
Tasks completed: 4/4
- Created Python project foundation with dependencies
- Implemented LM Studio adapter with model discovery
- Implemented system resource monitoring with trend analysis
- Created model configuration system with fallback chains
SUMMARY: .planning/phases/01-model-interface/01-01-SUMMARY.md
STATE: Updated to reflect plan completion
- Created comprehensive model definitions in config/models.yaml
- Defined model categories: small, medium, large
- Specified resource requirements for each model
- Added context window sizes and capability lists
- Configured fallback chains for graceful degradation
- Included selection rules and switching triggers
- Added context management compression settings
- Created ResourceMonitor class with psutil integration
- Monitor CPU usage, memory availability, and GPU VRAM
- Added resource trend analysis for load prediction
- Implemented should_switch_model() logic based on thresholds
- Added can_load_model() method with safety margins
- Follow Pattern 2 from research: Resource-Aware Model Selection
- Graceful handling of missing gpu-tracker dependency
- Created LMStudioAdapter class using lmstudio-python SDK
- Added context manager get_client() for safe client handling
- Implemented list_available_models() with size estimation
- Added load_model(), unload_model(), get_model_info() methods
- Created mock_lmstudio.py for graceful fallback when lmstudio not installed
- Included error handling for LM Studio not running and model loading failures
- Implemented Pattern 1 from research: Model Client Factory
- Created pyproject.toml with lmstudio, psutil, pydantic dependencies
- Created requirements.txt as fallback for pip install
- Created src/models/__init__.py with proper imports
- Set up PEP 518 compliant package structure
- Fixed .gitignore to allow src/models/ directory
Organizes 15 phases into three major milestones:
- v1.0 Core (Phases 1-5): Foundation systems with models, safety, memory
- v1.1 Interfaces (Phases 6-10): CLI, self-improvement, approval, personality, Discord
- v1.2 Presence (Phases 11-15): Offline, voice visualization, avatar, Android, sync
Maps all 99 requirements to phases with success criteria per milestone.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Create comprehensive MCP.md documenting all available tools:
* Hugging Face Hub (models, datasets, papers, spaces, docs)
* Web search and fetch for research
* Code tools (Bash, Git, file ops)
* Claude Code (GSD) workflow agents
- Map MCP usage to specific phases:
* Phase 1: Model discovery (Mistral, Llama, quantized options)
* Phase 2: Safety research (sandboxing, verification papers)
* Phase 5: Conversation datasets and papers
* Phase 12: Voice visualization models and spaces
* Phase 13: Avatar generation tools and research
* Phase 14: Mobile inference frameworks and patterns
- Update config.json with MCP settings:
* Enable Hugging Face (mystiatech authenticated)
* Enable WebSearch for current practices
* Set default result limits
- Update PROJECT.md constraints to document MCP enablement
Research phases will leverage MCPs extensively for optimal
library/model selection, architecture patterns, and best practices.
- Enable git push.autoSetupRemote for automatic tracking setup
- Add push.followTags to include tags in pushes
- Install post-commit hook for automatic push after each commit
- Update config.json to document auto-push behavior
- Remote: master (giteas.fullmooncyberworks.com/mystiatech/Mai)
All commits will now automatically push to the remote branch.
- Update PROJECT.md: Add Android, visualizer, and avatar to v1
- Update REQUIREMENTS.md: 99 requirements across 15 phases (fresh slate)
- Add comprehensive README.md with setup, architecture, and usage
- Add PROGRESS.md for Discord forum sharing
- Add .gitignore for Python/.venv and project artifacts
- Note: All development via Claude Code/OpenCode workflow
- Note: Python deps managed via .venv virtual environment
Core value: Mai is a real collaborator, not a tool. She learns from you,
improves herself, has boundaries and opinions, and becomes more *her* over time.
v1 includes: Model interface, Safety, Resources, Memory, Conversation,
CLI, Self-Improvement, Approval, Personality, Discord, Offline, Voice
Visualization, Avatar, Android App, Device Sync.
- Added missing <verify> element to Plan 06-05
- Created Plan 06-07 for help system gap
- Created Plan 06-08 for exit command gap
- Now addresses all 4 gaps identified by checker