Commit Graph

58 Commits

Author SHA1 Message Date
Mai Development
4d7749da7b feat(03-03): implement ProactiveScaler class with hybrid monitoring
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Created ProactiveScaler class for proactive resource management
- Implemented continuous background monitoring with configurable intervals
- Added pre-flight resource checks before operations
- Implemented graceful degradation cascades with stabilization periods
- Added trend analysis for predictive scaling decisions
- Included hysteresis to prevent model switching thrashing
- Provided callbacks for integration with ModelManager
- Thread-safe implementation with proper shutdown handling
2026-01-27 18:40:58 -05:00
Mai Development
4c3cab9dd9 docs(03-02): complete hardware tier detection plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 3/3
- Resource module structure with proper exports
- Configurable hardware tier definitions in YAML
- HardwareTierDetector class with classification logic

SUMMARY: .planning/phases/03-resource-management/03-02-SUMMARY.md
2026-01-27 18:35:41 -05:00
Mai Development
8857ced92a feat(03-02): implement HardwareTierDetector class
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Created comprehensive hardware tier detection system
- Loads configurable tier definitions from YAML
- Classifies systems based on RAM, CPU cores, and GPU capabilities
- Provides model recommendations and performance characteristics
- Includes caching for performance and error handling
- Integrates with ResourceMonitor for real-time data
2026-01-27 18:32:07 -05:00
Mai Development
0b4c270632 feat(03-02): create configurable hardware tier definitions
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added comprehensive tier definitions for low_end, mid_range, high_end
- Configurable thresholds for RAM, CPU cores, GPU requirements
- Model size recommendations per tier (1B-70B parameter range)
- Performance characteristics and scaling thresholds
- Global settings for model selection and scaling behavior
2026-01-27 18:30:42 -05:00
Mai Development
5d93e9715f feat(03-02): create resource module structure
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Created src/resource/__init__.py with module docstring
- Exported HardwareTierDetector (to be implemented)
- Established resource management module foundation
2026-01-27 18:29:38 -05:00
Mai Development
a1db08c72c docs(03-01): complete enhanced GPU detection plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 2/2
- Added pynvml>=11.0.0 dependency for NVIDIA GPU monitoring
- Enhanced ResourceMonitor with pynvml GPU detection and graceful fallbacks
- Optimized performance with caching and failure tracking (~50ms per call)

