TurboPilot —— AI 代码补全引擎

1,518次阅读
没有评论

Turbopilot 是一个开源的基于大型语言模型的代码完成引擎,在 C++PU 上本地运行。

具体来说,TurboPilot 是一个自托管的 GitHub copilot 克隆,它使用 llama.cpp 背后的库在 4GiB 的 RAM 中运行 60 亿参数的 Salesforce Codegen 模型。它很大程度上基于 fauxpilot 项目并受到其启发。

TurboPilot —— AI 代码补全引擎

注意:项目处于概念验证阶段,而不是稳定的工具。在这个版本的项目中,自动补全功能非常慢。

开始

尝试该项目的最简单方法是获取预处理模型,然后在 docker 中运行服务器。

获取模型

有 2 个选项来获取模型

选项 A:直接下载 – 简单、快速入门

可以从 Google Drive 下载预转换、预量化的模型。项目组制作了具有 350M、2B 和 6B 参数的 multi 风味模型 – 这些模型在 C  C++  Go  Java  JavaScript  Python 上进行了预训练

选项 B:自己转换模型 – 困难,更灵活

如果想自己尝试量化模型,请遵循本指南

运行 TurboPilot 服务器

下载最新的二进制文件并将其解压缩到根项目文件夹。

运行

./codegen-serve -m ./models/codegen-6B-multi-ggml-4bit-quant.bin

应用程序应在端口 18080 上启动服务器

如果你有一个多核系统,可以通过 -t 选项控制使用多少个 CPU

./codegen-serve -t 6 -m ./models/codegen-6B-multi-ggml-4bit-quant.bin

Docker 运行

可以从此处提供的预构建 docker 镜像运行 Turbopilot

仍然需要单独下载模型,然后您可以运行:

docker run –rm -it
-v ./models:/models
-e THREADS=6
-e MODEL=/models/codegen-2B-multi-ggml-4bit-quant.bin
-p 18080:18080
ghcr.io/ravenscroftj/turbopilot:latest

仍然需要单独下载模型,然后运行:

docker run --rm -it
-v ./models:/models
-e THREADS=6
-e MODEL="/models/codegen-2B-multi-ggml-4bit-quant.bin"
-p 18080:18080
ghcr.io/ravenscroftj/turbopilot:latest

使用 API

将 API 与 FauxPilot 插件一起使用

要从 VSCode 使用 API,推荐 vscode-fauxpilot 插件。安装后,您需要更改 settings.json 文件中的一些设置。

  • 打开设置(CTRL/CMD + SHIFT + P)并选择 Preferences: Open User Settings (JSON)
  • 添加以下值:

{
... // other settings

“fauxpilot.enabled”: true,
“fauxpilot.server”: “http://localhost:18080/v1/engines”,
}

可以使用 CTRL + SHIFT + P 启用fauxpilot 并选择 Enable Fauxpilot

进行补全时,该插件会将 API 调用发送到正在运行的 codegen-serve 进程。然后它将等待每个请求完成,然后再发送进一步的请求。

直接调用API

可以向 http://localhost:18080/v1/engines/codegen/completions 发出请求,它的行为就像同一个 Copilot 端点一样。

例如:

curl --request POST
--url http://localhost:18080/v1/engines/codegen/completions
--header 'Content-Type: application/json'
--data '{
"model": "codegen",
"prompt": "def main():",
"max_tokens": 100
}'

已知的限制

从 v0.0.2 开始:

  • 这些模型可能非常慢——尤其是 6B 模型。跨 4 个 CPU 内核提出建议可能需要大约 30-40 秒。
  • 只在 Ubuntu 22.04 上测试过系统,但现在提供 ARM docker 图像,很快将提供 ARM 二进制版本。
  • 有时补全建议会在无意义的地方被截断——例如通过变量名或字符串名的一部分。这是由于上下文长度(提示 + 建议)的硬限制为 2048。

Read More 

正文完
可以使用微信扫码关注公众号(ID:xzluomor)
post-qrcode
 0
评论(没有评论)

文心AIGC

2023 年 4 月
 12
3456789
10111213141516
17181920212223
24252627282930
文心AIGC
文心AIGC
人工智能ChatGPT,AIGC指利用人工智能技术来生成内容,其中包括文字、语音、代码、图像、视频、机器人动作等等。被认为是继PGC、UGC之后的新型内容创作方式。AIGC作为元宇宙的新方向,近几年迭代速度呈现指数级爆发,谷歌、Meta、百度等平台型巨头持续布局
文章搜索
热门文章
潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026

潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026

潞晨尤洋:日常办公没必要上私有模型,这三类企业才需要 | MEET2026 Jay 2025-12-22 09...
“昆山杯”第二十七届清华大学创业大赛决赛举行

“昆山杯”第二十七届清华大学创业大赛决赛举行

“昆山杯”第二十七届清华大学创业大赛决赛举行 一水 2025-12-22 17:04:24 来源:量子位 本届...
MiniMax海螺视频团队首次开源:Tokenizer也具备明确的Scaling Law

MiniMax海螺视频团队首次开源:Tokenizer也具备明确的Scaling Law

MiniMax海螺视频团队首次开源:Tokenizer也具备明确的Scaling Law 一水 2025-12...
天下苦SaaS已久,企业级AI得靠「结果」说话

天下苦SaaS已久,企业级AI得靠「结果」说话

天下苦SaaS已久,企业级AI得靠「结果」说话 Jay 2025-12-22 13:46:04 来源:量子位 ...
最新评论
ufabet ufabet มีเกมให้เลือกเล่นมากมาย: เกมเดิมพันหลากหลาย ครบทุกค่ายดัง
tornado crypto mixer tornado crypto mixer Discover the power of privacy with TornadoCash! Learn how this decentralized mixer ensures your transactions remain confidential.
ดูบอลสด ดูบอลสด Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
Obrazy Sztuka Nowoczesna Obrazy Sztuka Nowoczesna Thank you for this wonderful contribution to the topic. Your ability to explain complex ideas simply is admirable.
ufabet ufabet Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
ufabet ufabet You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
ufabet ufabet Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
热评文章
库克提拔复旦校友掌舵苹果基础模型!庞若鸣走后涨薪止血,谷歌旧部占据半壁江山

库克提拔复旦校友掌舵苹果基础模型!庞若鸣走后涨薪止血,谷歌旧部占据半壁江山

库克提拔复旦校友掌舵苹果基础模型!庞若鸣走后涨薪止血,谷歌旧部占据半壁江山 衡宇 2025-12-21 10:...
清华孙茂松:对工业界而言,大厂可以Scaling,其他玩家重在垂直应用 | MEET2026

清华孙茂松:对工业界而言,大厂可以Scaling,其他玩家重在垂直应用 | MEET2026

清华孙茂松:对工业界而言,大厂可以Scaling,其他玩家重在垂直应用 | MEET2026 Jay 2025...
奥迪+华为=油车智能天花板?

奥迪+华为=油车智能天花板?

Failed to fetch content Read More 
LeCun离职前的吐槽太猛了

LeCun离职前的吐槽太猛了

LeCun离职前的吐槽太猛了 一水 2025-12-21 19:13:08 来源:量子位 “LLM到不了AGI...
自变量王潜:具身智能是物理世界的独立基础模型|MEET2026

自变量王潜:具身智能是物理世界的独立基础模型|MEET2026

自变量王潜:具身智能是物理世界的独立基础模型|MEET2026 一水 2025-12-21 19:11:12 ...