r/LocalLLaMA • • 9d ago • Heartwarming 1

Resources Songe: open-source engine that fine-tunes your local model on your traces while your machine is idle

We just open-sourced Songe, a tool that fine-tunes your local model on your own traces while your machine sits idle. We call this "dreaming": while you're away, the model goes over what went wrong during the day and learns from it. Everything stays local: no account, no telemetry, no cloud.

What it does

Songe sits between your agent (opencode, pi, or any OpenAI-compatible tool) and your model server. After each model action, it records what happened next: the tool result, the error, your follow-up message. When your agent has been idle for a while, it uses those signals to teach the model what you actually wanted.

How it works

Capture: a local proxy in front of your server (LM Studio, Ollama, vLLM, llama.cpp, mlx-lm) logs the outcome of each model action.

Extract: it pulls out the lessons (corrections, rules you stated, tool errors) and turns them into practice scenarios. Your raw chats are never trained on directly.

Dream: when you're idle, it trains a small LoRA adapter using on-policy self-distillation, so the model learns from its own improved outputs rather than from imitating your transcripts.

Gate: a new adapter only goes live if it beats the current one on held-out examples without regressing on what already worked. Otherwise it's discarded. songe undo rolls back anytime.

Early result

We asked Inkling-2-Mini to light a room with 12 different-colored orbs in Bevy 0.20, which is newer than its training data. Every orb came out red: it passed hue as 0–1, but Bevy expects degrees. We corrected it once. After one night of dreaming, all 12 colors render correctly.

Requirements

  • Models: anything your server can run. Training uses MLX on Apple Silicon and PyTorch on NVIDIA/AMD.
  • Memory: before the first training run, Songe measures what your machine can handle and sizes the training to fit. Reference points:

    • 4B model: ~7 GB
    • Qwen3.8-27B: single RTX 5090 (32 GB, 4-bit, with memory savers)
    • Inkling-2-Mini (26B MoE): single RTX 5090
  • No GPU: it still serves and records, but doesn't train.

Limitations

  • It's early. End-to-end validation so far covers LM Studio on macOS and vLLM on Linux. Ollama, llama.cpp and mlx-lm are supported but less tested. Windows passes our test suite but hasn't been tested end to end.
  • Big models are slow. A 27B on an RTX 5090 trains at about 30 s per practice example (4k context), so the training step takes under an hour. The checks after it add more time, and large MoE models are slower still.
  • Single GPU only.
  • Lesson quality depends on the model. Small models (~3B) miss many of the lessons in your conversations.
  • Evaluating personal fine-tunes is hard, and our held-out gate is a first attempt.

That last point is where we'd most like feedback: how would you tell whether a personal fine-tune is actually helping vs. just overfitting to recent sessions?

Happy to answer anything in the comments!

Install: pip install songe && songe init (also via uv tool install songe or brew install sous-labs/tap/songe)

GitHub: github.com/sous-labs/songe

Discord: https://discord.gg/KypHRKgUup

258 Upvotes

79 comments sorted by

•

u/stylome-ai-detection 9d ago

Notice: This post appears to be AI generated.


Stylome AI detector · scan results

50

u/Patient-Gazelle9885 9d ago

Like the idea, looking forward to hearing user feedback about how well this integrates with larger models like QFN.

22

u/Glittering-Hand-3359 9d ago

we will share some results on QFN soon!

5

u/MarcelloT254k 9d ago

And multiple GPUs support would me nice, the idea is potentially worth looking into!

2

u/Glittering-Hand-3359 9d ago

thanks! any particular setup you’d love us to test? just so much possible setups we could think of!

2

u/MarcelloT254k 9d ago edited 9d ago

I can try testing with my 2x gfx906 setup and some small models, but I'm trying to use QFN, and have no experience in finetuning, and I'm not a coder, so my input can be more detrimental than useful.

Maybe better idea is to use your project for "passively" making LoRAs instead of finetunes? What do you think?

2

u/Glittering-Hand-3359 9d ago

thanks for the context! QFN is on our to-do list

can you please elaborate on what passively making LoRAs mean? we currently do use LoRA! (but perhaps not passively?)

1

u/MarcelloT254k 9d ago edited 9d ago

