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
h33t-l4x0r2 replies#
It sounds like you might be killing Zed's ability to monetize, am I misunderstanding that?
BoredPositron#
If your only feature worth monetizing is replicated by a solo dev in his freetime you might have a problem.
gunalx#
not really though. The zed monetization seems to push towards selling tokens for full fledged models with good ide integration as a service. (They have let you run a custom tabcomplete for a little while)
woile2 replies#
Hey, ollama run as suggested in hf doesn't seem to work with this model. This worked instead:

ollama pull hf.co/sweepai/sweep-next-edit-1.5B

woile2 replies#
I've been using it with the Zed editor and it works quite well! Congrats.

This kind of AI are the ones I like and I'm looking to run in my workstation.

theophaniel3 replies#
Could you give the gist / config on how you made it work with Zed ?
Imustaskforhelp3 replies#
+1, I wasn't able to make it work on zed either and It would really help if woile can tell how they made it work on their workstation.

Continue this thread — 3 replies

woile#
This is it:

{

    "agent": {

        "inline_assistant_model": {

            "model": "hf.co/sweepai/sweep-next-edit-1.5B:latest",

            "provider": "ollama",

        },

    }

}
ihales2 replies#
I had Claude add it as an edit-prediction provider (running locally on llama.cpp on my Macbook Pro). It's been working well so far (including next-edit prediction!), though it could use more testing and tuning. If you want to try it out you can build my branch: https://github.com/ihales/zed/tree/sweep-local-edit-predicti...

If you have llama.cpp installed, you can start the model with `llama-server -hf sweepai/sweep-next-edit-1.5B --port 11434`
Add the following to your settings.json:
```

  "features": {
    "edit_prediction_provider": { "experimental": "sweep-local" },
  },
  "edit_predictions": {
    "sweep_local": {
      "api_url": "http://localhost:11434/v1/completions",
    },
  }
```

Other settings you can add in `edit_predictions.sweep_local` include:
- `model` - defaults to "sweepai/sweep-next-edit-1.5B"
- `max_tokens` - defaults to 2048
- `max_editable_tokens` - defaults to 600
- `max_context_tokens` - defaults to 1200
I haven't had time to dive into Zed edit predictions and do a thorough review of Claude's code (it's not much, but my rust is... rusty, and I'm short on free time right now), and there hasn't been much discussion of the feature, so I don't feel comfortable submitting a PR yet, but if someone else wants to take it from here, feel free!

Continue this thread — 2 replies

kevinlu1248#
We'll push to Ollama
mgz2 replies#
I use Sweep’s Jetbrains autocomplete plugin daily, it really stands out.
8n4vidtmkvmk1 reply#
Better than the one that ships with Jetbrains?

I did buy their $100/yr AI but its about to run out.

mgz1 reply#
Definitely better. Next edit makes a difference. But it is not free, I think I pay $10/month.
hdjrudni#
Oh, i thought you were talking about this self hosted 1.5B model. You must be talking about the full model as a service?
smusamashah#
Does it run totally offline?
syntaxing#
Wow super fun read, I love how it went into the technical details. Any way to make it work with vscode?

Load more comments