前言
专注 IDEA 系列的插件 Sweep AI 倒了, 虽然推荐了替代FireBender, 但为了补全给9$一个月还是感觉贵, 于是就有了这个记录.
官方在 Github 和 huggingface 上放出了对应的插件仓库和模型, 想着跑一下, 要是效果可以就能放到token上了买号.
准备施法材料
你需要的材料有:
-
IntelliJ IDEA: 用的2025.3.4 -
一个能装载模型的环境: 云端或自己电脑跑
环境配置如下
-
插件仓库: sweepai/jetbrains_plugin
-
模型: huggingface(用的是
sweep-next-edit-1.5B.q8_0,用sweep-next-edit-v2-7B撑不住这么多并发)
编译 IDEA 插件
确认编译环境是否符合要求
把仓库拉下来, 使用 IDEA 打开
调整 gradle 依赖
build.gradle.kts
...
// 插件id, 改id要动逻辑, 懒得动
val pluginId = "dev.sweep.assistant"
// 插件名称
val pluginName = "Sweep AI customization by yooooex"
// 版本号
version = "1.29.3-yooooex"
...
intellijPlatform {
...
pluginVerification {
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#target-platforms
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-types.html#IntelliJPlatformType
ides {
select {
types.set(listOf(IntelliJPlatformType.WebStorm))
channels.set(listOf(ProductRelease.Channel.RELEASE))
// 最低/最高版本支持
sinceBuild.set("242")
untilBuild.set("243.*")
}
...
select {
types.set(
listOf(
IntelliJPlatformType.IntellijIdeaUltimate,
IntelliJPlatformType.IntellijIdeaCommunity,
IntelliJPlatformType.GoLand,
IntelliJPlatformType.PyCharmCommunity,
IntelliJPlatformType.PyCharmProfessional,
IntelliJPlatformType.CLion,
IntelliJPlatformType.Rider,
IntelliJPlatformType.AndroidStudio,
IntelliJPlatformType.RustRover,
IntelliJPlatformType.RubyMine,
IntelliJPlatformType.PhpStorm,
),
)
channels.set(listOf(ProductRelease.Channel.RELEASE))
// 最低/最高版本支持
sinceBuild.set("241")
untilBuild.set("253.*")
}
}
}
}
...
dependencies {
...
intellijPlatform {
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#target-platforms
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-types.html#IntelliJPlatformType
// 使用你的idea版本
intellijIdeaUltimate("2025.3.4")
}
...
}
编译
调整完配置, 运行 gradle :buildPlugin 编译插件, 产出物位于 build/distributions 下.
部署服务
模型
使用你喜欢的软件跑模型, 这里使用的是LM Studio.
并发要弄高点, 因为 Next Edit 预测的原因, 编辑文件后的光标移动也会触发请求.
转发服务
在对应的地方部署服务
# uvx sweep-autocomplete --help
# usage: sweep-autocomplete [-h] [--host HOST] [--port PORT]
# Sweep Autocomplete Server
# options:
# -h, --help show this help message and exit
# --host HOST Bind host (default: 0.0.0.0)
# --port PORT Bind port (default: 8081)
uvx sweep-autocomplete --port 8081
sweep-autocomplete 提供以下环境变量配置:
NEXT_EDIT_AUTOCOMPLETE_ENDPOINT: 远端地址(/v1/completions), 填写地址即可, 无需补充路径MODEL_REPO: 远端模型repo(huggingface), 默认为sweepai/sweep-next-edit-0.5BMODEL_FILENAME: 远端模型文件名称, 默认为sweep-next-edit-0.5b.q8_0.gguf
若在本地部署, 根据环境选择合适的模型即可(MODEL_REPO/MODEL_FILENAME).
转发到其他服务时设置 NEXT_EDIT_AUTOCOMPLETE_ENDPOINT .
在设置了 NEXT_EDIT_AUTOCOMPLETE_ENDPOINT 后, 将忽略本地LLM逻辑(MODEL_REPO/MODEL_FILENAME无效)
插件配置
安装
打开要安装插件的 IDE, 在设置中找到插件页, 点击齿轮图标选择 Install Plugin from Disk 安装.
设置
打开插件设置, 插件设置 Account 页
根据 转发服务 部署的方式, 选择要填写的数据
- 远端部署:
Sweep API URL填写URL - 本地模式: 勾选
Enable Local Autocomplete Server
完结
没了, 就是这样, 开始用吧. 有用请给我赞求求了 ![]()
CC BY-NC-SA 4.0 license
1 个帖子 - 1 位参与者