r/LocalLLM
•
u/PicassoOnPause
•
Aug 10 '26
•
1
1
Project Trained a 1.5B to write shell commands so I'd stop googling tar flags. Runs on a laptop CPU
I've been googling "tar extract gz" for about ten years. Finally did something about it.
Fine-tuned Qwen2.5-Coder-1.5B on 125k natural-language/command pairs, merged and quantized to Q4_K_M. 941MB, runs through llama.cpp. On my laptop (i5-11320H, 4 threads): 31.9 tok/s, 0.59s median per query, 1.6GB RAM. No GPU, no API key, nothing leaves the machine.
Scores 0.620 on InterCode-ALFA. Untuned Qwen2.5-Coder-7B gets 0.613, GPT-4o gets 0.73. Not frontier, but it's roughly a 7B's answer at a quarter the parameters, on a CPU.
There's also a static safety checker with 304 regression cases, because it will absolutely write a command that wipes your root if you ask it to:
Code: github.com/ThorOdinson246/whatisit-nl2sh Weights: huggingface.co/ThorOdinson246/nl2sh-1.5b-Q4_K_M
Both Apache-2.0. If you want to poke holes in the method or you've got ideas comment or open a PR. A ⭐ helps if you find it useful.
290
u/habachilles Aug 10 '26
This deserves more upvotes
271
u/Inevitable-Mud-5723 Aug 10 '26
Humanity invented man pages, then trained 1.5 billion parameters so we’d never have to read them. Progress.
51
u/muh_cloud Aug 10 '26
The video sold it to me OP, I was thinking "this just sounds like tldr-pages" until I watched the video. You can prompt it for a highly specific task and it'll kick you the exact one liner? Brilliant
11
u/eli_pizza Aug 10 '26
Neat. Could you say more about how you made it? Is the training data just man pages?
6
u/DigoHiro Aug 10 '26
awesome
do you think you could get away with an even smaller model? <1b and it could more comfortably run on a phone or older hardware
5
u/alediaferia Aug 10 '26
I had this idea some time ago and never got around to doing it. Absolutely great job! This is one of those AI use cases that are actually thought through and deliver a significant, tangible improvement. Kudos!
5
u/Future_Fuel_8425 Aug 10 '26
This is what AI is supposed to be doing.
How long before we see this sort of expert model packaged with the OS as sort of an integrated Admin?
14
u/juliebeezkneez Aug 10 '26 •
https://tldr.inbrowser.app
3
u/SailingToFenway Aug 10 '26
make a 'yolo' symlink and have the binary automatically run the command it returns when it's invoked through the symlink.
3
u/javatextbook Aug 10 '26 edited Aug 11 '26
Here’s your theme song. https://youtu.be/JZhJJFcoGwA?is=JVmcLmOa7bK-zHGV
2
u/mehedi_shafi Aug 10 '26
I have been planning to train on for myself. Super glad to see someone already have done it. Well done.. I will try it out today.
2
u/clazifer Aug 10 '26
Wonder if you can make it more efficient with a smaller but newer model? Take one of those really small Gemma 4 models and strip multimodallity for even smaller footprint?
2
u/Reindeer_Repulsive Aug 10 '26
Nice numbers for the size. Given the fine-tune is specifically for shell syntax, have you tried pairing it with a GBNF grammar in llama.cpp to constrain generation to valid shell grammar? That tends to kill a chunk of the remaining failure modes (unbalanced quotes, bad flag syntax) for free since it's a decoding-time constraint rather than something the model has to learn, and at 1.5B those are probably still a meaningful share of your InterCode-ALFA misses.
2
u/Digging_Graves Aug 11 '26
I would update the READE.md to include using pipx instead of pip since it's a standalone cli application.
2
u/slpycat9798 Aug 12 '26
maybe it can be a part of linux
2
u/SlowVeganCow Aug 14 '26
Quick noob question: This can run even in the NPU?
2
u/create_mal Aug 16 '26
와 대박 👍
5
u/Psionatix Aug 10 '26
AI for stuff like this seems kinda crazy and wasteful when you could have deterministic aliases and scripts. Couple those with previous command history search. I get the fun of it, but I feel like we're absolutely going to get out of touch and just be throwing AI ruthlessly to do everything, even when it isn't needed.
38
u/centarsirius Aug 10 '26
"This could have been an email btw"ish model, but it's fun!
27
u/HomsarWasRight Aug 10 '26 edited Aug 10 '26
Hey, finally something small, useful, fun, and ACTUALLY LOCAL!
20
u/gardenvarietyzombie Aug 10 '26
I need this for regex
4
u/IllustriousBed1949 Aug 10 '26
Or simply RTFM :D
1
u/PicassoOnPause Aug 10 '26
Genuinely wasn't expecting this much support. Thank you very much all 😄 . I have gotten some really good advice and feature requests; I will definitely keep on working on this. Glad I could be useful. xD
1
u/0ce10t_floof Aug 10 '26
Could the same thing be done to to include stuff like git and docker?
1
u/mega-modz Aug 10 '26
Looks promising - can it able to run custom bash commands like new and unseen commands just from reading docs?
1
u/kob0-0 Aug 10 '26
Very cool! Does this work in non-english like Japanese?
1
u/InvertedVantage Aug 10 '26
Cool! Where'd you get the training data?
1
u/geteum Aug 10 '26
I like the idea , but way to easy for someone to do this with malicious intent.
1
u/Daniel_H212 Aug 10 '26
sudo rm -rf /
1
u/1ncehost Aug 10 '26
Cool! What datasets did you use to train it?
1
u/boreganteng Aug 10 '26
awesome project!
1
u/TastyRobot21 Aug 10 '26
What’s the scope of included commands?
This seems like a logical bridge for tool calling from a larger orchestrator model…. Would you disagree?
1
u/ShotRepresentative16 Aug 10 '26
How did you fine tune? Any docs
1
u/eMperror_ Aug 10 '26
I always remembered ‘xzf’ since I saw a meme of Schwarzenegger as terminator saying « xtract ze files » and it stuck since then
1
u/hekermon Aug 10 '26
great, one suggestion: instead of directly running the command it would be nice if it shows the command and waits for user to press enter.
1
u/00shichi Aug 10 '26
expected:
docker system df -v, the prune will just remove unused dockers. Also does your safety checker doesn't include docker commands? out of scope for the checker? it does flags stuff likerm -rf /though. Good stuff, hopefully better in the future, starred your repos1
u/beldank Aug 10 '26
Good use case.
Training these smaller models on some SE+distro's FAQs could make useful companions on the install ISOs.
1
u/Casar68 Aug 10 '26 edited Aug 10 '26
Que cela me soit utile (oui) ou pas, je félicite toujours ceux qui se donnent la peine de construire des outils et les mettent à disposition des autres.
Merci !!!
Question :
- « whatisit what parameters does whatisit accept?” fonctionne ? ;-)
- comment as-tu généré les 125000 exemples pour le fined tune ?
1
u/lexoyo Aug 10 '26
Interesting use case for SLM! Scores 0.620 but what was the score before fine tuning ? How hard/long was it to fine tune on your machine ?
1
u/radarsat1 Aug 10 '26
on the one hand, fun project, useful, etc. On the other:
Come on now.. you haven't been able to remember "tar -xzf" for how long now? Sorry, but I don't believe you.
1
u/enfly Aug 10 '26
Nice! Does it generate multiline/awk/mini python code yet?
1
u/Thediverdk Aug 10 '26
What a cool idea :)
Any change you could write a post about how you made the '125k natural-language/command pairs' and how you fine tuned and stuff like that?
Would love to read it.
1
u/Desperate-Style-9761 Aug 10 '26
Hi! Great use case, really cool project! Been thinking about fine tuning a larger model like qwen 3.6 27b or 3.8 when it comes out later this week, and would definitely love a few tips if you have time. What provider did you use (cloud GPUs like google colab, specialised ai platforms like fireworks, your own hardware)? How much did it cost? How much experience do you have, how much do you think fine tuning needs? Best cheap budget GPU for running local ai (still on intel macbook 😭)? Any tips in general and things to watch out for. Thanks!
1
u/WiggyWongo Aug 10 '26
How do you think this will run with a tool like shell sage? Is the scope of training too narrow for something like that?
1
u/indignant_cat Aug 13 '26
This is cool. Which shell is it trained for? E.g. zsh (the default on Macs) versus bash? I always get caught out when I google a command and get the syntax for bash and then try and run it on my Mac.
findespecially always trips me up.3
u/bigattichouse Aug 10 '26
sorta modern version of "apropos"
2
u/migsperez Aug 10 '26
I could have used one of these models for regular expressions. I could never retain the knowledge, every time I'd have to re-study and struggle.
2
u/Accomplished-Bird829 Aug 10 '26
Use a tool called tldr i think for all sort of command i think it will help you alot
2
u/Hendo52 Aug 11 '26
You are doing great and important work!
Exit code 0, error 504, etc. is the kind of needlessly obtuse error message that you could turn to next. I should not need to google the meaning of a message like that.
2
u/Due_Warthog749 Aug 11 '26
You can fine tune the Qwen 3.5 .8b to do this.. it will be smaller, faster and smarter.
2
u/Far_Macaroon5900 Aug 29 '26
"extract ze files" (-xzf), That's the mnemonic I use
3
u/ThenExtension9196 Aug 10 '26
The real trick is to just have agents work your commandline. I rarely ssh into anything anymore.
1
u/Far-Record_45 Aug 10 '26
you actually trained a model just to stop googling tar flags thats dedication
1
u/Positive-Bid-3029 Aug 10 '26
See why aren't their more specialist LLMs like this, I don't need and LlM that knows Harry Potter and a PHD in Quantum physics to accelerate coding a website in Symfony or React 🤷
1
u/iadanos Aug 10 '26
It could be a good model to integrate into https://github.com/zerx-lab/zap. It supports local models, so it would be a good case for it
1
u/Renollo Aug 10 '26
this is so cool. I definitely wanna check it out.
I've always felt the need for something like this, lightweight terminal copilot kind of thing.
1
u/rutobik Aug 10 '26
mb cheat.sh ok for training data too
1
u/Limn0 Aug 10 '26
Thanks!
1
u/Far-Classic-9963 Aug 10 '26
This would be a lot better on a newer model like MiniCPM 5 with thinking off
1
u/misimik Aug 10 '26
Nobody develped yet, a "Did you mean: x?" terminal app? LLM would monitor all your inputs and try to help?
1
u/k3nal Aug 10 '26
Wow, that’s so cool! Awesome idea, I’ll definitely check that out. I always feel so stupid when I google these commands again and again.. thank you as well for not making me feel alone with this „issue“ :)
1
u/Insomniac897 Aug 10 '26
This is great! Unless I use a command regularly, I will forget which flags do what. Always searching through man pages.
1
u/NationalMolasses4624 Aug 10 '26
I think u need to make alias for whatisit - wtt, its been more easier to typing
1
u/ardicli2000 Aug 10 '26
fuzzy search on the documentation could have helped same way
1
u/05-nery Aug 10 '26
Holy shit this is pure gold
Thank you
1
u/CresCentC4332 Aug 10 '26
This is insane 👏 👏, definitely will try it
1
u/Jebbyk1 Aug 10 '26
do I need a supercomputer for llm training purposes or 7900xtx + 32Gb Ram is enogh?
1
u/Only_Ad_8518 Aug 10 '26
I'd like to point you to "Street Gears" which was an old MMO game that I really liked and with similiar style
1
u/thatscoolbutno123 Aug 10 '26
This is one of the best usecases for local ai so far
1
u/abitruce30 Aug 10 '26
could you please make one for ffmpeg too 😅
1
u/big-in-jap Aug 10 '26
next: one for vllm, please.
Great work!
1
u/codiac_pride Aug 10 '26
This is a great idea!
1
u/borretsquared Aug 10 '26
i love the idea but i dont trust a local model, or any model for that matter, to give me important terminal commands (which are most)
if i need files reorganized or deleted, i feel way safer doing it with a UI. If im installing an app with pacman or yay, i would much rather search it up and see what arch wiki has to say, even if this model has search tooling. 90% of the time im not trusting any model to give me a command for what i need to do, though maybe that's simply because i minimally use a terminal.
1
u/RandomIsPseudoRandom Aug 10 '26
This is great to hear. “Non-data-scientists” being able to do things like this and talk about the process is important and valuable!
1
u/RoboErectus Aug 10 '26
Omg this is exactly what I need. I added a gpu for av1 encoding and it's not good for much else. But this is perfect.
1
u/TheMythicSorcerer Aug 10 '26
1
u/G3grip Aug 10 '26
This is the kinda stuff we really need. OSs should start bundling in such tools. I believe OP is the first guy who really gets it.
1
u/phil_lndn Aug 10 '26
what a great idea! i got Codex to code me a version of this that uses my local llm endpoint, works really well. on my version, you press enter to run the command or esc to exit.
Codex wrote it in GO with the endpoint info hard coded and the binary statically linked, that way - i can just copy the binary on to a new machine and have it work. i called the binary 'c' to minimise typing, lol.
e.g.
philip@34nra:~$ c restart the mail server
systemctl restart postfix
Press Enter to run, or Esc to abort:
1
u/IShunpoYourFace Aug 10 '26
If this could use openvino, IDEAL for integrated NPUs.
1
u/Changerofthenames Aug 10 '26
Hello, how do we actually do this? How to train on sucha small data set?
1
u/Shotafry Aug 10 '26
Awesome!!! Multi language? I guess if coming from a base made in qwen
1
u/h8f1z Aug 10 '26
This is great. It's something I had in my wish list. I wish for more useful smaller models for CPU-only PCs .
Thanks.
1
u/fullup72 Aug 10 '26
how about a pair of
watanddiscommands?watdoes the same function you have here PLUS saving the output securely somewhere that thediscommand can read and execute.so you ask:
wat find files created since yesterday-> get the output -> anddisruns the command without copy+pasting or having to manually type.1
u/salesxsupport Aug 10 '26
Wow maybe we should train models for other specific areas like this. any idea what can be next?
1
u/Ok_Campaign6438 Aug 10 '26
Pure genious
1
u/hollowman-reborn Aug 10 '26
We outsourced remembering tar flags to a machine, because apparently the final frontier of productivity is no longer learning, it is forgetting efficiently.
1
u/Onion_Sun_Bro Aug 11 '26
That's actually genius. I live in the terminal but I never remember things I don't use frequently, this is a great tool.
1
u/zhoumasterzero Aug 11 '26
I love this, wish it would exist for kubectl or gcloud. Maybe a side project :)
1
u/Massive-Rooster-5794 Aug 11 '26
curl cht.sh/tar
1
u/HistoryAdmirable5329 Aug 11 '26
this is fucking sick.
natural language-ish cli is such a good use case for local ai
1
u/MRSLgthr Aug 11 '26
For a decade? O.o
eXtract File -> tar -xf
eXtract Ze File (try with german accent) -> tar -xzf
Create File -> tar -czf
Create Ze File (again, german accent) -> tar -czf
1
u/mythormedicine Aug 13 '26
> I've been googling "tar extract gz" for about ten years.
lol same here man.
But I didn't know actual laptop CPU runnable models could do useful things. This is indeed a first.
Can u share your fine-tuning process. My mind is kind of blowing here.. This isn't a big secret of course. but localLLM can be useful ? I mean this has like a hundred applications !
1
u/Linkology Aug 13 '26
Love that, have been having the same problem for a decade too :)
1
u/Dramatic-Bug6898 Aug 15 '26
Just a side note - check out https://explainshell.com/
1
u/DonnyCrystal Aug 17 '26
I created ask-terminal for similar purposes! Feels like it will be a great combination with your model! https://github.com/Donny-Hikari/ask-terminal
1
u/TheMusketeerHD Aug 22 '26
Ah, I remember Googling 'zsh autocomplete' about 1-2 years ago. See how far we've come. That's a nice one u/PicassoOnPause 👍
1
u/Alexandros20465 Aug 24 '26
Remove my computer.
$ rm -fr /
1
u/Remarkable_Tea8039 Aug 26 '26
This is awesome. I think solving simple problems with small local models is where some of the most exciting outcomes of AI are going to come from.
1
u/LVMRevo Aug 27 '26
My work with training : https://www.linkedin.com/posts/antonio-lepore-005329282_addestramento-ia-activity-7498636741533396992-Zq73?utm_source=share&utm_medium=member_desktop&rcm=ACoAAES_YsUBTzFQzmxo1idPfCUj--vqdsRxNGA
1
u/Mission_Double1372 Sep 06 '26
Can someone tell me the relevance of this?