Skip to main content

Pi

Pi is an AI coding agent that can be configured to use models from NaviGator 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 Toolkit

To configure Pi to use NaviGator 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": "claude-sonnet-4.6"
},
{
"id": "claude-opus-4.6"
}
]
}
}
}

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

The configuration above sets up the NaviGator provider with:

  • Base URL pointing to the UF AI LiteLLM proxy
  • OpenAI-compatible API format
  • Your API key for authentication
  • Two available models: Claude Sonnet 4.6 and Claude Opus 4.6

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

Using Pi with NaviGator Toolkit

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

  1. Launch Pi
  2. Type /models in the chat interface
  3. Select either claude-sonnet-4.6 or claude-opus-4.6 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 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 "claude-sonnet-4.6"

# 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 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