Lovelaice, an LLM-powered assistant for hackers without self-regard
A chatbot you can use directly from your terminal to blow up you computer on your own terms.
Hey!
For the past week or so, I’ve been hacking together this tiny project —whenever I get a chance between actual work and changing diapers. It’s called Lovelaice, and it’s one of my undergrad dream projects come true.
In short, Lovelaice is an LLM-powered chatbot that runs in the terminal. You can use it for general-purpose chat, just like ChatGPT or any number of clones out there. But the magic starts when you pair the coding capabilities of a medium-sized LLM with an execution environment.
Now, that was a mouthful! It just means that Lovelaice can also generate and execute code in your terminal to do things for you.
Wait, what?
Yep, you heard it right. Just ask Lovelaice something like upgrade my distro, or install something to unzip files with password, or stage and commit all files, and the bot will concoct a suitable (and sometimes utterly disastrous) line of Bash and run it for you (if you let it, that is).
It knows a bit of Bash so with the right prompt it can probably save you a couple of miserable minutes of googling around for the exact syntax for that tar command you so desperately need.
It can also generate and run simple Python programs to, e.g., compute some complicated formulas, generate random DnD throws, find if your social security number is prime, you know, the typical things you need in your daily life.
And it can do much more. It is powered by one of the best open-source LLMs out there.
Is this legal… I mean, safe?
Well, no, of course. LLMs are well known for their brittleness and tendency to make subtle mistakes. So, never, ever trust an LLM without double-checking their response.
Especially never run code generated by an LLM without being conscious of what the code will do. No matter what the LLM says, assume the code was found in a dark blog somewhere in the murky corners of the Internet —which is probably true, anyway.
So why do this?
Initially, for educational purposes. But Lovelaice can also be quite helpful in real situations. I have used it to run some inoffensive but annoying Bash commands without having to check the man page or copy/paste from Stack Overflow.
If you know Bash, you’re much faster auditing a line of code and checking that it does what you expect, than coming up with that line in the first place. Like with code generators, evaluation is easier than generation, so there is something to gain in using these tools responsibly.
Can I see how it works?
Well, this post is just to show you the end result. I will go through implementation details in future entries in my Coding Lessons section, so hang out around here if you fancy that kind of article.
Can I use it?
Yes, you can! The code is MIT-licensed, so you are free to blow up your computer whenever you want. Just don’t call me later. I warned you.
One note, though. This project uses an LLM model provided by Mistral, so you’ll need to set up your own API keys to use it extensively.
Happy hacking!
Alex, this is really cool to see first hand. Are you able to sell this little fella somewhere too?