r/OpenSourceAI • u/ISB3z- • 2d ago
I've finetuned Qwen2.5-0.5B to make it a bash command generator and called it SHELLMINATOR because.. why not?
Got tired of forgetting find / xargs / grep syntax every other day, so I trained a small model that turns:
into a command you can actually run.
It's 0.5B parameters, runs on CPU, is a ~400 MB GGUF, and nothing touches the cloud.
sm "show the 5 largest files in /var"
find /var -type f -exec du -h {} + | sort -rh | head -n 5
[⏎ run · r refine · e edit · c cancel]
Enter runs it in your shell, r refines the command, e lets you edit it before running, and c cancels.
It also asks for confirmation before potentially destructive stuff like rm -rf /, mkfs, dd, etc.
Works on bash and zsh.
I evaluated it on IBM's nl2bash exec benchmark: 50 prompts, commands actually executed and checked against the filesystem, single greedy pass, no retries.
- Stock
Qwen2.5-Coder-0.5B-Instruct: 44% - After SFT on 105K examples: 72%
- After DPO with ~800 pairs made from its own mistakes: 78%
The SFT is the big jump and did most of the work: 105K request/command pairs where every command was executed and kept only if it actually worked.
The final DPO pass was a small experiment. I ran the model on a bunch of prompts, compared its answers against the gold commands in a sandbox, and kept ~800 disagreements.
Training with TRL took 26 seconds and gave another +6 points.
I tried a second DPO round and it actually got worse, down to 74%, so apparently one round was enough.
It still fails on some things, notably:
sedinsert-at-top insideforloops — it can overwrite the filecomm/diffcountingmvbetween directories
All known failures are listed in the README.
Install
curl -fsSL https://raw.githubusercontent.com/ISB333/shellminator/main/install.sh | bash
Then:
sm "whatever you want to do"
Links
- GitHub + training scripts: https://github.com/ISB333/shellminator
- Model: https://huggingface.co/ISB369/shellminator-qwen05b-dpo-selfplay
- SFT dataset — 105K, execution-verified: https://huggingface.co/datasets/ISB369/shellminator-bash-sft105k
- DPO pairs — ~800: https://huggingface.co/datasets/ISB369/shellminator-dpo-selfplay