Commit Graph

21 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
c70ee8816e Complete fresh slate 2026-01-26 22:43:41 -05:00
Mai Development
7c98aec306 Initial commit: Clean slate for Mai project 2026-01-26 22:40:49 -05:00