SUMMARY: .planning/phases/03-resource-management/03-01-SUMMARY.md
2026-01-27 18:25:01 -05:00
Mai Development
0ad2b393a5 perf(03-01): optimize ResourceMonitor performance
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added caching for GPU info to avoid repeated pynvml initialization
- Added pynvml failure tracking to skip repeated failed attempts
- Optimized CPU measurement interval from 1.0s to 0.05s
- Reduced monitoring overhead from ~1000ms to ~50ms per call
- Maintained accuracy while significantly improving performance
2026-01-27 18:21:01 -05:00
Mai Development
8cf9e9ab04 feat(03-01): enhance ResourceMonitor with pynvml GPU detection
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added pynvml import with graceful fallback handling
- Enhanced _get_gpu_info() method using pynvml for NVIDIA GPUs
- Added detailed GPU metrics: total/used/free VRAM, utilization, temperature
- Updated get_current_resources() to include comprehensive GPU info
- Maintained backward compatibility with existing gpu_vram_gb field
- Added gpu-tracker fallback for AMD/Intel GPUs
- Proper error handling for pynvml initialization failures
- Ensured pynvmlShutdown() always called in finally-style logic
2026-01-27 18:17:12 -05:00
Mai Development
e2023754eb feat(03-01): add pynvml dependency for GPU monitoring
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added pynvml>=11.0.0 to main dependencies
- Enables NVIDIA GPU VRAM monitoring capabilities
- Required for enhanced resource detection in Phase 3
2026-01-27 18:14:23 -05:00
Mai Development
1e071398ff docs(03): create phase plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 3: Resource Management
- 4 plan(s) in 2 wave(s)
- 2 parallel, 2 sequential
- Ready for execution
2026-01-27 17:58:09 -05:00
Mai Development
a37b61acce docs(03): research phase domain
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 03: Resource Management
- Standard stack identified: psutil, pynvml, gpu-tracker
- Architecture patterns documented: hybrid monitoring, tier-based management, graceful degradation
- Pitfalls catalogued: GPU detection, aggressive switching, memory leaks, over-technical communication
- Don't-hand-roll items listed for custom implementations
- Code examples provided with official source references
2026-01-27 17:52:47 -05:00
Mai Development
2d24f8f93f docs(03): capture phase context
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 03: resource-management
- Implementation decisions documented
- Resource threshold strategy with dynamic adjustment
- Efficiency-first model selection behavior
- Bottleneck detection with hybrid approach
- Personality-driven user communication
- Drowsy Dere-Tsun Onee-san Hex-Mentor Gremlin persona
2026-01-27 17:46:33 -05:00
Mai Development
f815f4fecf docs(02): complete phase execution
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 02: Safety & Sandboxing
- 4 plans executed across 3 waves
- Security assessment, sandbox execution, audit logging, integration
- Verification passed - all must-haves verified
- Ready for Phase 3: Resource Management
2026-01-27 16:12:18 -05:00
Mai Development
1413433d89 docs(02-04): Add execution summary
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 16:06:39 -05:00
Mai Development
543fe75150 feat(02-04): Create integration tests for safety system
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 16:05:46 -05:00
Mai Development
26a77e612d feat(02-04): Implement safety API interface
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:56:50 -05:00
Mai Development
73155af6be feat(02-04): Create safety coordinator
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:55:07 -05:00
Mai Development
df5ca04c5a docs(02-03): Create comprehensive execution summary for tamper-proof audit logging implementation
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:48:49 -05:00
Mai Development
387c39d90f feat(02-03): Configure comprehensive audit policies with retention and hash chain settings
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:47:47 -05:00
Mai Development
241b9d2dbb feat(02-03): Implement audit logging interface with comprehensive security event methods
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:44:28 -05:00
Mai Development
7ab8e7a983 feat(02-03): Create tamper-proof audit logger with SHA-256 hash chains
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:42:03 -05:00
Mai Development
8b4e31bd47 feat(02-02): Configure sandbox policies
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:37:22 -05:00
Mai Development
9b79107fb3 feat(02-02): Implement sandbox execution interface
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:36:58 -05:00
Mai Development
c254e1df30 feat(02-02): Create Docker sandbox manager
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:36:47 -05:00
Mai Development
c14ab4319e docs(02-01): add execution summary
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:33:12 -05:00
Mai Development
e407c32c82 feat(02-01): add security dependencies and configuration
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:31:19 -05:00
Mai Development
93c26aaf6b feat(02-01): create security assessment module
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:29:56 -05:00
Mai Development
f7d263e173 docs(02): create phase plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 02: Safety & Sandboxing
- 4 plans in 3 waves
- Security assessment, sandbox execution, audit logging, integration
- Wave 1 parallel: assessment (02-01) + sandbox (02-02)
- Wave 2: audit logging (02-03)
- Wave 3: integration (02-04)
- Ready for execution
2026-01-27 14:28:35 -05:00
Mai Development
298d57c037 docs(02): research phase domain
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 02: Safety & Sandboxing
- Standard stack identified (Docker, Bandit, Semgrep)
- Architecture patterns documented (sandbox isolation, security assessment)
- Pitfalls catalogued (container isolation, resource limits)
- Ready for planner to create execution plans
2026-01-27 14:05:49 -05:00
Mai Development
351a1a76d7 docs(02): capture phase context
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 02: Safety & Sandboxing
- Security assessment levels defined
- Audit logging scope established
- Sandbox technology decisions made
- Resource limits policy set
2026-01-27 13:57:06 -05:00
Mai Development
629abbfb0b docs(01): complete model interface phase
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 01: Model Interface & Switching
  - All 3 plans executed and verified
  - LM Studio connectivity, resource monitoring, and intelligent switching implemented
2026-01-27 12:55:04 -05:00
Mai Development
b1a3b5e970 docs(01-03): complete intelligent model switching integration
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 3/3
- ModelManager with intelligent selection and switching
- Core Mai orchestration class
- CLI interface for testing and monitoring

SUMMARY: .planning/phases/01-model-interface/01-03-SUMMARY.md

