Pi connects to any local OpenAI-compatible server by adding a providers entry to ~/.pi/agent/models.json — you give it a baseUrl (the server's /v1 endpoint), an api type (openai-completions for the chat-completions API), a throwaway apiKey, and a list of model ids. No extension, no OAuth; local servers ignore the key, it just has to be present so pi marks the model "available" in /model.
pi session your machine
┌──────────────┐ models.json says: ┌─────────────────────────────┐
│ │ "ollama → │ ollama serve :11434 /v1 │