⚠️ 待更新·2026-08-29核验 · 更新时间待核验 · 本文信息可能已过期,请以官方文档为准
更新时间:2026-08-29 · 核验状态:待更新 · 官方溯源待补
简介
付费的 GitHub Copilot 不是唯一选择。开源的 Continue、Cline 等插件支持任意 OpenAI 兼容模型,可以免费接入 Groq、DeepSeek、OpenRouter 等。本篇演示在 VS Code 里配置 Continue(对话+补全)与 Cline(自主 Agent)两套方案。
架构图
flowchart LR
A[VS Code] --> B[Continue.dev extension]
A --> C[Cline extension]
A --> D[Copilot alternatives]
B --> E[OpenAI-compatible config]
C --> E
D --> E
E --> F[OpenRouter :free model]
F --> G[Zero-cost AI coding]
方案一:Continue(对话 + 代码补全)
- 在 VS Code 扩展市场搜索 Continue 并安装。
- 按
Ctrl+Shift+P → Continue: Open config.json,打开 ~/.continue/config.json。
- 加入以下配置:
{
"models": [
{
"title": "Groq Llama 3.3 70B",
"provider": "openai",
"model": "llama-3.3-70b-versatile",
"apiBase": "https://api.groq.com/openai/v1",
"apiKey": "your-groq-key"
},
{
"title": "DeepSeek Chat",
"provider": "openai",
"model": "deepseek-chat",
"apiBase": "https://api.deepseek.com/v1",
"apiKey": "your-deepseek-key"
}
],
"tabAutocompleteModel": {
"title": "Groq 8B Autocomplete",
"provider": "openai",
"model": "llama-3.1-8b-instant",
"apiBase": "https://api.groq.com/openai/v1",
"apiKey": "your-groq-key"
}
}
保存后侧边栏 Continue 面板即可用,Tab 自动补全也生效。建议把 Key 改为读取环境变量:把 apiKey 字段值写成 ${GROQ_API_KEY},Continue 会自动解析。
方案二:Cline(自主 Agent)
Cline 是更激进的 Agent 插件,能直接修改文件、跑命令:
- 扩展市场搜索 Cline 安装。
- 打开 Cline 面板,点击齿轮 → API Provider 选
OpenAI Compatible。
- 填写:
- Base URL:
https://api.deepseek.com/v1
- API Key:你的 DeepSeek Key
- Model ID:
deepseek-chat
保存后即可让它自主完成"重构这个模块"、"加单元测试"等任务。Cline 会显示每一步的 diff 让你确认,安全可控。
JetBrains 用户
Continue 也有 IntelliJ/PyCharm 版本,配置文件位置在 Settings → Tools → Continue → Open config.json,格式与 VS Code 一致。Cline 暂不支持 JetBrains,可用 GitHub Copilot + 自定义端点替代(需第三方补丁)。
实用技巧
- 补全延迟:8B 模型最快,Groq 的
llama-3.1-8b-instant 是补全首选,延迟常低于 100ms。
- 长上下文对话:用 DeepSeek(64K 上下文)或 Gemini(1M)。
- 省钱:把
tabAutocompleteModel 指向本地 Ollama,长对话才走云 API。
- 隐私:企业项目可部署 NIM 容器,IDE 配置指向内网地址。
- @提及上下文:Continue 支持
@file、@codebase、@docs 等上下文提及,能让回答更精准。
常见问题
- 补全不出现:检查
tabAutocompleteModel 配置是否完整,VS Code 重启。Continue 默认只在某些文件类型触发,可在 config.json 的 tabAutocompleteOptions 调整。
401 unauthorized:Key 写错或过期,在对应平台后台重新生成。
- 想用流式:Continue 默认就是流式,无需额外配置。
- 响应慢:把
model 改成更小的版本,或换 Groq 这种 LPU 加速的 provider。
一套配置打通对话、补全、Agent 三种场景,完全免费。
最佳实践
- Continue.dev 配置最简单:JSON 文件指定
models,每个模型绑定一个 provider。
- Cline 自带 agent loop:可以连续执行多个文件改动,比 Continue 更适合大型重构。
- GitHub Copilot 替代品选通配:Copilot 不支持自定义模型,Continue 和 Cline 才能接免费 API。
- 本地缓存重复 prompt:相同 prompt 加 hash 缓存 5 分钟,免费层 429 时直接命中。
⚠️ Pending Update · 2026-08-29 Verification · Content may be outdated, please refer to official docs
Updated: 2026-08-29 · Status: Pending Verification
Introduction
Paid GitHub Copilot is not the only option. Open-source plugins like Continue and Cline support any OpenAI-compatible model, so you can wire in Groq, DeepSeek, OpenRouter, and more — for free. This article configures Continue (chat + completion) and Cline (autonomous agent) in VS Code.
架构图
flowchart LR
A[VS Code] --> B[Continue.dev extension]
A --> C[Cline extension]
A --> D[Copilot alternatives]
B --> E[OpenAI-compatible config]
C --> E
D --> E
E --> F[OpenRouter :free model]
F --> G[Zero-cost AI coding]
Option 1: Continue (chat + autocomplete)
- In the VS Code marketplace, search for Continue and install it.
- Press
Ctrl+Shift+P → Continue: Open config.json to open ~/.continue/config.json.
- Add the following:
{
"models": [
{
"title": "Groq Llama 3.3 70B",
"provider": "openai",
"model": "llama-3.3-70b-versatile",
"apiBase": "https://api.groq.com/openai/v1",
"apiKey": "your-groq-key"
},
{
"title": "DeepSeek Chat",
"provider": "openai",
"model": "deepseek-chat",
"apiBase": "https://api.deepseek.com/v1",
"apiKey": "your-deepseek-key"
}
],
"tabAutocompleteModel": {
"title": "Groq 8B Autocomplete",
"provider": "openai",
"model": "llama-3.1-8b-instant",
"apiBase": "https://api.groq.com/openai/v1",
"apiKey": "your-groq-key"
}
}
After saving, the Continue sidebar works and Tab autocomplete is live. To avoid hardcoding keys, set apiKey to ${GROQ_API_KEY} — Continue resolves env vars automatically.
Option 2: Cline (autonomous agent)
Cline is a more aggressive agent that can edit files and run commands:
- Search for Cline in the marketplace and install.
- Open the Cline panel, click the gear icon, and set API Provider to
OpenAI Compatible.
- Fill in:
- Base URL:
https://api.deepseek.com/v1
- API Key: your DeepSeek key
- Model ID:
deepseek-chat
Save and ask it to "refactor this module" or "add unit tests" — it runs autonomously, showing diffs at each step for confirmation.
JetBrains Users
Continue also ships for IntelliJ/PyCharm. The config lives at Settings → Tools → Continue → Open config.json with the same format as VS Code. Cline is not on JetBrains yet — you can use GitHub Copilot with a custom endpoint via a third-party patch as a substitute.
Practical Tips
- Autocomplete latency: 8B models are fastest. Groq's
llama-3.1-8b-instant is the autocomplete choice, with latency often under 100ms.
- Long context: Use DeepSeek (64K) or Gemini (1M) for long conversations.
- Save money: Point
tabAutocompleteModel at a local Ollama instance; only chat goes to the cloud.
- Privacy: For enterprise projects, deploy a NIM container and point the IDE at the internal address.
- @-mentions: Continue supports
@file, @codebase, @docs to ground answers in your context.
Troubleshooting
- No autocomplete: Check that
tabAutocompleteModel is complete and restart VS Code. Continue only triggers on certain file types — adjust in tabAutocompleteOptions.
401 unauthorized: Key typo or expired — regenerate it on the provider dashboard.
- Streaming: Continue streams by default; no extra config needed.
- Slow responses: Switch to a smaller model or to a LPU-accelerated provider like Groq.
One config powers chat, autocomplete, and an agent — entirely free.
Best Practices
- Continue.dev has the simplest config: a JSON file lists
models, each bound to a provider.
- Cline ships an agent loop: can run multi-file edits in sequence; better for large refactors than Continue.
- GitHub Copilot alternatives must support custom models: Copilot itself does not allow custom model endpoints — Continue and Cline do.
- Cache repeated prompts locally: hash the prompt and cache for 5 minutes; free-tier 429s then hit cache.