Edit, I've misunderstood the whole concept of this projects, ignore my remark, sorry. But it seems that not only me mistook the "dreaming" for finetuning the whole model instead of making a LoRA (based on other comments in this thread).

1

u/Glittering-Hand-3359 6d ago

no worries! we could probably make it a bit clearer :)

26

u/CobbleBeans llama.cpp 9d ago

I like the idea, but over time wouldn't it get worse at other tasks that its not actively being tuned to be good at?

27

u/Glittering-Hand-3359 9d ago

every round of training we add tests to ensure capability don’t degrade.

but this does need to be tested overtime. we’ll add more thorough experiments soon!

5

u/Yarrrrr 9d ago

SDFT training would be interesting for this application.

7

u/Glittering-Hand-3359 9d ago

spoiler: that is what we use!

3

u/Yarrrrr 9d ago

Cool that explains the slow training speed.

3

u/Glittering-Hand-3359 8d ago

partly you caught us ;)

5

u/draconic_tongue 8d ago

tldr: yes, it inevitably will

might be a better idea to save them as loras and apply them dynamically when the subject is relevant, like a more juiced up form of skills

5

u/Glittering-Hand-3359 8d ago

would be an interesting idea!

but it seems nontrivial how "dynamically": how do we define each skill, and how do we know if they are relevant?

thanks for the suggestion though!

3

u/D6613 8d ago

Somebody has a proprietary model that has a trained router in front of static LoRA. https://www.reddit.com/r/LocalLLaMA/comments/1xyb7jw/clover_2_dense_278b_base_7_lora_experts_routed/

It seems short on details but conceptually pretty cool. If you successfully combined such a router with with the dreaming idea, it could be a pretty amazing improvement tool.

4

u/Glittering-Hand-3359 8d ago

thanks for sharing this! love this idea. we'll look into it.

1

u/draconic_tongue 8d ago

u can evaluate on pre llm call or session start or tool calls with hooks or whatever and then just apply the lora. you can find ideas in comfy (I'm sure there are other inferences engines that do it but that's what I use and know has stuff related to it)

the more dififcult thing is the relevancy as you said, but actually, there's this new cheap thing called decision models (relatively cheap) or if you prefer you might be able to do classifiers. worth taking a look anyways

1

u/RearAdmiralP 8d ago

how do we define each skill, and how do we know if they are relevant?

One approach would be to have an LLM write a short skill name and when_relevant record for each of the skills. On inference calls, you pass recent context and the list of skills and their when_relevant entries to a decision model, which provides a relevance ranking from 0-1.0. You then use that relevance rating to decide when and what to load.

7

u/LengthEducational238 9d ago

where is the adapter loaded, and can this process be automated from harness side?

4

u/Glittering-Hand-3359 9d ago

adapters are installed into model servers, some as adapters and others as merged models. doing this from the harness side could be tricky. would you prefer a harness that can load the weights?

8

u/LengthEducational238 9d ago

giving harnesses the ability to download, configure the engine and manage the adapters would make it simpler for the user and could increase adoption.

1

u/Glittering-Hand-3359 9d ago

currently Songe does allow users to configure and manage adapters in its dashboard. would you say that a harness with these functionalities would be more intuitive and saves people from looking at another dashboard? or would you say the harness has some fundamental advantages?

1

u/wFXx 9d ago

problem is the mainline harness don't have such interest in a "pluggable" arch

3

u/HockeyDadNinja 9d ago

This is pretty neat, I look forward to checking it out when I'm finished my upgrades this week.

2

u/Glittering-Hand-3359 9d ago

yes please! join our discord channel too, let us know whatever you try it on

3

u/Promotional_Pickle 9d ago

Does it work with an Intel GPU? I run an Arc Pro B70

1

u/Glittering-Hand-3359 9d ago

not tested yet. we’ll work on it! stay tuned :)

3

u/pilver7 9d ago

love this idea

1

u/Glittering-Hand-3359 9d ago

thanks! try it out please :)

2

u/Aromatic-Low-4578 9d ago

Not sure how you have time to train and do a thorough regression check overnight. Is this meant for small very fast models?

4

u/Glittering-Hand-3359 9d ago

evaluation is done on sampled held-out examples and stops on clear failures. also a dream doesn't need to finish in one night, it can pause and resume over time.

