How nightystudios/mlpg works
Project type and purpose
• MLPG is a standalone Python application offering both a desktop GUI (UI.py) and a console‐based CLI (mlpg.py / mlpg entry point).
• Purpose: Provide a “playground” for ML engineers to download, list, run, and delete AI models locally.
File structure
• Top‐level scripts:
• UI.py – launches the graphical interface
• mlpg.py / mlpg.bat – CLI entry point
• download_model.py / list_models.py / use_model.py / del_model.py – core CLI commands
• src/ – contains shared business logic and helper modules (model I/O, inference wrappers, config management)
• requirements.txt – lists external dependencies (PyTorch, sentencepiece, etc.)
• README.md – explains features and setup.
README for additional insights
• Two interfaces (GUI vs CLI) both rely on the same core modules.
• External requirements: CUDA-enabled PyTorch or CPU fallback.
• Models are stored/managed locally; list_models.py reflects supported models.
a. Main components
• User Interfaces
– GUI Layer (UI.py + Streamlit?/Tkinter?)
– CLI Layer (mlpg.py / entry scripts)
• Core Service Layer (src/)
– Model Manager (download, list, delete)
– Inference Engine (use_model)
– Configuration & Logging
• Local Storage
– Models folder (downloaded checkpoints, metadata)
• External Services & Repos
– Model hosting endpoints (HuggingFace, custom URLs)
• External Dependencies
– PyTorch (+ CUDA)
– sentencepiece
b. Relationships & interactions
• UI/CLI → Core Service Layer (function calls or module imports)
• Core Service → Local Storage (read/write model files)
• Core Service → External Services (HTTP to download models)
• Inference Engine → PyTorch (runs forward pass)
• Inference Engine → sentencepiece (tokenization)
c. Architectural patterns & design principles
• Layered architecture: Presentation (UI/CLI) → Business (Core Service) → Data (Local Storage)
• Single process, modular Python packages
• Clear separation: each command is a thin wrapper around core modules.
d. Relevant technologies
• Python 3.12
• PyTorch (GPU/CPU)
• sentencepiece
• Optional: future Streamlit for GUI