r/PiCodingAgent • u/shaggydog97 • 2h ago
Plugin Agent On-Demand; Use multiple local models without keeping them all loaded
I've been trying to utilize my local GPU with different local models, but I couldn't run them all at once and it was a pain to keep starting and stopping them manually.
I built Agent On-Demand, an open-source OhMyPi (OMP) extension that makes local models available as native providers and manages their inference engines automatically.
- Configure multiple models and select them directly in OMP.
- Assign different models to coding, reviewing, research, or the default roles.
- Share a port to run models sequentially, or use different ports to run them concurrently if your hardware allows.
- Automatically start the engine when needed and release its resources when the agent finishes.
- Verify model identity and GPU execution without silent fallback to CPU-only or hosted inference.
Currently supports llama.cpp, tqLLM, Project Maya, and Strata, with qualified configurations documented in the README.
It's MIT-licensed and currently supports OMP 19.4.0 and 19.4.1 on Linux.
I originally built this to share GPU resources between local agents and ML research workloads, but figured others might find it useful.
Feedback and contributions are welcome!
https://github.com/davidandrewcope/agent-ondemand
I have not tested it in pi.dev, but I'm sure it could be modified to support it if anyone is interested.
1
u/winky9827 1h ago
Were you unaware that llama-swap exists?
1
u/repolevedd 1h ago
Why is this designed to work specifically inside Pi, rather than at the API level like llama-swap? What's the advantage of doing it this way? I'm not quite sure how this solves the problem of allocating resources between tasks, especially when multiple programs are running, each in its own isolated sandbox, but there's only one GPU (for example).