r/PiCodingAgent • u/Ivan_Draga_ • 3d ago
Discussion How to have Pi agent run while laptop is asleep
Sorry, I feel like I'm missing something obvious but can't for the life of me figure this out.
My setup is i have a laptop and a remote AI workstation. Pi agent on the laptop then runs the LLMs served through that workstation running from lemonade AI server.
I know there are multiple ways to do this with tmux or even using ( & with nohup) I'm just like there has to be a way to do this natively right?
I just need to get it to keep working even when the laptop is asleep or closed
12
Upvotes
11
u/adamshand 3d ago
Herdr or Rex are the easy way. Basically you want to run Pi directly on the remote workstation and only use your laptop as a control point.
7
u/SuspiciousName666 3d ago
Why not run Pi directly on your remote workstation and access it via SSH + tmux? Your laptop would just be a client.
I went a bit further with my own project, using pi-durable and Buzz to interact with remote Pi agents without keeping my laptop awake.
https://github.com/forge-z/yewholt
2
u/omppulse 3d ago
Do not fight laptop sleep: run the agent directly on your always-on workstation inside `tmux` (not on the laptop), and treat the laptop as a thin client over SSH + Tailscale. Closing the laptop lid detaches SSH cleanly while the agent keeps running uninterrupted on the workstation, and `tmux attach` drops you straight back in when you reopen it.
Two small things that save headaches with that setup:
(Full disclosure: if you ever run Oh My Pi (`omp`) on that workstation, I built an open-source mobile UI called [OMP Pulse](https://github.com/JulianCodespoti/omp-pulse) that adopts running `tmux` sessions over Tailscale and sends push notifications when a turn finishes or needs input, so you can check in from your phone while the laptop is shut too.)
1
u/rightful_vagabond 3d ago
I do something very similar to this using T3 code. It lets me start off threads in pi and have them go on the server that I start from my phone, my work laptop, or my home computer.
1
u/Slow-Secretary4262 3d ago
if the laptop is sleeping its not possible, closed is possible by disabling handle lid switch, but honestly the best solution is an headless dev LXC or VM in a server
1
u/BenchifyAppDNS 3d ago
I have Pi running 24/7 on a remote workstation with Pi durable and I control it through telegram. Works amazing
1
u/Intelligent-Week-931 3d ago
If you use herder it will be persistent just install on your server and run pi from there
1
u/mycolo_gist 2d ago
Get a VPS.
1
u/rogerfiftyfive 2d ago
I like pi-pocket that runs a pi durable session on the workstation - you connect from laptop phone or others via lan or wireguard. https://github.com/TannerMidd/pi-pocket
1
u/gbrennon 2d ago
u just have to keep agent running somewhere. if u want to switch the laptop into a sleepy state u have to run the agent in a vps
1
u/Limp_Classroom_2645 1d ago
You can run it remotely with Pi-Studio: https://github.com/avatsaev/pi-studio
1
u/Over-Question3395 13h ago
where do yall get remote workstation? do you guys just rent a vps or sumtng?
1
u/runnystool 11h ago
I run https://pi-web.dev on my remote AI workstation. It manages Pi as a daemon that I can connect to from anywhere, including my laptop or phone. Love love love.
0
u/wuteverman 2d ago
You want caffeinate— it will prevent the computer from hibernating on display close. There are options to have it wait for a specific process. It’s a command line utility.
0
u/Enough_Experience_80 3d ago
For remote control I use Paseo For server, keep laptop enabled overnight But there is one more fun solution. Latest android phones have built in Linux, so Ive try to run Paseo and pi on it Works pretty good, just too lazy to move multiple project to it.