zw2700andClaude Opus 5.5 e8e00b1552 Several GPUs are opt-in (torch_options.gpus = "all"); the first GPU stays the default
Until the Deep Dream panel lets people choose, nothing changes for anyone who
does not ask: one GPU trained on and watched, as before. The release check
takes SONGE_CHECK_MODEL / _MINUTES / _MEMORY_FRACTION for manual multi-GPU
runs, installs flash-linear-attention for them, and logs its result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 06:49:59 -05:00
2026-11-20 06:17:09 -05:00
2026-11-20 06:17:09 -05:00
2026-11-30 05:28:44 -05:00
2026-11-30 05:28:44 -05:00

Songe: a bed on the moon, and the command pip install songe

A training engine for your local model, using your idle compute.

Install • How it works • Commands • Roadmap • Discord • Website

Join our Discord

PyPI version Python versions License: Apache-2.0

New · November 30, 2026 · Frontier distillation. With Frontier distillation on, Songe can use a frontier model you choose (any OpenAI-compatible API, or your Claude Code or Codex login) to help your local model learn overnight: it writes reference answers for practice and judges whether a new version does what you asked. Off by default; secrets are redacted and spending stops at a nightly budget. Turn it on with songe distill on or from the dashboard.

Songe is a training engine for the model you already run locally. It sits between your agent and your model server as an OpenAI-compatible proxy and records what happened. While the agent is idle, it fine-tunes a LoRA adapter for your model: conversations → lessons → practice scenes → LoRA trained by self-distillation → check on your own conversations → served only if better than the version in use. vLLM, llama.cpp and mlx-lm load the adapter beside the base model; LM Studio and Ollama get a merged copy. Everything stays on your machine unless you enable the optional Frontier distillation.

Training requires an NVIDIA or AMD GPU (PyTorch) or Apple Silicon (MLX); without one, Songe proxies and records only.

✨ Highlights

  • Learns from how you work. Your corrections, stated preferences and the tools' errors become lessons for your own model.
  • Two kinds of Dreams. A Quick Dream adds your preferences to the model's instructions in minutes; a Deep Dream trains the model itself while you are away.
  • Safe by default. A new version is used only if it does better on your own conversations; one click goes back to any earlier version.
  • Stays out of the way. Runs only when your agent is quiet, memory is free and the battery is fine, and stops the moment you are back.
  • Private. No account, no telemetry, no cloud unless you opt in.
  • Frontier distillation (optional). songe distill on lets the nightly Dream learn with a frontier model: through an API you choose, or the Claude Code or Codex you are already logged in to. It judges the check and writes reference answers your model rewrites in its own words; secrets are redacted, and spending or calls stop at a nightly budget. Songe never runs your tools.

📥 Install

With uv or pipx (Python 3.11 or later):

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

No uv or pipx yet? Either installs in one line:

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)

Both give Songe its own environment in a lasting place, which its background service needs.

NVIDIA (Linux, Windows) or AMD (ROCm: Linux): install as above. songe init finds the GPU, shows the PyTorch install it needs (the CUDA wheel matching your driver, or the ROCm wheel matching /opt/rocm) and installs it in Songe's own environment. Installing into your own environment instead: put torch from the PyTorch index for your machine first, then pip install 'songe[cuda]' or 'songe[rocm]' (docs/RELEASING.md).

llama.cpp: Songe does not ship llama-server; install it first (brew install llama.cpp, or a release from ggml-org/llama.cpp) so it is on PATH. Start your llama-server as usual, then run songe init: your server keeps serving the base model, and Songe starts its own llama-server from the same command line on a free local port to serve learned versions.

macOS with Homebrew:

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

songe init finds your model server and your agents, shows what it will change, and asks once:

$ 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)

Then pick a Songe model in your agent (opencode lists them as songe/songe/<name>), and work as usual.

Plain pip, and what you need

pip install songe works inside a virtual environment; outside one, Homebrew's and most Linux distributions' Python refuse it.

You need a model served locally, and an agent:

Supported Tested end to end
Model servers LM Studio, vLLM, Ollama, llama.cpp, mlx-lm LM Studio (macOS), vLLM (Linux)
Agents opencode and pi (set up for you); any OpenAI-compatible tool opencode, pi
Training Apple Silicon (MLX); NVIDIA and AMD (PyTorch) Apple Silicon, NVIDIA

