PenphinMind is an AI assistant that interfaces with the M5Stack LLM Module to provide a chat interface and model management capabilities. Running on Raspberry Pi, PenphinMind can plug into various devices to control them, with the first implementation being an arcade-style device called "Penphin" featuring a 64x64 RGB LED matrix display.
-
Interactive menu system with the following options:
- Chat: Start a conversation with the LLM model
- Configure: View and select available models
- Reboot: Reboot the M5Stack device
- Exit: Exit the application
-
Hardware information display at the top of the interface
-
Model configuration and selection
-
Real-time chat with LLM models
-
Generative game creation and pixel art animation
-
Visual identity animation on 64x64 LED matrix
-
Futurama-inspired "What-If Machine" capabilities
- Brain Language & Auditory Centers: Utilizes AX630C device for speech processing
- Visual Cortex: 64x64 RGB LED matrix for visual output and animations
- Auditory Output: Configurable for local or device speakers (including Mac)
- Core Processing: Raspberry Pi connected to M5Stack LLM Module
-
Clone the repository
-
Install dependencies:
pip install -r requirements.txtFor macOS specific dependencies:
pip install -r requirements_macos.txt
Run the application with:
python main.py --connection tcp
Connection options:
tcp: Connect via WiFi (default)serial: Connect via Serial portadb: Connect via ADB
PenphinMind starts in full mode by default, but you can run specific brain regions for debugging or targeted functionality:
python run.py --mode fc
Available modes:
full: Run the complete brain (default)fc: Frontal Cortex only - for working with just the LLMac: Auditory Cortex only - for testing audio featuresvc: Visual Cortex only - for testing LED matrixdebug: Enhanced debugging mode with verbose output
The main menu provides the following options:
- Chat: Start a conversation with the LLM
- Configure: View and select available models
- Reboot: Reboot the M5Stack device
- Exit: Exit the application
In the chat interface:
- Type your message and press Enter to send
- Type 'exit' to return to the main menu
- Type 'reset' to reset the LLM
The Configure option allows you to:
- View all available models on the local llm grouped by type
- Select a model to view detailed information
- Set a model as the active model for chat
Hardware information is displayed at the top of the interface, showing:
- CPU load
- Memory usage
- Temperature
- Last update timestamp
PenphinMind can generate pixel art animations suitable for the 64x64 display:
- Converts prompts into visually appealing pixel art
- Optimizes images for LED matrix display
- Supports animation sequences
- Integrates with the OpenAI API for image generation
The GameCortex module provides:
- Self-playing mini-games generated from text prompts
- Animation and visualization components
- Slot machine-like randomized game elements
- Cellular automata visualizations
Inspired by Futurama's "What-If Machine," this module allows PenphinMind to:
- Generate creative responses to hypothetical scenarios
- Visualize results through pixel art generation
- Create self-playing mini-games based on prompts
- Display results on the 64x64 LED matrix
PenphinMind is structured to mirror biological cognition. It is built around the interaction between a central Mind and distributed processing across hemispheres and subcortices. The new structure enforces clarity, modularity, and neuro-symbolic metaphor:
/PenphinMind/
├── Interaction/ # Input/output interface
├── Mind/ # Root mind controller and main loop
├───── LeftHemisphere/ # Logical and control cortices
├───── RightHemisphere/ # Creative and perceptual cortices
├───── Subcortices/ # Non-cortical regions (Basal Ganglia, Cerebellum)
├───── CorpusCallosum/ # Inter-hemispheric communication
Interaction/creates aMindinstanceMind/routes requests to:- A
Hemisphere(Left or Right), or - The
CorpusCallosum(if cross-talk or integration is needed)
- A
- Each
Hemispherecontains:- A
hemisphere_interface.py - Cortex folders (e.g.,
PrefrontalCortex/,GameCortex/,PsychicCortex/,SomatasensoryCortex/, etc )
- A
- Each cortex has:
cortex_interface.py(public entrypoint)- Internal submodules
- Cortex-to-cortex communication is restricted to the same hemisphere
- Cross-hemisphere calls must go through
CorpusCallosum
- LeftHemisphere → Logical control, Prefrontal, Language
- RightHemisphere → Visual, Creative, Emotional
- Subcortices → Motor control, reinforcement learning
- CorpusCallosum → Bridge logic and routing between hemispheres
mind.py→ Talks only to hemispheres or corpushemisphere_interface.py→ Talks only to cortices inside itcortex_interface.py→ Handles all cortex-specific logic and delegates to submodules
The GameCortex module implements:
/Mind/GameCortex/
├── base_module.py # Base module for all game components
├── game_manager.py # Manages game state and interactions
├── Visualizers/ # Visual effects for the LED matrix
├── Slots/ # Slot machine game components
├── Automata/ # Cellular automata visualizations
All game modules inherit from BaseModule which properly manages:
- Animation state control
- Resource cleanup
- Frame timing
- Debug visualization
The project features an animated visualization that blends:
- 🔴 Red Dolphin (logical time)
- 🔵 Blue Penguin (intuitive depth)
- 🟣 Purple fusion symbolizing "Penphin Flow"
- 🟡 Gold-orange animated background with pulse effects
- 🎖 "PENPHINMIND" logo glowing beneath the emblem
This animation plays as a boot-up identity sequence on 64x64 LED displays using RGBMatrix.
(TODO update strcuture for hemisphere refactor)
/PenphinMind/
├── Mind/ # Primary brain processing
│ ├── OccipitalLobe/ # Visual processing
│ ├── TemporalLobe/ # Auditory processing
│ ├── GameCortex/ # Game generation
│ └── CorpusCallosum/ # Inter-module communication
├── Interaction/ # User interface components
├── api/ # External API integrations
├── documentation/ # Project documentation
├── tests/ # Test suite
└── requirements.txt # Dependencies
This project is licensed under the MIT License.
