AIFeed

利用闲置算力本地训练模型的训练引擎

Translation(model translation, not the source's own text)
Songe:月球上的一张床,以及 pip install songe 命令
Songe:月球上的一张床,以及 pip install songe 命令

用你的闲置算力,为你的本地模型打造训练引擎。

安装 • 工作原理 • 命令 • 路线图 • Discord • 网站

照常通过 opencode、pi 或任何兼容 OpenAI 的工具使用你的本地模型。在你工作期间,Songe 会留意模型每次行动之后发生了什么:工具结果、错误、你的下一条消息。当你的 agent 空闲时,它便教模型预见这些结果。新版本只有通过检查才会被采用,且任何数据都不会离开你的机器。

✨ 亮点

  • 从你的工作方式中学习。你的纠正、明确表达的偏好以及工具报错,都会成为你自己模型的教材。
  • 两种 Dream。Quick Dream 在几分钟内把你的偏好加入模型的指令中;Deep Dream 在你离开时训练模型本身。
  • 默认安全。新版本只有在你自己的对话上表现更好时才会被采用;一键即可回退到任何更早的版本。
  • 不碍事。仅在 agent 空闲、内存充足且电量正常时运行,你一回来便立即停止。
  • 私密。无账号、无遥测、无云端。Songe 从不运行你的工具。

📥 安装

使用 uv 或 pipx(Python 3.11 或更高版本):


        uv tool install songe        # or: pipx install songe
songe init
      

还没有 uv 或 pipx?任选其一,一行即可安装:


        curl -LsSf https://astral.sh/uv/install.sh | sh    # uv (or: brew install uv)
brew install pipx                                  # pipx on macOS (Debian/Ubuntu: sudo apt install pipx)
      

两者都会在持久位置为 Songe 提供独立环境,这是其后台服务所需要的。

macOS 配合 Homebrew:


        brew tap sous-labs/tap
brew trust sous-labs/tap     # newer Homebrew asks this once
brew install songe
songe init
      

songe init 会找到你的模型服务器和 agent,展示将要做的更改,并询问一次:


        $ songe init

Models    3 from LM Studio, listed under Songe
  Agent     opencode → Songe models · default granite-4.2-3b-MLX-4bit
  Agent     pi → Songe models · choose one with /model
  Data      ~/Library/Application Support/songe
  Service   starts at login
  Learning  new conversations · starts when idle
  Replace   loaded copy when a better version is ready

Install? (Y/n)
      

然后在你的 agent 中选择一个 Songe 模型(opencode 将其列为 songe/songe/<name>),照常工作即可。

pip install songe 可在虚拟环境中运行;在虚拟环境之外,Homebrew 及大多数 Linux 发行版的 Python 会拒绝执行。

你需要一个本地服务的模型,以及一个 agent:

支持端到端测试过
模型服务器LM Studio、vLLM、Ollama、llama.cpp、mlx-lmLM Studio(macOS)、vLLM(Linux)
Agentopencode 和 pi(已为你配置好);任何兼容 OpenAI 的工具opencode、pi
训练Apple Silicon(MLX);NVIDIA 和 AMD(PyTorch)Apple Silicon、NVIDIA

没有 GPU 的机器仍可服务和记录,但不进行训练。在其他环境中试过 Songe?在测试板上分享结果。

🌙 工作原理


        your agent ──► Songe (127.0.0.1:7613) ──► your model server
                   │ records what happened
                   ▼
            when you are away: a Dream
   read lessons ─► practice ─► train ─► check ─► use only if better
      
Quick DreamDeep Dream
耗时几分钟一小时或更久
作用把你明确表达或表现出的偏好加入模型的指令中根据你的教材编写练习题,并在其上训练一个小型适配器
你能看到每条新偏好,以及答案发生变化处的前后对比新版本被采用或未被采用的原因
撤销撤销 Quick Dream,或移除某条偏好回退到任何更早的版本

文章标题:为你的本地模型打造的训练引擎,利用你的闲置算力

正文: 开启 auto-dream 后,当你的 agent 安静一段时间,Dreams 就会启动。或者你也可以在仪表盘(songe open)中点击 Dream。一个 Dream 绝不会凭空消失:它会在页面上继续进行,或者说明它为什么停止了。

  • 阅读。Songe 会阅读每一段对话,找出其中有教益的瞬间:你的纠正和明确说出的规则、重试、工具错误。
  • 练习。针对每一条经验,你的模型会在你的 agent 自己的工具中编写简短的练习场景。你的真实对话永远不会被用于训练。
  • 训练。原本的模型,看到这条经验,是老师;同一个模型加一个小适配器,只看到场景,是学生(on-policy distillation)。此前的技能会被复习,以保持不丢。
  • 检查。在你做出反应的那些瞬间,正在使用的版本和新版本各自作答,由一位评判者比较它们的行为。只有当新版本明显更好、不改变已经奏效的部分、且其回答保持健康时,才会启用新版本。

在首次训练之前,Songe 会测量你的计算机一次能学习多少,并只训练放得下的部分。参见 DESIGN.md。

⌨️ 命令

命令作用
songe它正在做什么
songe status --training [MODEL]解析后的 Deep Dream 设置及其来源
songe open在浏览器中打开仪表盘
songe models每个模型,以及它是否自行做梦
songe models MODEL on│off为某个模型开启/关闭 auto-dream
songe sleep立即启动一次 Deep Dream
songe undo MODEL回退一个版本
songe pause / songe resume停止并重新开始学习
songe doctor检查配置
songe forget删除已记录的对话(已学到的版本保留)
songe uninstall停止服务并恢复你的 agent 设置
  • 其数据文件夹:macOS 上为 ~/Library/Application Support/songe,Linux 上为 $XDG_DATA_HOME/songe,Windows 上为 %LOCALAPPDATA%\songe。
  • LM Studio 的 models 文件夹中有一个 songe/ 文件夹,内含当前学到的版本。你自己的模型永远不会被触碰。
  • 在 opencode 和 pi 中各有一个 provider 条目,并带有备份。
  • 一个随登录启动的后台服务。

uv tool upgrade songe、pipx upgrade songe 或 brew upgrade songe:服务会在某个安静的时机自行迁移到新版本。

songe uninstall 会停止服务并恢复你的 agent 设置;加上 --purge 还会删除其数据和已学到的版本。在 brew uninstall songe 之前先运行它。

🧭 路线图与贡献

Songe 的发展方向:ROADMAP.md。欢迎以 issue 形式提出想法和报告 bug。问题与你的夜间成果可发到 Discord。贡献方式见 CONTRIBUTING.md。安全报告:SECURITY.md。

Licensed under Apache-2.0。

The translation is machine-generated and individual terms may be off. Nothing is rewritten or cut; the original is authoritative.

Published by Hacker News
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