I have been experimenting with LLMs for some time, and now it is the right moment to talk about it. My experience formed mainly through interactions with OpenAI ChatGPT. Very low barrier of entry. I used it for code generation, what else!
To write code means two fundamental things:
- To come up with a plan of what is it to be built, and roughly how.
- Execute the manual labor of typing the code.
The first part leads to an API: how do I communicate with the part of the world I am going to build? This is where types, access methods and APIs form. The second part is writing all that code responsible for flag parsing, configuration handling, setting up a logger, initializing various clients, servers, and so on. Regardless how abstracted it may be. If you write code, you get the drift. There’s a reason why people have been doing scaffolding for decades.
It would be great if an LLM could do all that initial work. Propose a structure, and provide an initial implementation. With my experiments, I found out that an LLM was able to give me a good enough first version of the code. Something I could take from it, understand what it does, build on top of it. I don’t like working iteratively on the code for a long time with an LLM. I take the first acceptable solution. Maybe the first acceptable solution required a few iterations.
I mean, judge for yourself:
Prompt: write a Golang IMAP client, list emails from a mailbox folder, allow listing emails from a certain date
|
|
Now, I do not know much about IMAP to be the jury on the quality case. To this day I haven’t used that code, nor I tried understanding it. But somehow this example speaks to me. I would accept it as my starting point, I take over from here. However, I would still enjoy something helping me write the next few lines. Something like GitHub Copilot is incredibly useful. It is easier to control the change, easier to make a mental note, like in old-school manual programming. Why? The Copilot-like solution materializes the thoughts we already formed. The code it writes we have already seen, noted, conceptualized, and finally accepted. All in a shot time span, but the process of physically typing every letter has been eliminated. It’s more than predictive typing because it understands the code and context.
I observe significant number of companies embracing Copilot. Something Copilot-like but hosted locally would be nice to have. I think that Tiny-LLM would be a good fit.
A couple of other event cemented my view that the two-step approach is the right one to embrace.
- Take an acceptable first foundation from an LLM.
- Build on it with something more contextual, Copilot-like.
I have done many more interesting experiments. Some front end JavaScript web components were pretty impressive. Something I would never expect a junior engineer to come up within seconds. I had it build color pickers attachable to an arbitrary DOM node, draggable and resizable areas embedded into PDF.js with position, size, offset calculation, all sorts of crazy stuff that just worked straight copy-paste. It would write container files, make files, bash scripts, Golang, Python.
My experience with other models yields promising results.
Running a software company means that sometimes one needs to write internal software. There was never enough time, there is always other stuff going on.
the leading thought
have an additional pair of hands to automate the process of writing
and let me focus on conceptualizing
That thought led to other thoughts that led to the decision to get proper equipment. I finally had an opportunity, and some motivation for good measure, to work on it.
So far there’s ollama with Open WebUI, speech-to-text, text-to-speech, Jupyter Notebook code runner, and Stable Diffusion. Everything inside self-hosted Headscale VPN running in Kubernetes on Hetzner, with valid Let’s Encrypt certificates provided by cert-manager and its Route53 DNS-01 solver for the internal network. All DNS names for HTTP-based services inside the VPN can be served TLS-encrypted.
It took a week from a concept to a working solution. And surprisingly it wasn’t that much plumbing.
I’ll write some more soon.