Luna
收藏资源简介:
Luna & Quasar Agentic Coding数据集是一个开源、完全文档化的微调数据集,专门用于微调小型和大型agentic编码模型。该数据集基于真实工程工作,而非合成玩具问题。数据源自作者自己的开源项目——Nebula(一个集成了Web、Telegram和Discord适配器的Rust/Python AI助手)和NumRS(一个Rust线性代数库)——从实际提交历史、真实错误、重构和多文件变更中提取。合成数据仅用于填补特定覆盖缺口。数据集旨在训练模型在真实代码库中执行agentic编码任务,例如:给定一个代码库和真实请求,读取必要信息、制定计划、按合理顺序使用工具并在任务完成后停止。微调目标聚焦于三个领域:更新框架/SDK/库知识(缩小模型训练截止日期与当前库API/惯例之间的差距);行动前的推理和规划(在调用工具之前生成简短的实际计划,而非立即猜测编辑);高效的工具/令牌使用(无浪费工具调用,无冗长解释,任务完成后立即停止)。数据集按主题文件组织为JSONL格式,每个文件对应一个源领域。当前包含nebula_backend.jsonl(8条记录,涵盖Nebula的web_backend模块中的认证、依赖注入、项目存储、管理功能等)。未来将添加更多主题文件,如nebula_discord_bot.jsonl、nebula_core.jsonl、numrs_linalg.jsonl等。记录模式包括:id(唯一标识符)、source(synthetic或project_extract)、task_type(bugfix、feature、refactor、tool_use、multi_file、planning_only)、lang(python或rust)、difficulty(easy、medium、hard)、system(系统提示,包括工具定义)、messages(消息列表,包含user、assistant、tool角色,其中assistant消息包含plan和tool_calls字段,tool消息包含tool_call_id字段)和meta(元数据,包括num_tool_calls、num_turns、efficiency_label、notes)。efficiency_label包括optimal(最优)、verbose(冗长)和wasteful(浪费),其中wasteful/optimal对共享相同的id根,可用于未来的DPO偏好数据。数据集规模小于1K条记录。提供JSONL和Parquet两种格式,Parquet用于加快数据集加载,但注意对于小数据集Parquet可能比JSONL更大。还提供了Python脚本render_to_chatml.py和Colab笔记本01_prepare_chatml.ipynb,用于将原始数据转换为Qwen2.5-Coder ChatML格式的训练字符串。数据集采用MIT许可证,所有project_extract记录源自作者自己的开源项目。
The Luna & Quasar Agentic Coding dataset is an open-source, fully documented fine-tuning dataset specifically designed for fine-tuning small and large agentic coding models. The dataset is based on real engineering work, not synthetic toy problems. Data is extracted from the authors own open-source projects—Nebula (a Rust/Python AI assistant integrating Web, Telegram, and Discord adapters) and NumRS (a Rust linear algebra library)—from actual commit history, real bugs, refactors, and multi-file changes. Synthetic data is only used to fill specific coverage gaps. The dataset aims to train models to perform agentic coding tasks in real codebases, such as: given a codebase and a real request, read necessary information, formulate a plan, use tools in a reasonable order, and stop when the task is complete. The fine-tuning focuses on three areas: updating framework/SDK/library knowledge (bridging the gap between model training cutoff dates and current library APIs/conventions); reasoning and planning before action (generating a short practical plan before calling tools, rather than immediately guessing edits); and efficient tool/token usage (no wasted tool calls, no verbose explanations, stop immediately after task completion). The dataset is organized as JSONL files by topic, each file corresponding to a source domain. Currently includes nebula_backend.jsonl (8 records covering authentication, dependency injection, project storage, management functions, etc. in Nebulas web_backend module). More topic files will be added in the future, such as nebula_discord_bot.jsonl, nebula_core.jsonl, numrs_linalg.jsonl, etc. The record schema includes: id (unique identifier), source (synthetic or project_extract), task_type (bugfix, feature, refactor, tool_use, multi_file, planning_only), lang (python or rust), difficulty (easy, medium, hard), system (system prompt including tool definitions), messages (list of messages with user, assistant, tool roles, where assistant messages contain plan and tool_calls fields, and tool messages contain tool_call_id field), and meta (metadata including num_tool_calls, num_turns, efficiency_label, notes). efficiency_label includes optimal, verbose, and wasteful, where wasteful/optimal pairs share the same id root and can be used for future DPO preference data. The dataset size is less than 1K records. It is provided in JSONL and Parquet formats, with Parquet for faster loading, though for small datasets Parquet may be larger than JSONL. It also provides Python script render_to_chatml.py and Colab notebook 01_prepare_chatml.ipynb to convert raw data into Qwen2.5-Coder ChatML format training strings. The dataset is licensed under MIT, and all project_extract records originate from the authors own open-source projects.
Luna & Quasar Agentic Coding 微调数据集
数据集概览
这是一个面向智能体编码(Agentic Coding) 模型微调的开源数据集,基于真实的工程实践(而非合成玩具问题)构建。数据集由 MIT 许可证授权,主要语言为英语,规模小于 1K 条记录。
项目背景
该数据集服务于 Luna & Quasar 双模型项目:
| 模型 | 规模 | 基座模型 | 状态 |
|---|---|---|---|
| Luna 1 | 小 | Qwen2.5-Coder(小变体) | 进行中(当前数据集) |
| Quasar 1 | 大 | Qwen2.5-Coder(大变体) | 计划中 |
微调目标聚焦于基座模型的三个薄弱环节:
- 更新框架/SDK/库知识——弥补训练截止日期与当前 API 之间的差距
- 行动前的推理与规划——调用工具前先产出简短规划
- 高效的工具/令牌使用——不浪费工具调用,任务完成后即停止
数据来源
source: project_extract:从作者自己开源项目的真实提交历史、真实 bug、真实重构中提取,主要来自:- Nebula(Rust/Python AI 助手,支持 Web、Telegram、Discord 适配器)
- NumRS(Rust 线性代数库)
source: synthetic:仅在真实项目未覆盖的特定缺口时少量使用
数据集组织
数据按主题文件(topic files)组织,每个文件为 JSONL 格式:
| 文件 | 主题 | 记录数 |
|---|---|---|
nebula_backend.jsonl |
Nebula 的 web_backend 模块——认证(JWT、Google OAuth)、依赖注入/访问控制、存储、管理防护 | 8 |
未来将新增更多主题文件(如 nebula_discord_bot.jsonl、numrs_linalg.jsonl 等)。
提供格式
| 文件 | 格式 | 用途 |
|---|---|---|
<topic>.jsonl |
原始 schema 的纯 JSONL | 数据源真相,可读、可 diff、可编辑 |
<topic>.parquet |
列式压缩格式 | 通过 datasets/pandas 快速加载 |
render_to_chatml.py |
Python 脚本 | 将原始文件转换为 Qwen2.5-Coder ChatML 字符串 |
01_prepare_chatml.ipynb |
Colab Notebook | 端到端执行 ChatML 转换,并用真实 tokenizer 验证 |
注意:ChatML 渲染后的训练数据不存储在仓库中,而是在训练前由 Notebook 即时生成,避免与原始数据漂移不同步。对于当前小规模数据,Parquet 文件可能比 JSONL 更大,并且 Parquet 转换会将 messages 字段中不同角色的字段合并为并集(不丢失数据,但会看到 None 填充)。
记录 Schema(原始 JSONL)
每条记录包含:
id:如luna_00XXsource:synthetic或project_extracttask_type:bugfix、feature、refactor、tool_use、multi_file、planning_onlylang:python或rustdifficulty:easy、medium、hardsystem:完整系统提示(含工具定义)messages:多轮对话,包含用户请求、助手规划与工具调用、工具输出、最终回答meta:包含num_tool_calls、num_turns、efficiency_label(optimal/verbose/wasteful)以及人类可读的说明
关键字段说明:
plan:非平凡任务必填,保持简洁(2-4 行);单工具调用或最终回答轮为nulltool_calls:使用真实的工具名与参数(如read_file、write_file、grep_search、run_tests等)efficiency_label:wasteful与optimal对共享同一 id 根,可用于未来的 DPO 偏好数据planning_only:零工具调用,模型呈现规划并等待确认
使用方法
python from datasets import load_dataset
原始 schema
ds = load_dataset("json", data_files="nebula_backend.jsonl")
Parquet 格式
ds = load_dataset("parquet", data_files="nebula_backend.parquet")
运行 01_prepare_chatml.ipynb(可在 Google Colab 中独立运行)或直接调用脚本:
bash
python render_to_chatml.py nebula_backend.jsonl nebula_backend_chatml.jsonl
路线图
- [x]
nebula_backend.jsonl首批主题批次 - [ ] 更多 Nebula 主题批次(Discord 机器人、核心认证/内存/硬币)
- [ ] NumRS 主题批次
- [x] ChatML 转换 Notebook
- [ ] LoRA/QLoRA SFT 训练 Notebook
- [ ] optimal vs wasteful 补全评估框架
- [ ] Quasar 1 大型模型数据/训练管道
许可与来源
- MIT 许可证
- 所有
project_extract记录均来自作者自己的开源 GitHub 项目(Nebula、NumRS),不涉及第三方数据集 - 项目完全开源:数据集、Colab Notebook、微调文档(github.com/sinamsv/Luna),未来还将公开训练好的模型权重