Measured memory, Dream times and what is tested, untested or unsupported: docs/HARDWARE.md.

Machines without a GPU still serve and record, but do not train. Tried Songe on another setup? Share the result on the testing board.

Codex CLI speaks only the Responses API, which Songe also serves. songe init does not set it up yet; add this to ~/.codex/config.toml:

model = "songe/<name>"
model_provider = "songe"

[model_providers.songe]
name = "Songe"
base_url = "http://127.0.0.1:7613/v1"

🌙 How it works

 your agent ──► Songe (127.0.0.1:7613) ──► your model server
                   │ an OpenAI-compatible proxy: records what happened
                   ▼
            when you are away: a Dream
   read lessons ─► practice ─► train a LoRA adapter ─► check ─► use only if better
Quick Dream Deep Dream
Takes a few minutes an hour or more
Does adds the preferences you stated or showed to the model's instructions writes practice from your lessons and fine-tunes a LoRA adapter on it
You see each new preference, with a before/after where the answer changes why the new version was or was not used
Undo undo the Quick Dream, or remove one preference go back to any earlier version

One lesson followed through a real run, from correction to the answers afterwards: docs/EXAMPLE.md.

With auto-dream on, Dreams start when your agent has been quiet for a while. Or press Dream in the dashboard (songe open). A Dream never just disappears: it keeps going on the page, or says why it stopped.

How it learns, in more detail
  • Reading. Songe reads each conversation for the moments that teach something: your corrections and stated rules, retries, tool errors.
  • Practice. For each lesson your model writes short practice scenes in your agent's own tools. Your real conversations are never trained on.
  • Training. The model as it was, shown the lesson, is the teacher; the same model with a LoRA adapter, shown only the scene, is the student (on-policy distillation). Earlier skills are rehearsed so they stay.
  • Checking. At the moments you reacted to, the version in use and the new one each answer, and your original model judges each answer on its own. The new version is used only if it wins more of these moments than it loses, does not drift from what already worked, and its answers stay healthy. It is a check on your own moments, not a benchmark: see docs/CHECK.md.

Before the first training Songe measures how much your computer can learn at once, and trains on what fits. See DESIGN.md.

⌨️ Commands

Command What it does
songe what it is doing
songe status --training [MODEL] resolved Deep Dream settings and where they come from
songe open the dashboard in your browser
songe models each model, and whether it dreams on its own
songe models MODEL on|off auto-dream for one model
songe models MODEL download for a GGUF Songe cannot train: download the original weights it names from Hugging Face and train from them (says what, how big and where, then asks; --yes skips the question)
songe sleep start a Deep Dream now
songe undo MODEL go back one version
songe pause / songe resume stop and restart learning
songe distill on|off|status|test optional: Frontier distillation, Dreams learn with a cloud model you choose
songe doctor check the setup
songe forget delete recorded conversations (learned versions stay)
songe uninstall stop the service and restore your agent settings
What it changes on your machine
  • Its data folder: ~/Library/Application Support/songe on macOS, $XDG_DATA_HOME/songe on Linux, %LOCALAPPDATA%\songe on Windows.
  • A songe/ folder in LM Studio's models folder with the current learned version. Your own models are never touched.
  • One provider entry in opencode and pi, with a backup.
  • A background service that starts at login.
Upgrade and remove

uv tool upgrade songe, pipx upgrade songe or brew upgrade songe: the service moves to the new version by itself in a quiet moment.

songe uninstall stops the service and restores your agent settings; add --purge to also delete its data and learned versions. Run it before brew uninstall songe.

🧭 Roadmap and contributing

Where Songe is going: ROADMAP.md. Common questions: docs/FAQ.md. Ideas and bugs are welcome as issues. Questions and results from your nights go in Discord. To contribute, see CONTRIBUTING.md. Security reports: SECURITY.md.

Licensed under Apache-2.0.

S
Description
A training engine for your local model, using your idle compute
Readme
12 MiB
0 Stars 1 Watchers 0 Forks
Languages
Python 96.3%
JavaScript 2.2%
CSS 0.8%
Ruby 0.7%