I released a new llm-gemini plugin with support for the Gemini 2.0 Flash model, here's how to use that in the terminal:
llm install -U llm-gemini
llm -m gemini-2.0-flash-exp 'prompt goes here'
LLM installation:
https://llm.datasette.io/en/stable/setup.htmlWorth noting that the Gemini models have the ability to write and then execute Python code. I tried that like this:
llm -m gemini-2.0-flash-exp -o code_execution 1 \
'write and execute python to generate a 80x40 ascii art fractal'
Here's the result:
https://gist.github.com/simonw/0d8225d62e8d87ce843fde471d143...It can't make outbound network calls though, so this fails:
llm -m gemini-2.0-flash-exp -o code_execution 1 \
'write python code to retrieve https://simonwillison.net/ and use a regex to extract the title, run that code'
Amusingly Gemini itself doesn't know that it can't make network calls, so it tries several different approaches before giving up:
https://gist.github.com/simonw/2ccfdc68290b5ced24e5e0909563c...The new model seems very good at vision:
llm -m gemini-2.0-flash-exp describe -a https://static.simonwillison.net/static/2024/pelicans.jpg
I got back a solid description, see here:
https://gist.github.com/simonw/32172b6f8bcf8e55e489f10979f8f...