Skip to main content

Pi

Pi is an AI coding agent that can be configured to use models from NaviGator AI Toolkit as providers. Once configured, you can use the /models command within Pi to select and switch between different AI models.

pi application

Configuring Pi to use NaviGator AI Toolkit​

To configure Pi to use NaviGator AI Toolkit, you need to create a models.json file in the Pi agent directory:

  1. Open or create the file at ~/.pi/agent/models.json
  2. Add the following configuration:
{
"providers": {
"navigator": {
"baseUrl": "https://api.ai.it.ufl.edu/v1",
"api": "openai-completions",
"apiKey": "YOUR_API_KEY",
"models": [
{
"id": "gemma-4-31b-it"
},
{
"id": "nemotron-3-super-120b-a12b"
},
{
"id": "gpt-oss-120b"
},
{
"id": "codestral-22b"
}
]
}
}
}

Replace YOUR_API_KEY with your actual UF AI virtual key obtained from the NaviGator AI Toolkit UI.

The configuration above sets up the NaviGator AI provider with:

  • Base URL pointing to the UF AI LiteLLM proxy
  • OpenAI-compatible API format
  • Your API key for authentication
  • Four available models: gemma-4-31b-it, nemotron-3-super-120b-a12b, gpt-oss-120b, and codestral-22b

You can add additional models from the NaviGator AI Toolkit by adding more objects to the models array with their respective model IDs.

Using Pi with NaviGator AI Toolkit​

After saving the configuration file and launching Pi, you can use the /models command to select from the configured NaviGator AI models:

  1. Launch Pi
  2. Type /models in the chat interface
  3. Select either gemma-4-31b-it or nemotron-3-super-120b-a12b from the dropdown
  4. Start chatting with your selected AI model

Key Features & Capabilities​

  • Model Switching: Easily switch between different AI models using the /models command
  • Provider Configuration: Configure multiple AI providers in a single JSON file
  • Real-time Updates: Changes to models.json are picked up when Pi restarts
  • Flexible Model Selection: Add any model available in NaviGator AI Toolkit to your configuration

Common Use Cases​

1. Code Generation​

Generate code snippets, functions, or entire files by describing what you need.

2. Code Review​

Have the AI review your code for best practices, security issues, and potential improvements.

3. Debugging Assistance​

Get help identifying and fixing bugs in your code.

4. Learning & Exploration​

Ask questions about programming concepts, APIs, or technologies you're learning.

Best Practices​

  • Start Clear: Begin with specific, well-defined prompts for best results
  • Iterate: Use follow-up questions to refine and improve AI responses
  • Context Matters: Provide relevant code snippets or file context when asking questions
  • Validate Output: Always review and test AI-generated code before using it in production

Getting Started Tips​

  1. Verify Configuration: Ensure your models.json file is valid JSON and correctly formatted
  2. Check API Key: Make sure your UF AI virtual key is active and has the necessary permissions
  3. Test Connection: After configuring, restart Pi and use /models to verify the models appear
  4. Explore Models: Try different models to see which works best for your specific use cases

Example Workflow​

# Launch Pi
pi

# In the Pi interface:
/models
# Select "gemma-4-31b-it"

# Then ask:
"Create a Python function that calculates the factorial of a number using recursion"

# Or for code review:
"Review this JavaScript function for potential issues: [paste your code]"

References

  1. Pi Documentation https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/models.md
  2. NaviGator AI Toolkit https://api.ai.it.ufl.edu/ui
  3. Getting an API Key https://docs.ai.it.ufl.edu/docs/navigator_toolkit/getting_started/quickstart#create-an-api-key