-
Notifications
You must be signed in to change notification settings - Fork 361
Description
Roo Code-VSCode 插件配置教程
Configuration Guide for Roo Code-VSCode Plugin
Roo Code 是一款 AI 编程辅助工具,通过合理配置让其配合 AIstudioProxyAPI 项目可以让它更好地为你服务。
Roo Code is an AI programming assistant tool. Proper configuration with the AIstudioProxyAPI project can optimize its performance.
截图 Screenshots
Roo Code 配置(文字)
Roo Code Configuration (Text Instructions)
一、提供商 (Provider) 设置
Provider Settings
这是配置 AI 服务核心连接的地方。
This section configures the core connection to the AI service.
-
配置文件 (Configuration File)
- 你可以自定义一个名为 aistudio 的配置。Roo Code 允许保存多个 API 配置,方便快速切换。
You can create a custom configuration named "aistudio". Roo Code supports saving multiple API profiles for quick switching. - 点击旁边的 + 号可以添加新的提供商配置,点击垃圾桶图标🗑️可以删除当前配置。
Click the "+" to add new configurations, click the trash icon 🗑️ to delete. - 点击左右箭头可以切换不同的已保存配置。
Use arrow buttons to switch between saved configurations.
- 你可以自定义一个名为 aistudio 的配置。Roo Code 允许保存多个 API 配置,方便快速切换。
-
API 提供商 (API Provider)
- 当前选择的是 OpenAI Compatible。这意味着你可以连接任何兼容 OpenAI API 格式的服务。
Select "OpenAI Compatible" to connect with any OpenAI-compatible API service. - 你可以点击下拉菜单选择其他类型的提供商(不过多解释)。
Dropdown menu offers other provider types (not detailed here). - 旁边的 OpenAI Compatible 文档 链接可以引导你查看相关 API 文档。
"OpenAI Compatible Docs" link provides API documentation.
- 当前选择的是 OpenAI Compatible。这意味着你可以连接任何兼容 OpenAI API 格式的服务。
-
OpenAI 基础 URL (OpenAI Base URL)
- 这里需要填写你所使用的 OpenAI 兼容服务的 API 地址。
Enter your OpenAI-compatible API endpoint URL. - 示例中填写的是
http://127.0.0.1:2048/v1,这通常是本地部署的 AI 服务地址。请根据你的实际情况修改。
Example:http://127.0.0.1:2048/v1(typical for local deployments). Modify according to your setup.
- 这里需要填写你所使用的 OpenAI 兼容服务的 API 地址。
-
OpenAI API 密钥 (OpenAI API Key)
- 在此处填入你的 API 密钥。这是访问 AI 服务所必需的凭证。如果项目没有设置秘钥,可随便填写。
Enter your API key (required for authentication). If no key is needed, fill any value.
- 在此处填入你的 API 密钥。这是访问 AI 服务所必需的凭证。如果项目没有设置秘钥,可随便填写。
-
模型 (Model)
- 选择你希望使用的具体 AI 模型。示例中是
gemini-2.5-pro-preview-05-06。
Select your AI model. Example:gemini-2.5-pro-preview-05-06. - 插件会尝试自动从你配置的 API 服务获取可用的模型列表,方便你选择。
Plugin auto-fetches available models from your API service.
- 选择你希望使用的具体 AI 模型。示例中是
-
底部复选框选项
- ⬜ 启用 R1 模型参数 (Enable R1 Model Parameters): 当使用 QWQ 等 R1 系列模型时必须启用,避免出现 400 错误。我们的项目不需要。
Required for R1 models (e.g. QWQ) to prevent 400 errors. Not needed for our project. - ✅ 使用传统 OpenAI API 格式 (Use traditional OpenAI API format): 我们的服务兼容旧版的 API 格式,可以勾选此项。
Check for compatibility with legacy OpenAI API format. - ✅ 启用流式传输 (Enable streaming): 启用后,AI 的回复会像打字一样逐字显示,而不是等待全部生成完毕后一次性显示。这通常能提升交互体验。
Enables real-time streaming responses (typing effect). Improves interaction experience. - ⬜ 使用 Azure 服务 (Use Azure services): 如果你使用的是 Azure OpenAI 服务,请勾选此项,并可能需要填写额外的 Azure 相关配置。我们的项目不需要。
Check if using Azure OpenAI (requires additional config). Not needed for our project.
- ⬜ 启用 R1 模型参数 (Enable R1 Model Parameters): 当使用 QWQ 等 R1 系列模型时必须启用,避免出现 400 错误。我们的项目不需要。
二、上下文 (Context) 设置
Context Settings
这部分设置管理 AI 在与你交互时能够“记住”或参考的信息量和范围。我们的项目在使用中推荐放宽限制获得满血体验。
These settings control how much information the AI can reference during interactions. Recommended to relax limits for optimal performance.
-
管理 AI 上下文信息 (影响 token 用量和回答质量)
Manage AI context (affects token usage and response quality) -
标签页数量限制 (Tab count limit)
- 这里设置为 30。它限制了 AI 在生成回答时会参考的已打开标签页的最大数量。
Set to 30. Limits max open tabs the AI can reference. - 提示: “限制可以适当放宽”。如果你的项目需要在多个打开文件间获取信息,可以适当调高此数值,但注意越高的数值可能会消耗越多的 token。
Tip: "Limits can be relaxed". Increase if working with multiple files, but higher values consume more tokens.
- 这里设置为 30。它限制了 AI 在生成回答时会参考的已打开标签页的最大数量。
-
工作区文件限制 (Workspace file limit)
- 这里设置为 230。它限制了 AI 在工作区内会扫描或参考的文件最大数量。
Set to 230. Limits max files the AI can scan in your workspace. - 提示: 越高的数值会消耗越多的 token。
Tip: Higher values consume more tokens.
- 这里设置为 230。它限制了 AI 在工作区内会扫描或参考的文件最大数量。
-
在列表和搜索中显示 .rooignore 文件 (Display .rooignore file in lists and searches)
- ✅ 勾选此项后,.rooignore 文件(类似于 .gitignore,用于指定 Roo Code 忽略的文件或文件夹)会在文件列表和搜索结果中显示并标记锁定符号。禁用时,这些文件将从文件列表和搜索中完全隐藏。
When checked, .rooignore files (similar to .gitignore) show with lock icons. When disabled, they're hidden completely.
- ✅ 勾选此项后,.rooignore 文件(类似于 .gitignore,用于指定 Roo Code 忽略的文件或文件夹)会在文件列表和搜索结果中显示并标记锁定符号。禁用时,这些文件将从文件列表和搜索中完全隐藏。
-
文件读取自动截断阈值 (File read auto-truncation threshold)
- 这里设置为 -1。
Set to -1. -1: 始终读取整个文件。
-1: Always read entire files.0: 仅生成行号索引,较小值可节省 token,支持后续使用行号进行读取。
0: Only generate line number indexes (saves tokens).- 提示: “节约时间, 完整读取, token随便造”。如果你不担心 token 消耗且希望 AI 获取最完整的文件信息,可以选择 -1。
Tip: "Save time, read fully, tokens unlimited". Use -1 for maximum file context. - 这里我们强烈推荐使用-1
We strongly recommend -1
- 这里设置为 -1。
三、模型高级设置 (Model Advanced Settings)
Model Advanced Settings
这些设置通常与所选模型的具体能力和限制有关。
These settings relate to your selected model's capabilities and limitations.
-
最大输出 Token 数 (Max output Token count)
- 设置为 -1。
Set to -1. - 这指定了模型在一次响应中可以生成的最大 Token 数量。
Maximum tokens the model can generate per response. - 设置为 -1 意味着允许服务提供商设置其默认的最大 Token 数。你可以根据需要设置一个具体的正整数。
-1uses provider's default max tokens. Set positive integer for custom limit.
- 设置为 -1。
-
上下文窗口大小 (Context window size)
- 设置为 1000000 (即 1M 上下文,谷歌模型最大支持窗口)。
Set to 1000000 (1M context, Google model's max capacity). - 这指的是模型可以处理的总 Token 数,包括输入(你的提示和相关上下文)和输出(模型的回答)。这是一个非常大的上下文窗口。
Total tokens model can process (input + output). This is an exceptionally large context window.
- 设置为 1000000 (即 1M 上下文,谷歌模型最大支持窗口)。
-
图像支持 (Image support)
- ⬜ 未勾选。
Unchecked. - 勾选此项表明你希望使用的模型能够处理和理解图像。需要模型本身支持此功能。
Enable if your model supports image processing.
- ⬜ 未勾选。
-
计算机功能调用 (Computer function call)
- ✅ 已勾选。
Checked. - 这表明模型是否能够与浏览器等工具进行交互(例如 Claude 3.7 Sonnet 的某些功能)。这通常用于让 AI 能够执行一些本地操作或获取外部信息。我们的项目这方面的功能还在进行测试。
Allows model to interact with tools like browsers (e.g. Claude 3.7 Sonnet). Still in testing for our project.
- ✅ 已勾选。
-
提示缓存 (Prompt caching)
- ⬜ 未勾选。
Unchecked. - 勾选此项可以缓存提示,可能会加快对相同或相似提示的响应速度,并可能节省 token。
Caches prompts to accelerate responses to similar queries and save tokens.
- ⬜ 未勾选。
四、通用操作 General Operations
- 在配置界面的右上角,有 保存 (Save) 和 完成 (Done) 按钮。修改配置后,记得点击 保存。
Click Save in top-right after modifications, then Done. - 左侧导航栏还有其他设置项,如 自动批准 (Auto-approve)、计算机交互 (Computer interaction)、存档点 (Save points)、通知 (Notifications)、终端 (Terminal)、实验性 (Experimental)、语言 (Language) 和 关于 Roo Code (About Roo Code)。你可以根据需要探索这些设置。
Sidebar includes: Auto-approve, Computer interaction, Save points, Notifications, Terminal, Experimental, Language, About Roo Code.
五、实验性 Experimental
- 新版本 roo 更新了支持并发读取文件,我们建议开启,可以提升效率和充分利用 1M 上下文
New version supports concurrent file reading. Recommended to enable for efficiency and full 1M context utilization.
- 增强向导可以不开,感觉效果一般
Enhancement wizard can remain off (limited observed benefits)
希望这个教程能帮助你顺利配置 Roo Code 插件!👍
Hope this guide helps you configure Roo Code successfully! 👍




