# Roo Code

Use Tensorix models as your AI coding agent in VS Code with Roo Code — featuring multiple specialized modes, custom instructions, and multi-agent orchestration.

***

## Overview

[Roo Code](https://roocode.com) is an open-source AI coding agent for VS Code, ranked #10 on [OpenRouter](https://openrouter.ai/apps) by usage. It provides a full dev team of AI agents in your editor with specialized modes for coding, debugging, architecture, and more. Roo Code supports OpenAI-compatible API providers, making it easy to connect to Tensorix.

{% hint style="success" %}
**Why Roo Code + Tensorix?**

* 🧠 **Multiple modes** — Code, Architect, Debug, Ask, and Orchestrator built in
* 🔄 **Boomerang orchestration** — Coordinate multi-step tasks across modes
* 📁 **Full codebase access** — Read, edit, run commands, and browse the web
* 🎯 **Custom modes** — Create specialized personas with file restrictions
* 💰 **Cost-effective** — Use powerful open-source models at a fraction of the cost
  {% endhint %}

***

## Prerequisites

* **VS Code** (latest version recommended)
* A Tensorix API key ([sign up here](https://app.tensorix.ai/register))

***

## Setup

### Step 1: Install Roo Code

1. Open VS Code
2. Go to the **Extensions** panel (`Ctrl+Shift+X` / `Cmd+Shift+X`)
3. Search for **"Roo Code"**
4. Click **Install**

### Step 2: Configure Tensorix

1. Open the Roo Code panel (click the Roo Code icon in the sidebar)
2. Click the **gear icon** to open settings
3. Configure the following:

| Setting          | Value                        |
| ---------------- | ---------------------------- |
| **API Provider** | `OpenAI Compatible`          |
| **Base URL**     | `https://api.tensorix.ai/v1` |
| **API Key**      | Your Tensorix API key        |
| **Model**        | `z-ai/glm-5.1`               |

### Step 3: Configure Model Settings (Optional)

Under **Model Configuration**, you can customize:

| Setting               | Recommended Value                                                   |
| --------------------- | ------------------------------------------------------------------- |
| **Context Window**    | See model specs on [tensorix.ai/models](https://tensorix.ai/models) |
| **Max Output Tokens** | `16384`                                                             |

***

## Using Modes

Roo Code includes five built-in modes, each with different capabilities:

| Mode               | Slash Command   | Best For                                        |
| ------------------ | --------------- | ----------------------------------------------- |
| **Code** (default) | `/code`         | Writing code, implementing features, debugging  |
| **Architect**      | `/architect`    | System design, planning, architecture decisions |
| **Debug**          | `/debug`        | Tracking bugs, diagnosing errors                |
| **Ask**            | `/ask`          | Code explanation, learning, technical questions |
| **Orchestrator**   | `/orchestrator` | Multi-step projects, coordinating across modes  |

Switch modes using:

* The dropdown menu (left of chat input)
* Slash commands: `/code`, `/architect`, `/debug`, `/ask`, `/orchestrator`
* Keyboard shortcut: `Cmd+.` (macOS) or `Ctrl+.` (Windows/Linux)

***

## Recommended Models

| Use Case         | Model                         | Why                                      |
| ---------------- | ----------------------------- | ---------------------------------------- |
| **Coding** ⭐     | `z-ai/glm-5.1`                | Top coding performance, strong reasoning |
| **Reasoning**    | `minimax/minimax-m2.5`        | Complex analysis, function calling       |
| **Architecture** | `deepseek/deepseek-r1-0528`   | Deep reasoning for design decisions      |
| **Vision**       | `moonshotai/kimi-k2.5`        | Image understanding, long context        |
| **General chat** | `deepseek/deepseek-chat-v3.1` | Balanced performance and cost            |
| **Fast tasks**   | `minimax/minimax-m2`          | Quick responses, cost-sensitive          |

{% hint style="info" %}
**Tip:** Use API Configuration Profiles to set different models for different modes — e.g., GLM-5.1 for Code mode, DeepSeek R1 for Architect mode.
{% endhint %}

***

## API Configuration Profiles

Roo Code supports per-mode API profiles, so you can use different models for different tasks:

1. Open Roo Code settings (gear icon)
2. Navigate to **API Configuration Profiles**
3. Create profiles for each mode with different Tensorix models

Example setup:

| Profile   | Provider          | Model                       | Use With       |
| --------- | ----------------- | --------------------------- | -------------- |
| Coding    | OpenAI Compatible | `z-ai/glm-5.1`              | Code mode      |
| Reasoning | OpenAI Compatible | `deepseek/deepseek-r1-0528` | Architect mode |
| Fast      | OpenAI Compatible | `minimax/minimax-m2`        | Ask mode       |

All profiles use the same Base URL (`https://api.tensorix.ai/v1`) and API key.

***

## Custom Modes

Create specialized modes by adding a `.roomodes` file to your project root:

```yaml
customModes:
  - slug: reviewer
    name: "Code Reviewer"
    roleDefinition: >-
      You are a senior code reviewer focused on code quality,
      security, and best practices.
    groups:
      - read
      - browser
    customInstructions: |
      Review code for bugs, security issues, and style.
      Suggest improvements with specific examples.

  - slug: docs-writer
    name: "Documentation Writer"
    roleDefinition: You are a technical writer specializing in clear documentation.
    groups:
      - read
      - - edit
        - fileRegex: \.(md|mdx)$
          description: Markdown files only
      - browser
```

***

## Troubleshooting

### Model Not Responding

1. Verify your API key is correct in Roo Code settings
2. Ensure the Base URL is exactly `https://api.tensorix.ai/v1`
3. Check your Tensorix credit balance at [app.tensorix.ai](https://app.tensorix.ai/dashboard)

### Context Window Errors

Update the **Context Window** in Model Configuration to match your chosen model. Check [tensorix.ai/models](https://tensorix.ai/models) for current specs.

### Slow Responses

Try switching to a faster model like `minimax/minimax-m2` for simple tasks, or reduce the **Max Output Tokens** setting.

***

## See Also

* [Roo Code Documentation](https://docs.roocode.com/)
* [Roo Code on GitHub](https://github.com/roocodeinc/roo-code)
* [Cline Integration](/ai-coding-assistants/cline.md) — Similar VS Code extension
* [Kilo Code Integration](/ai-coding-assistants/kilo-code.md) — Another VS Code coding agent
* [Tensorix Models](https://tensorix.ai/models)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tensorix.ai/ai-coding-assistants/roo-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
