Roo Code is an AI-powered VS Code extension that empowers developers to build better software faster with intelligent coding assistance. TrueFoundry’s AI Gateway integrates seamlessly with Roo Code, providing access to multiple AI models through a unified, secure, and cost-optimized interface. By connecting Roo Code to TrueFoundry’s AI Gateway, you can leverage advanced AI capabilities for code generation, debugging, and development tasks while benefiting from TrueFoundry’s enterprise-grade features including security, compliance, and cost management.

Prerequisites

Before integrating Roo Code with TrueFoundry, ensure you have:
  1. Roo Code Extension: Install Roo Code from the VS Code Marketplace
  2. TrueFoundry Authentication Token: Create a Personal Access Token or Virtual Account by following the instructions in Generating Tokens
  3. TrueFoundry Gateway Access: Ensure you have access to your TrueFoundry AI Gateway with the format https://your-control-plane.truefoundry.cloud/api/llm

Integration Guide

Step 1: Install Roo Code Extension

If you haven’t already installed Roo Code:
  1. Open VS Code: Launch Visual Studio Code
  2. Access Extensions: Click the Extensions icon in the Activity Bar (Ctrl+Shift+X)
  3. Search for Roo Code: Type “Roo Code” in the search bar
  4. Install Extension: Click “Install” on the Roo Code extension by RooCode

Install Roo Code from VS Code Marketplace

Step 2: Get TrueFoundry Gateway Configuration

Before configuring Roo Code, gather your TrueFoundry Gateway details:
  1. Navigate to AI Gateway Playground: Go to your TrueFoundry AI Gateway playground
  2. Access Unified Code Snippet: Use the OpenAI library code snippet
  3. Copy Configuration Details: You will get the base URL and authentication details

Get Configuration from TrueFoundry Gateway

Step 3: Configure Roo Code with TrueFoundry Gateway

  1. Open Roo Code Sidebar: Click the Roo Code icon (🦘) in the VS Code Activity Bar
  2. Access Configuration: In the welcome screen or settings, look for API provider configuration
  3. Select Custom Provider: Choose “Custom” or “OpenAI Compatible” from the provider dropdown
  4. Configure TrueFoundry Settings:
    • Base URL: Enter your TrueFoundry Gateway URL (e.g., https://your-control-plane.truefoundry.cloud/api/llm)
    • API Key: Paste your TrueFoundry authentication token
    • Model Name: Copy the model name from our Gateway playground”

TrueFoundry Configuration in Roo Code

Step 4: Select AI Model

  1. Choose Model: Select your preferred model from TrueFoundry’s available models
  2. Get Model ID: Copy the model ID from your TrueFoundry Gateway (e.g., openai-main/gpt-4o)
  3. Configure Model: Enter the model ID in Roo Code’s model selection field

Copy Model ID from TrueFoundry Gateway

Recommended Models for Roo Code:
  • openai-main/gpt-4o: Best for complex code generation and reasoning tasks
  • anthropic-main/claude-3-5-sonnet: Excellent for code understanding and following instructions
  • Use the exact model ID as shown in your TrueFoundry Gateway playground

Step 5: Test Your Integration

  1. Save Configuration: Click “Save” or “Let’s go!” to apply your settings
  2. Test Connection: Open a code file and try asking Roo Code a question
  3. Verify Functionality: Ensure responses are generated through TrueFoundry Gateway

Testing Roo Code with TrueFoundry

Advanced Configuration

Multiple Model Profiles

Configure different profiles for various use cases:
{
  "roocode.apiProfiles": [
    {
      "name": "TrueFoundry GPT-4",
      "baseUrl": "https://your-control-plane.truefoundry.cloud/api/llm",
      "apiKey": "your-truefoundry-token",
      "model": "openai-main/gpt-4o",
      "description": "High-quality code generation"
    },
    {
      "name": "TrueFoundry Fast",
      "baseUrl": "https://your-control-plane.truefoundry.cloud/api/llm", 
      "apiKey": "your-truefoundry-token",
      "model": "openai-main/gpt-3.5-turbo",
      "description": "Quick responses for simple tasks"
    }
  ]
}

Custom Instructions

Enhance Roo Code’s performance with TrueFoundry by setting custom instructions:
You are an expert software developer working with enterprise-grade code.
Prioritize:
- Security best practices
- Performance optimization
- Clean, maintainable code
- Comprehensive error handling
- Detailed documentation

When suggesting code changes, always consider:
- Code review standards
- Testing requirements
- Scalability implications
All your calls from Roo Code will now go through the TrueFoundry Gateway.