Lurker News
Hey HN, we trained and open-sourced a 1.5B model that predicts your next edits, similar to Cursor. You can download the weights here (https://huggingface.co/sweepai/sweep-next-edit-1.5b) or try it in our JetBrains plugin (https://plugins.jetbrains.com/plugin/26860-sweep-ai-autocomp...).

Next-edit autocomplete differs from standard autocomplete by using your recent edits as context when predicting completions. The model is small enough to run locally while outperforming models 4x its size on both speed and accuracy.
We tested against Mercury (Inception), Zeta (Zed), and Instinct (Continue) across five benchmarks: next-edit above/below cursor, tab-to-jump for distant changes, standard FIM, and noisiness. We found exact-match accuracy correlates best with real usability because code is fairly precise and the solution space is small.
Prompt format turned out to matter more than we expected. We ran a genetic algorithm over 30+ diff formats and found simple `original`/`updated` blocks beat unified diffs. The verbose format is just easier for smaller models to understand.
Training was SFT on ~100k examples from permissively-licensed repos (4hrs on 8xH100), then RL for 2000 steps with tree-sitter parse checking and size regularization. The RL step fixes edge cases SFT can’t like, generating code that doesn’t parse or overly verbose outputs.
We're open-sourcing the weights so the community can build fast, privacy-preserving autocomplete for any editor. If you're building for VSCode, Neovim, or something else, we'd love to see what you make with it!

Comments (153) 48 threads

Earlier comments
Semaphor1 reply#
At least for C#, the quality of the cloud offering is rather mediocre, so I don’t expect this model to be that useful there. It’s very overeager, suggesting tons of stuff that I never accepted because it made no sense. It’s also producing bad code, wanting me to use `.Result` for async calls instead of simply await-ing.
kevinlu1248#
It's a bit undertrained on C#, we'll continue improving on this!
deepsquirrelnet1 reply#
This is really awesome detail. I’m very impressed by the amount of care taken to identify a good template. I started a small hook to try and do this using DSPy prompt optimizers, but haven’t had a compelling use case to try it with.

This seems like an ideal case for trying DFT as well. I’m not sure if you’re using trl, but I’d suggest checking that out.

kevinlu1248#
We're using an internal fork of trl for some of the steps.
jedisct12 replies#
Really cool.

But how to use it instead of Copilot in VSCode ?

flanked-evergl#
Would love to know myself, I recall there was some plugin for VSCode that did next edits that accepted a custom model but I don't recall what it was now.
replete1 reply#
Run server with ollama, use Continue extension configured for ollama
BoredomIsFun1 reply#
I'd stay away from ollana, just use llama.cpp; it is more up date, better performing and more flexible.
mika69961 reply#
But you can't just switch between installed models like in ollama, can you?

Continue this thread — 1 reply

ttoinou1 reply#
Wow, I can even chat about C code with that model with LM Studio on my Macbook at 200 tokens per seconds
kevinlu12481 reply#
Haha, we never trained it for chat but I would bet it works regardless.

Also that's crazy, M4 Mac?

ttoinou#
M4 Max 128GB yeah

Load more comments