Phase 1 complete - model interface foundation ready for Phase 2: Safety & Sandboxing
2026-01-27 12:38:43 -05:00
Mai Development
5297df81fb feat(01-03): create CLI entry point for testing
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Implement __main__.py with argparse command-line interface
- Add interactive chat loop for testing model switching
- Include status commands to show current model and resources
- Support models listing and manual model switching
- Add proper signal handling for graceful shutdown
- Include help text and usage examples
- Fix import issues for relative imports in package
2026-01-27 12:33:50 -05:00
Mai Development
24ae542a25 feat(01-03): create core Mai orchestration class
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Initialize ModelManager, ContextManager, and subsystems
- Provide main conversation interface with process_message
- Support both synchronous and async operations
- Add system status monitoring and conversation history
- Include graceful shutdown with signal handlers
- Background resource monitoring and maintenance tasks
- Model switching commands and information methods
2026-01-27 12:26:02 -05:00
Mai Development
0b7b527d33 feat(01-03): implement ModelManager with intelligent switching
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Load model configuration from config/models.yaml
- Intelligent model selection based on system resources and context
- Dynamic model switching with silent behavior (no user notifications)
- Fallback chains for model failures
- Proper resource cleanup and error handling
- Background preloading capability
- Auto-retry on model failures with graceful degradation
2026-01-27 12:23:52 -05:00
Mai Development
2e04873b1a docs(01-02): complete conversation context management plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 2/2
- Created conversation data structures with Pydantic validation
- Implemented intelligent context manager with hybrid compression

SUMMARY: .planning/phases/01-model-interface/01-02-SUMMARY.md
STATE: Updated to reflect Plan 2 completion
ROADMAP: Updated Plan 2 as complete
2026-01-27 12:15:57 -05:00
Mai Development
7bbf5e17f1 fix(01-02): correct ConversationMetadata import and initialization
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Add ConversationMetadata to imports
- Fix metadata initialization in create_conversation()
- Resolve type error for conversation metadata

File: src/models/context_manager.py
2026-01-27 12:12:36 -05:00
Mai Development
ef2eba2a3f feat(01-02): implement context manager with intelligent compression
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Create ContextManager class for conversation history management
- Implement hybrid compression strategy at 70% threshold
- Add message importance scoring for selective retention
- Support system message preservation during compression
- Include conversation statistics and session management
- Provide context retrieval with token limit enforcement

Key methods:
- add_message(): Add messages and trigger compression when needed
- get_context_for_model(): Retrieve context within token limits
- compress_conversation(): Apply hybrid compression preserving important messages
- get_conversation_summary(): Generate conversation summaries

File: src/models/context_manager.py (320 lines)
2026-01-27 12:09:23 -05:00
Mai Development
221717d3a3 feat(01-02): create conversation data structures
Some checks failed
Discord Webhook / git (push) Has been cancelled
- 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)
2026-01-27 12:07:29 -05:00
Mai Development
2ef1eafdb8 docs(01-01): complete LM Studio connectivity and resource monitoring plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
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
2026-01-27 12:03:58 -05:00
Mai Development
446b9baca6 feat(01-01): create model configuration system
Some checks failed
Discord Webhook / git (push) Has been cancelled
- 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
2026-01-27 12:00:30 -05:00
Mai Development
e6f072a6c7 feat(01-01): implement system resource monitoring
Some checks failed
Discord Webhook / git (push) Has been cancelled
- 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
2026-01-27 12:00:06 -05:00
Mai Development
f5ffb7255e feat(01-01): implement LM Studio adapter with model discovery
Some checks failed
Discord Webhook / git (push) Has been cancelled
- 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
2026-01-27 11:59:48 -05:00
Mai Development
de6058f109 feat(01-01): create Python project foundation with dependencies
Some checks failed
Discord Webhook / git (push) Has been cancelled
- 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
2026-01-27 11:59:37 -05:00
Mai Development
1d9f19b8c2 docs(01): create phase plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 01-model-interface: Foundation systems
- 3 plan(s) in 2 wave(s)
- 2 parallel, 1 sequential
- Ready for execution
2026-01-27 10:45:52 -05:00
Mai Development
3268f6712d docs(01): capture phase context
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 01: Model Interface & Switching
- Implementation decisions documented
- Phase boundary established
2026-01-27 09:53:46 -05:00
fe8a2f5bf3 Fixed .png not working
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 05:04:43 +00:00
Mai Development
da20edbc3d docs(01): research phase domain
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 01: Model Interface & Switching
- Standard stack identified (lmstudio-python, psutil)
- Architecture patterns documented (model client factory, resource-aware selection)
- Pitfalls catalogued (memory leaks, context overflow, race conditions)
2026-01-26 23:51:24 -05:00
Mai Development
8adf0d9b4d docs: create milestone-based roadmap with v1.0, v1.1, v1.2 structure
Some checks failed
Discord Webhook / git (push) Has been cancelled
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>
2026-01-26 23:41:06 -05:00
Mai Development
53fb8544fe docs: document and configure MCP tool integration
Some checks failed
Discord Webhook / git (push) Has been cancelled
- 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.
2026-01-26 23:24:00 -05:00