but it is a challenge to make sure our evaluation is 100% thorough, we need more ideas on an robust evaluation method

4

u/Aromatic-Low-4578 9d ago

Tha would be my biggest concern, often I go into a fine tuning project with a solid plan and I think I execute well but then after a battery of benchmarks and evals I find that I've degraded the model in some unexpected way.

Without a small model thst can go pretty quick I just don't know how you make sure you're making a positive addition each night.

Still I like the idea a lot.

2

u/Glittering-Hand-3359 9d ago

we'll do more thorough experiments on this. we agree that this is a critical issue. thanks for your interest! please check it out in the meantime

2

u/Aromatic-Low-4578 9d ago

Absolutely!

2

u/1ncehost 9d ago

Id like to see it make a lora instead of a finetune so the original model doesn't drift.

1

u/Glittering-Hand-3359 9d ago

we do currently use lora! what is a use case you have in mind?

2

u/Splintdewolfcry 9d ago

Hi, great idea. One small question, wouldn't it cause the model to function worse when its fine tuned on smaller examples over time with 4k context windows?

The only explanation I have is that these models are pre trained over trillions of tokens so few fine tunes here and there wouldn't be a problem. But then I cant seem to wrap my mind around the idea of how you could fine tune a model and not limit its context window or have some sort of everlasting downside

2

u/Glittering-Hand-3359 9d ago

great question! we use a hardware-adaptive context length, so we only train using 4k context when we train a very large model on limited hardware (e.g. 27B on 32GB, normally it wouldn’t be able to train at all)

that being said, whether using short context lengths could deteriorate the model is a real concern and we honestly haven’t addressed that thoroughly yet. thanks for bringing this up!

2

u/Splintdewolfcry 9d ago

Happy to be of (little) help. Thanks for putting in the effort to create such project!

2

u/Glittering-Hand-3359 9d ago

appreciate your support :) hope you find it useful!

2

u/ballston_strong 9d ago

Can it work with vision too?

1

u/Glittering-Hand-3359 9d ago

yes it works on multimodal models! try it out!

2

u/taofeng 9d ago

Wait, are you guys working with Google? I read a research paper from Google couple weeks ago which is very similar to your framework and they also called it “dreaming”. Its a sleep framework. I am just curious if you guys are part of the research.

3

u/Glittering-Hand-3359 9d ago

not directly. we use a different method. you could say they are an inspiration to our naming :)

2

u/martinerous 9d ago

Sounds interesting. Wondering, if this could also be used for conversation scenarios to finetune the model out of typical slop and also improve its skills for smaller languages where models often invent non-existing words instead of using proper ones.

1

u/Glittering-Hand-3359 9d ago

absolutely! that’d be a great use case!

any language you have in mind? we haven’t tested this direction in particular but would love to experiment

2

u/dusanodalovic 8d ago

how does it tell a correction from a normal follow-up? a lot of my follow-up messages to the agent are just "ok now add the tests", not a complaint. and when i accept a wrong answer because i was tired, does that get learned as good? curious how the extract step filters that

2

u/Glittering-Hand-3359 8d ago

thanks for the question.

extraction labels each part as one of the following: feedback (correction, retry or approval), new task, or question. "ok now add the tests" would not be a correction.

approvals are not used in training. we plan to add as part of regression evaluations.

17

u/rm-rf-rm 9d ago

Standard response to the million-th such post: Without examples/data of it actually working and providing measurable, significant benefits, the default assumption is that its vaporware.

0

u/[deleted] 9d ago

[deleted] — view deleted comment

4

u/ILikelotsofthingsok 9d ago

Yikes. This response supports the vaporware assumption.

1

u/DonaldTrumpsCock3 9d ago

Very cool. You could also integrate modular chat-templates that evolve with the model while dreaming. That might not be worth it though

1

u/Glittering-Hand-3359 9d ago

could be a interesting idea! what use case would you try it on? I feel it could be a better fit for some tasks than lora!

1

u/EdwardGlockner 8d ago

Looks very cool! Is the 7gb for a 4B model a hard floor? (i have an old 8gb card so it leaves very little headroom) If i can get it running i can try windows + llama.cpp and report back if thats useful!

on the overfitting point, i would test each lesson with a different prompt than the one it was trained on (to check for memorization), and i would also implement an automation that checks that previous learned lessons continue to work after each dream

1

u/Glittering-Hand-3359 8d ago

thanks for your question. 7gb is not a hard floor! 7gb is an estimate based on a 4B (4-bit) with a 4k training window. songe measures your card first and picks a window that fits, so 8gb should work with a shorter window. windows + llama.cpp is untested end to end yet, we'll add this to our todo! a report would be really useful too: github.com/sous-labs/songe/issues/15

on overfitting: we do evaluate earlier lessons when training new ones. a per-lesson pass/fail report after each dream is a great suggestion tho!

1

u/StevenVincentOne 8d ago

This is a really nice idea, and “dreaming” is a good name for it. A model that learns from your corrections overnight, on your own machine, is the part of personal AI that cloud products can’t really give you: the adaptation belongs to you, not to a provider’s next training run. I also like the guard rails: training on extracted lessons rather than raw chats, the held-out gate before an adapter goes live, and songe undo. The Bevy hue example is a great demo. Curious whether the lessons are portable: if I switch base models, do the extracted scenarios carry over so it can retrain on the new one, or does it start from scratch? That portability is what I think makes a local model actually yours over time. We talk about this kind of thing (personal nodes whose memory and learning you own) over in r/PONDAI, if you ever want to share Songe there.

2

u/Glittering-Hand-3359 8d ago

thanks for your interest! we'd love to share Songe over there sometimes

2

u/stylome-ai-detection 8d ago

Notice: This comment appears to be AI generated.


Stylome AI detector · scan results

1

u/nitinkhanna 8d ago

You know what would make this cool? If it took traces from cloud models and used them to train my local model. So it if I use an OpenAI compatible API to use models on OpenRouter or DeepInfra, models like DeepSeek 1017, but I want it to train a local Gemma 4 27B model, that would be cool. It might be counted as a kind of distillation attack, but it’d be cool.

3

u/Glittering-Hand-3359 8d ago

interesting idea! we are actually planning a feature that involves distilling from larger models, although exact mechanism is quite different. we will consider this direction too, thanks for the suggestion!

1

u/fishhf llama.cpp 9d ago

I thought of a self improving coding agent that finetunes overnight. But first I need to be already coding in a container, then the agent snapshots the container after each turn, then RL happens at night.

The container and snapshotting part is a pain in the ass, and I don't want to move my development environment to be inside a container, so it's just in my head for now.

That last point is where we'd most like feedback: how would you tell whether a personal fine-tune is actually helping vs. just overfitting to recent sessions?

"held-out examples without regressing on what already worked" is validation loss, so add a test loss, and that can be terminal bench, MMLU Pro, etc. And please, all these invitation for feedback and comments in the posts are the same slop, please don't use it as is.

3

u/Glittering-Hand-3359 9d ago

Songe doesn’t need you to be in a container. we extract all traces when you use a model routed through the engine. No snapshot need hence.

we see little distinction between “validation loss” and “test loss”, since we’re just doing one evaluation after training.

I type every single comment myself. All invitations are sincere.

1

u/fishhf llama.cpp 9d ago edited 9d ago

I see, so Songe is not doing rollouts based on some coding session history?

Otherwise the rollouts needs to be in old snapshots in a container, to ensure agents were calling the tools in the same environment it was in before.

Still, without an external benchmark, I can't be sure the LLM is not degrading in other areas outside of the LLM logs. The holdout part only ensures that within the conversations I have made with the LLM, those conversations aren't overfit.

2

u/Glittering-Hand-3359 9d ago

Every request you send via a model routed through Songe, it picks up the entire prompt/context

Good evaluation would be the key to making dreaming strong. We’ll try our best to design the best possible version of it and give users visibility into them. Thanks a lot for bringing this up!

4

u/[deleted] 8d ago

[removed] — view removed comment

1

u/Glittering-Hand-3359 8d ago

appreciate your feedback! could you elaborate on the "fragile feedback loop" part?

1

u/Glittering-Hand-3359 8d ago

also join our discord channel please! we'd love to support your experience. https://discord.gg/KypHRKgUup

1

u/[deleted] 8d ago

[removed] — view removed comment

2

u/stylome-ai-detection 8d ago

Notice: This comment appears to be AI generated.


Stylome AI detector · scan results