Commit 35cfe564 authored by zzg_666's avatar zzg_666
Browse files

first commit

parents
MIT License
Copyright (c) [year] [fullname]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
# LocoOperator-4B
## 论文
暂无
## 模型简介
LocoOperator-4B是一个参数规模为4B的工具调用型智能体模型,通过知识蒸馏技术从Qwen3-Coder-Next推理轨迹中训练获得。该模型专注于多轮代码库探索任务——在类似Claude Code的智能体循环机制中,能够执行文件读取、代码检索及项目结构导航等操作。作为本地化部署的子智能体,它通过llama.cpp框架实现零API成本的轻量化运行。
核心特性:
- 工具调用型智能体:生成结构化的 <tool_call> JSON数据,支持读取(Read)、文本搜索(Grep)、模式匹配(Glob)、命令执行(Bash)、写入(Write)、编辑(Edit)及任务委派(Task,即子智能体调度)等工具。
- 百分百JSON有效性:所有工具调用均输出格式完整且包含全部必需参数的JSON数据,性能超越教师模型(教师模型该项指标为87.6%)。
- 本地化部署:提供GGUF量化版本,可通过llama.cpp在Mac Studio等设备上运行,实现零API调用成本。
- 轻量级代码库探索:仅4B参数,针对快速代码搜索与项目结构导航进行优化。
- 多轮交互:支持3至33轮消息的对话深度,并在全过程中保持稳定的工具调用行为。
## 环境依赖
| 软件 | 版本 |
| :----------: | :--------------------------------------------: |
| DTK | 26.04.2 |
| python | 3.10.12 |
| transformers | 4.57.6 |
| torch | 2.5.1+das.opt1.dtk2604.20260116.g78471bfd |
| accelerate | 1.12.0 |
| torchvision | 0.20.1+das.opt1.dtk2604.20260116.g65c66897 |
| flash_attn | 2.6.1+das.opt1.dtk2604.20260131.g4edd8bf9 |
| vllm | 0.11.0+das.opt1.rc2.dtk2604.20260128.g0bf89b0c |
推荐使用镜像:harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.11.0-ubuntu22.04-dtk26.04-0130-py3.10-20260202
- 挂载地址`-v`根据实际模型情况修改
```bash
docker run -it \
--shm-size 60g \
--network=host \
--name LocoOperator \
--privileged \
--device=/dev/kfd \
--device=/dev/dri \
--device=/dev/mkfd \
--group-add video \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
-u root \
-v /opt/hyhal/:/opt/hyhal/:ro \
-v /path/your_code_data/:/path/your_code_data/ \
harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.11.0-ubuntu22.04-dtk26.04-0130-py3.10-20260202 bash
```
更多镜像可前往[光源](https://sourcefind.cn/#/service-list)下载使用。
关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.sourcefind.cn/tool/)开发者社区下载安装。
## 数据集
`暂无`
## 训练
`暂无`
## 推理
## vllm
#### 单机推理
```bash
## serve启动
可参考vllm_serve.sh脚本
vllm serve LocoreMind/LocoOperator-4B --trust-remote-code --dtype bfloat16 -tp 1 --max-model-len 32768 --port 8010
## client访问
可参考vllm_cilent.sh
curl -X POST "http://localhost:8010/v1/chat/completions" -H "Content-Type: application/json" --data '{
"model": "LocoreMind/LocoOperator-4B",
"messages": [
{
"role": "user",
"content": "请介绍下自己"
}
]
}'
```
## 效果展示
<div align=center>
<img src="./doc/result.png"/>
</div>
### 精度
`DCU与GPU精度一致,推理框架:vllm。`
## 预训练权重
| **模型名称** | **权重大小** | **DCU型号** | **最低卡数需求** | **下载地址** |
| :------------------: | :----------: | :-----------: | :--------------: | :----------------------------------------------------------: |
| LocoOperator-4B | 4B | K100AI | 1 | [LocoOperator-4B](https://huggingface.co/LocoreMind/LocoOperator-4B) |
## 源码仓库及问题反馈
- https://developer.sourcefind.cn/codes/modelzoo/locooperator_vllm
## 参考资料
- https://github.com/LocoreMind/LocoOperator
icon.png

62.1 KB

# 模型唯一标识
modelCode=2103
# 模型名称
modelName=LocoOperator_vllm
# 模型描述
modelDescription=LocoOperator-4B是一个参数规模为4B的工具调用型智能体模型,通过知识蒸馏技术从Qwen3-Coder-Next推理轨迹中训练获得。
# 应用场景
processType=推理
# 算法类别
appScenario=文本生成
# 框架类型
frameType=vllm
# 加速卡类型
accelerateType=K100AI
curl -X POST "http://localhost:8010/v1/chat/completions" -H "Content-Type: application/json" --data '{
"model": "LocoreMind/LocoOperator-4B",
"messages": [
{
"role": "user",
"content": "请介绍下自己"
}
]
}'
\ No newline at end of file
vllm serve LocoreMind/LocoOperator-4B --trust-remote-code --dtype bfloat16 -tp 1 --max-model-len 32768 --port 8010
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment