Yep. The screenshot flow is plausible, but I would tighten it a bit so pi can target a stable model ID.
For macOS, this is the clean path to get the latest llama.cpp from source and expose it to pi over the OpenAI-compatible server.
1. Build llama.cpp from source
Requirements:
Then:
Binary should end up at:
For Apple Silicon, GGML_METAL=ON is the important part.
2. Start the server with a stable alias
Your screenshot uses:
I would run it like this instead:
Why --alias matters:
- pi sends a
model string to the OpenAI-compatible endpoint
- using a short stable alias avoids guessing what llama.cpp exposes internally
- your
models.json can use that exact alias
If you want the server reachable from other machines on your LAN, use --host 0.0.0.0 instead.
3. Verify the server
Check that the OpenAI-compatible API is up:
You should see the alias in the response.
Then a quick chat test:
If that works, pi can use it.
4. Configure pi
Create ~/.pi/agent/models.json:
Notes:
apiKey is required by pi config shape, but local llama-server does not care
supportsDeveloperRole: false is a good default for OpenAI-compatible local servers
- if this specific model supports images through llama.cpp later, you can change
input to ["text", "image"]
5. Use it in pi
Then launch pi and select it with /model, or directly:
6. If pi or llama.cpp is picky
If requests fail, the usual compatibility knobs for local OpenAI-compatible servers are:
I would start with only supportsDeveloperRole: false, then add others only if needed.
7. Useful operational notes
Update to latest llama.cpp
Pick another quant
You can swap the model source without changing pi config, as long as you keep the same alias:
Though in practice I would rename the alias to match the quant.
Keep it running
For regular use, run it in tmux:
Recommended final setup
If you want the shortest path, use exactly this:
Build
Run
pi config
If you want, I can next turn this into:
- a copy-paste shell script that installs and builds it, or
- the exact
models.json for a few candidate local models, not just Gemma 4.