I'm increasingly building entire functional prototypes from start to finish using Claude 3.5 Sonnet. It's an amazing productivity boost. Here are a few recent examples:
datasette-checkbox is a Datasette plugin adding toggle checkboxes to any table with is_ or has_ columns. Animated demo and prompts showing how I built the initial prototype here: https://simonwillison.net/2024/Aug/16/datasette-checkbox/
I still see some people arguing that LLM-assisted development like this is a waste of time, and they spend more effort correcting mistakes in the code than if they had written it from scratch themselves.
I couldn't disagree more. My development process has always started with prototypes, and the speed at which I can get a proof-of-concept prototype up and running with these tools is quite frankly absurd.
I'll echo this sentiment. LLMs have made it so easy to create bash scripts to make things easier, write code in languages I don't write in, or even just for writing up the README.md just based on the code I've written.
I just finished my initial prototype for a Raspberry Pi Zero W based audio recorder. These are all the things it does:
- It has a single button connected to GPIO that starts/stops recording
- An LED indicator connected to GPIO
- Queries the available recording devices, choosing the external USB audio interface if available and setting the appropriate bit-depth
- Launches ALSA's `arecord` in a subprocess to handle the actual recording (<5% CPU on a Pi Zero W when recording 48k @ 32bit)
- The script is setup as a system service
- Nginx is running to serve up the WAV files using a web UI
- There is a simple service to start/stop recording and get status via an API the web UI can use
It is all in Python, which I don't really write, but is the default for these kind of Pi projects. 100% of the code, service definitions, Nginx config, README.md, etc were written by LLMs, mostly Claude.
This is also doable with one line of bash via imagemagick in any terminal that supports the Kitty or iTerm2 graphics protocols, which is most mainstream ones (iTerm2 itself, Kitty, Konsole, etc.)
I don't say this to bash your techniques but to point out that there are other methods which permit quick prototyping and easy iteration, and that LLMs are, at least in my experience, not a paradigm-shifting improvement in this vein.
Imagemagick doesn't solve this particular problem. My goal here is to process an image so I can use it on my blog. I want to find the right balance between image size and visible quality - since images on my blog have a maximum size, I can often get away with a lower quality JPEG because it well be effectively treated as a "retina" image.
But to make that decision, I need to see the images. I could run a bash script to generate those images in a bunch of different qualities and then view them with some kind of image viewer, but that's extra steps - and it involves creating a bunch of temporary files that I then need to clean up.
With the web version I can snap a screenshot with CleanShot X and then drag that screenshot straight onto the web page. I instantly see the different images, pick one that looks good to me, download that and then drag it into my S3 uploading software (Transmit).
All of that said... if I was going to prototype this with imagemagick I would 100% use an LLM for that, too. I don't remember the imagemagick flags for this kind of thing; ChatGPT and Claude know those flags already.
> But to make that decision, I need to see the images. I could run a bash script to generate those images in a bunch of different qualities and then view them with some kind of image viewer, but that's extra steps - and it involves creating a bunch of temporary files that I then need to clean up.
That's not correct at all. You can, in fact, do all of these steps in a single command line program with Konsole (or iTerm2 on Mac, or Kitty - whatever terminal you're using, as long as it supports these features), imagemagick, and bash.
$ for size in $(seq 10 10 100); do; convert -resize $size% input.png output_$size.webp; timg output_$size.webp; done
timg, here, is https://github.com/hzeller/timg, but you could use anything that speaks iTerm2 or kitty. This approach generalizes easily, too; you can easily use this to vary any parameter imagemagick supports, like webp compression or posterization or dithering, and print out any parameters of the image, like size, along with the image itself.
> With the web version I can snap a screenshot with CleanShot X and then drag that screenshot straight onto the web page. I instantly see the different images, pick one that looks good to me, download that and then drag it into my S3 uploading software (Transmit).
In my workflow, I edit in Showfoto or Darktable, resize (or, in my case, more often dither and resize) as demonstrated, and then `cp` the appropriate selected image into my blog's main image folder. Hardly more difficult, and while you might not enjoy it, that's exactly my point - we can both make things we like, but you're asserting that LLMs massively changed the landscape overall, while I'm not using them at all.
I also have a script, which took about one minute to write, that cleans up the extra temporary images, so that's not much of a concern either.
I really think you overestimate how hard it is to use imagemagick. Unless you're doing really deep wizardry - or editing video on the command line, but I'm almost certain the LLM will have more trouble with that, too - it's not hard. I didn't take that command line in the above command from a script, by the way; I rewrote it from memory, in about thirty seconds, because it's not hard. There might be a syntax error, but that'd be, what, another ten seconds?
I'm not asserting that LLMs aren't useful. You demonstrate successfully that, to you, they are. I'm asserting that they're not orders of magnitude more useful than powerful, composeable interfaces to the software we already have - and they are orders of magnitude more environmentally and socially destructive.
Comparing them to "powerful, composeable interfaces to the software we already have" doesn't make sense to me, because I'm using them in conjunction with that - I'm far more able to take advantage of the software we have now because LLMs mean I don't have constantly look up zsh escaping rules, or ffmpeg invocations, or how to run AppleScript from my terminal, or how to get a fetch() to work cross-domain via CORS or whatever.
It's funny you say "editing video on the command line, but I'm almost certain the LLM will have more trouble with that, too" because ffmpeg is the perfect example of software that is almost unusable for me without LLMs, but thanks to LLMs is something I solve problems with every week: https://til.simonwillison.net/macos/quicktime-capture-script
I won't disagree on the environmentally and socially destructive aspects. The question for me is if the benefits they provide compensate for the many downsides - like the fact that I can prototype 5-10x faster, while people who have never programmed before are finally able to get started on that learning curve without being put off the first time they forget a semicolon.
Will I look back in ten year's time and say "wow, the positive applications of LLMs really had nothing on the negatives, I wish this had never been invented"? I don't know. Currently I'm leaning "it's worth it".
Could you not go a step further and use gpt4o-mini’s vision to check if the text is readable? Basically, extract the text from the biggest screenshot. Then compare it to extracts from increasingly smaller versions until the text degrades / diff crosses a threshold.
I don't think GPT-4o (or any of the other vision models) "see" at a high enough resolution to help here. The differences between high and low quality images are very slight - the text almost always remains legible in the smaller images, just with slightly more JPEG artifacts that are visible.
It may be possible to train a custom machine learning model that can identify the quality I'm looking for, but honestly it's very much a human judgement thing here.
Your tool is really cool, thanks for making it and sharing.
I notice that a lot of times, the multi-line output I get from my prompts is truncated or the model just aborts or something. The exit code is still 0 but it seems like something went wrong.
So you'd just type "use ffmpeg to convert 'my input.avi' to NTSC output and make the audio track quieter" => Alt+E => replaced with `ffmpeg -i "my input.avi" -target ntsc-dvd -af "volume=0.5" "output.mpg`
> I couldn't disagree more. My development process has always started with prototypes, and the speed at which I can get a proof-of-concept prototype up and running with these tools is quite frankly absurd.
I do agree. But I think people is focusing on speed as if it was the only important thing to measure. It may be for some people-in-suites, but what about professionals?
A friend of mine who had minor knowledge about internet (used to do wbesites in HTML with iframes back with Dreamweaver) was able to deploy a PHP app using GPT. Great! It saved him a lot of time. Now I asked him if he understood or was able to do a change and he told me that he mostly did copy and paste and asked GPT to change things for him.
Not saying GPT is going to dissappear and no one is able to maintain this, because that sounds silly, but even with GPT at your side, it's improtant to understand what's happening in case you need to do a change.
Two notes, before anyone jump to this: I am not talking about simonw particular case, he seems a developer who knows his way around Python and could do all of this by himself, it's just saving his time.
Secondly, probably in the future a LLM will be much better at coding and will be able to fix or improve your code even if you don't understand it and will be able to do an startup from zero, scale it, deploy servers, etc. Who knows?
Based on the majority of web sites on the Internet: Do we really care if the code is copy-pasted out of ChatGPT or out of Stack Overflow?
A lot of folks do not have the necessary knowledge to deeply understand the code they're writing - and I don't mean that as a diss. There's a lot of things they understand that better SWEs might not.
ChatGPT and StackOverflow both allow them to build things they otherwise couldn't, the same way e.g. cars are tools that allow people to travel faster even if they can't fix the cars or make smarter choices about where they go. At some point, that lack of knowledge will cause them harm, but that's not specific to any given tool, and the harm from ChatGPT advice isn't worse than the harm from SO advice.
Yeah, I'll second this. Our company has an aggressive push to use LLMs for development, and it has quite certainly been the the source of a lot of obscure problems that made it into production. Definitely going a bit too fast for their own good.
I think (based on observations from my admittedly flawed in many different ways workplace) the difference with Stackoverflow assisted development is scale. ChatGPT seems to have massively boosted the productivity of mediocre developers.
Obviously not saying that LLMs aren't empowering competent developers and spawning useful projects. But their ubiquity seems to have coincided with an avalanche of terrible code, at least at the fairly disorganized organization I work at.
https://tools.simonwillison.net/image-resize-quality is a tool for dropping in an image and instantly seeing resized versions of that image at different JPEG qualities, each of which can be downloaded. I used to use the (much better) https://squoosh.app/ for this, but my cut-down version is optimized for my workflow (pick the smallest JPEG version that remains legible). Notes and prompts on how I built that here: https://simonwillison.net/2024/Jul/26/image-resize-and-quali...
django-http-debug - https://github.com/simonw/django-http-debug - is an actual open source Python package I released that was mostly written for me by Claude. It's a webhooks debugger - you can set up a URL and it will log all incoming requests to a database table for you. Notes on how I built that here: https://simonwillison.net/2024/Aug/8/django-http-debug/
datasette-checkbox is a Datasette plugin adding toggle checkboxes to any table with is_ or has_ columns. Animated demo and prompts showing how I built the initial prototype here: https://simonwillison.net/2024/Aug/16/datasette-checkbox/
https://tools.simonwillison.net/gemini-bbox is a tool for trying out Gemini 1.5 Pro's ability to return bounding boxes for items it identifies. You'll need a Gemini API key for this one, or take a look at the demo and notes here: https://simonwillison.net/2024/Aug/26/gemini-bounding-box-vi...
https://tools.simonwillison.net/gemini-chat is a similar tool for trying out different Gemini models (Google released three more yesterday) with a streaming chat interface. Notes on how I built that here: https://tools.simonwillison.net/gemini-chat
I still see some people arguing that LLM-assisted development like this is a waste of time, and they spend more effort correcting mistakes in the code than if they had written it from scratch themselves.
I couldn't disagree more. My development process has always started with prototypes, and the speed at which I can get a proof-of-concept prototype up and running with these tools is quite frankly absurd.