来自:Python大数据分析 费弗里
1 简介大家好我是费老师,最近国产大模型Deepseek v3新版本凭借其优秀的模型推理能力,讨论度非常之高,且其官网提供的相关大模型API接口服务价格一直走的“价格屠夫”路线,性价比很高,本期文章中,就将为大家举例,如何在vscode中,基于开源AI编程辅助插件Continue,配置基于Deepseek的API接口,实现常用的AI编程辅助等功能。

Continue是一款非常流行的开源AI编程辅助工具(仓库地址:https://github.com/continuedev/continue ),可在vscode、pycharm等多种常见ide中安装使用,我们直接在vscode插件市场中搜索安装即可:

接下来我们来到Deepseek这边,创建供Continue使用的API密钥。
访问Deepseek开放平台对应页面( https://platform.deepseek.com/api_keys ),点击「创建API key」:

按引导完成新的密钥创建,记得复制之后「妥善保存」该密钥:

接下来我们直接对Continue的配置进行更新。
vscode中点击侧边栏中的Continue图标后,点击面板右上方的设置图标打开配置文件进行编辑,参考下图中格式添加相关deepseek-coder模型,其中apiKey填入前面创建的「API密钥」:

完整的配置参数参考,请移步文章开头Github仓库。
2.4 使用相关AI编程辅助功能按照上文过程完成相关配置后,我们来测试一下Continue中常用的一些功能是否生效:
2.4.1 对话功能在点击vscode侧边栏Continue图标后展开的面板中,我们可以直接进行最基础的AI对话问答,注意切换到前面配置的对应模型:


可以看到,Deepseek接口应用成功~
2.4.2 代码智能补全功能常用的代码智能补全功能,生成速度很快:

在空的文件中按下快捷键Ctrl+I,可以根据需求描述直接生成完整代码:

更多内容,请移步相关文档学习更多:
Continue官网:https://www.continue.devDeepseek文档:https://platform.deepseek.com/usage