Nap is a macOS menu bar app that automatically manages your AI PC's power state. It keeps your GPU workstation sleeping when idle and wakes it on-demand when AI requests come in.
- 🤖 Auto Wake-on-Demand: When an AI request hits the gateway, Nap wakes your PC automatically
- 💤 Smart Sleep: Sleeps PC after 1 minute of idle (GPU < 10%)
- 📊 GPU Monitoring: Real-time GPU load in menu bar
- 🔌 SSH Protection: Won't sleep if you have active SSH sessions
- 👨 Manual Override: Keep PC awake when needed
- macOS (with Python 3)
- A Windows/Linux PC with:
- NVIDIA GPU (for monitoring)
- Wake-on-LAN enabled in BIOS
- SSH server running
- Passwordless SSH key authentication set up
-
Clone this repo:
git clone https://github.com/YOUR_USERNAME/nap.git cd nap -
Copy and edit the config:
cp config.example.yaml config.yaml # Edit config.yaml with your PC details -
Run the installer:
./install.sh
Edit config.yaml:
pc:
ip: "192.168.1.100" # Your PC's IP
mac: "AA-BB-CC-DD-EE-FF" # Your PC's MAC address
user: "yourname" # SSH username
gpu_threshold: 10 # Sleep if GPU < this %
wait_time_minutes: 5 # Idle threshold
ai_ports: [11434] # Ollama port
proxy:
listen_port: 11435 # Local gateway port
wake_timeout: 30 # Max wake wait (seconds)- 🤖 = PC Online
- 💤 = PC Sleeping
- 👨 = Manual Override (won't auto-sleep)
nap start # Start daemon
nap stop # Stop daemon
nap restart # Restart daemon
nap status # Show PC status
nap wake # Wake PC manually
nap sleep # Sleep PC manually
nap logs # View logsPoint your AI tools to http://localhost:11435 instead of your PC's IP.
Example with Ollama:
export OLLAMA_HOST=http://localhost:11435
ollama run llama2- Gateway: Nap runs a local proxy on port 11435
- Request arrives: If PC is sleeping, Nap sends a Wake-on-LAN packet
- Wait for boot: Waits for the AI service port to become available
- Forward request: Streams the response back to the client
- Auto sleep: After 1 minute of idle, PC goes back to sleep
MIT