The llm-gemini repository has 467 stars, 66 forks; started 2023-12, last updated 2026-11.
For credentials, I use llm keys set gemini or LLM_GEMINI_KEY.
For command-line convenience, aliases omit the gemini/ prefix.
The supported embedding models are gemini-embedding-2 latest; gemini-embedding-001 available for text-only use cases.
I install llm-gemini in the same environment as LLM with llm install llm-gemini.
I can set gemini-flash-latest as my default model with llm models default gemini-flash-latest.
- I have used this plugin model list: gemini/gemini-4-neon, gemini/gemini-4-hydrogen, gemini/gemini-4-carbon, gemini/gemini-4-argon, gemini/gemini-3.8-flash, gemini/gemini-3.7-flash, gemini/gemini-3.5-flash-lite, gemini/gemini-3.6-flash, gemini/gemini-3.5-flash, gemini/gemini-3.1-flash-lite, gemini/gemma-4-31b-it, gemini/gemma-4-26b-a4b-it, gemini/gemini-3.1-flash-lite-preview, gemini/gemini-3.1-pro-preview-customtools, gemini/gemini-3.1-pro-preview, gemini/gemini-3-flash-preview, gemini/gemini-flash-lite-latest, gemini/gemini-flash-latest, and gemini/gemini-2.5-flash.
I can force JSON responses with -o json_object 1; a schema can also be supplied with --schema 'name,age int,bio'.
Gemini 3 and later support -o thinking_level X; supported levels vary by model, and the model uses its own default when I do not set one.
The gemini-2.5-flash, gemini-flash-latest, and gemini-flash-lite-latest models instead use -o thinking_budget X; setting it to 0 disables thinking.
- I have these documented thinking levels: gemini-3-flash-preview supports minimal, low, medium, and high; gemini-3.1-pro-preview and gemini-3.1-pro-preview-customtools support low, medium, and high; gemini-3.1-flash-lite-preview, gemini-3.1-flash-lite, gemini-3.5-flash, gemini-3.6-flash, and gemini-3.5-flash-lite support minimal, low, medium, and high; gemini-3.7-flash, gemini-3.8-flash, gemini-4-argon, and gemini-4-carbon support low, medium, and high; gemini-4-hydrogen and gemini-4-neon support low, medium, high, and xhigh.
I can run an interactive Gemini session with llm chat -m gemini-flash-latest.
The Gemini API has no timeout by default; I can set a timeout on CLI or Python calls, and Python raises an httpx.TimeoutException subclass if it is exceeded.
Both gemini-embedding-2 and gemini-embedding-001 offer 3072-, 1536-, and 768-dimensional variants, selected with -1536 or -768 suffixes.
The gemini-embedding-001 and gemini-embedding-2 embedding spaces are incompatible, so switching an existing collection between them requires re-embedding all its content.
I can list models exposed by the Gemini API with llm gemini models; some listed models may not be available through the plugin.
I can use --key X to select a different API key and repeat --method to filter for models supporting any of the specified generation methods.
I run the plugin tests with uv run pytest and run its models through LLM with uv run llm models -q gemini.
The plugin uses pytest-recording to record Gemini API responses for tests; I can capture a response for a new test with PYTEST_GEMINI_API_KEY="$(llm keys get gemini)" uv run pytest --record-mode once.
On 2024-05-14, I said the llm-gemini model supports the new inexpensive Gemini 1.5 Flash model.
I pointed readers to the llm-gemini plugin release notes at https://t.co/dcuGoBEBsY.
After asking whether anyone had run a prompt through the new Gemini 1.5 Flash API and finding the documentation insufficient, I said, “Figured it out,” and shared the llm-gemini workflow.
On 2024-12-11, I said Gemini 2.0 Flash was available through the API with multimodal input and text output only for the moment. I just released a new llm-gemini plugin version to support the new model.
pipx install llm
llm install llm-gemini --upgrade
llm keys set gemini
# paste API key here
llm -m gemini-1.5-flash-latest 'a short poem about otters'
I released a new version of the llm-claude-3 LLM plugin, adding support for the new Claude 3 Haiku model, which I described as “pretty fast.”
llm install --upgrade llm-claude-3
llm -m claude-3-haiku 'fun facts about armadillos'
I shared the plugin at https://t.co/L7DHEn48Bf and more information about my LLM CLI tool for interacting with Large Language Models in the terminal at https://t.co/6mRowSMuUb.
I updated the llm-gemini plugin to support the Gemini Pro 1.5 API preview.
llm install llm-gemini
llm keys set gemini
<paste key here>
cat really-long-file.txt | llm -m gemini-1.5-pro-latest "summarize this document"
I released a new version of my LLM command-line tool, adding support for the new GPT-4o model released by @OpenAI that morning.
pipx install llm
llm keys set openai
# Paste API key here
llm -m 4o "Fascinate me"
llm install --upgrade llm https://t.co/gYMG7Ardr9
I linked to the @OpenAI release notes for the GPT-4o announcement at https://t.co/CjjeNNEb4h.
I use the LLM command-line tool with provider plugins to access hosted language models, configure API keys, and try models through direct prompts.
I described llm-mistral as a new LLM plugin for talking to the brand new Mistral API.
Adding llm-mistral and the new llm-gemini took the plugin list up to 19 plugins.
I had been using Mistral Medium with my LLM CLI tool, an API key from Mistral, and the plugin; I showed this command for sending a prompt: llm -m mistral-medium 'prompt goes here'.
I said @angerman built a plugin for an API described as “ludicrously fast API serving of Llama 2 70B and Mixtral.”
llm install llm-groq
llm keys set groq
< paste API key >
llm -m groq-mixtral 'A long story about pelicans'
I upgraded llm-mistral to support the new Mistral Large API model MistralAI released that day, then used mistral-large from the CLI.
pipx install llm
llm install llm-mistral --upgrade
llm keys set mistral
<paste API key here>
llm -m mistral-large 'prompt goes here'
I used my LLM command-line tool with the new llm-claude-3 plugin to run llm chat -m claude-3-opus while tweaking code for the first time with Claude 3 Opus. I said the prompt was quite easy and it was nice to see the model nail the response.
I shared the full chat transcript, saying it included a detailed explanation of the code it wrote.
Related: provider plugin integrations, gemini 2 0 models, gemini api and tools