A community-maintained PHP client for the Gemini API, covering text, media, streaming, tools, and file and cache management.
simonw/llm-gemini
An LLM plugin that gives the LLM command-line tool and Python library access to Google's Gemini models.
- Stars
- 465
- Forks
- 62
- Open issues
- 31
- Last commit
- 25 days ago
What is it?
llm-gemini is a plugin for LLM, Simon Willison's command-line tool and Python library for working with language models. Once installed, it lets you run Google's Gemini models, including Gemini Flash and Pro variants and Gemma models, from the same interface you use for other providers, with your Gemini API key stored through LLM's key management.
Beyond plain text prompts, the plugin supports image, audio and video attachments (including YouTube URLs), JSON output, schema-constrained responses, and per-model thinking controls. Server-side tools can be enabled per prompt, including code execution, Google Search grounding and URL context. It also provides embedding models for use with LLM's embedding commands and similarity search, and a command for listing the models the Gemini API exposes.
Key features
- 01Run Gemini and Gemma models through the LLM CLI and Python library.
- 02Send images, audio, video and YouTube URLs as prompt attachments.
- 03Force JSON output or constrain responses with a schema.
- 04Enable server-side code execution, Google Search grounding or URL context per prompt.
- 05Use Gemini embedding models with LLM's embed and similar commands.
- 06List all models exposed by the Gemini API with a built-in command.
Use cases
- Querying Gemini models from scripts or a terminal without writing custom API code.
- Transcribing or summarizing audio, video and YouTube content from the command line.
- Building embedding collections in SQLite and running similarity searches over them.
- Extracting structured JSON from documents or images for downstream processing.
Quick start
- 1
Install the plugin into the same environment as LLM
llm install llm-gemini - 2
Store your Gemini API key
llm keys set gemini - 3
Run a prompt with a Gemini model
llm -m gemini-flash-latest "A short joke about a pelican and a walrus"
Things to know
- Requires a Gemini API key, which is a paid or quota-limited service.
In collections
Topics
FAQ
- What is llm-gemini?
- An LLM plugin that gives the LLM command-line tool and Python library access to Google's Gemini models. llm-gemini is a plugin for LLM, Simon Willison's command-line tool and Python library for working with language models. Once installed, it lets you run Google's Gemini models, including Gemini Flash and Pro variants and Gemma models, from the same interface you use for other providers, with your Gemini API key stored through LLM's key management.
- Is llm-gemini free to use? What license does it have?
- llm-gemini is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is llm-gemini still maintained?
- Actively maintained. The last commit to llm-gemini was on Oct 13, 2026.
- What can I use llm-gemini for?
- Querying Gemini models from scripts or a terminal without writing custom API code. Transcribing or summarizing audio, video and YouTube content from the command line. Building embedding collections in SQLite and running similarity searches over them. Extracting structured JSON from documents or images for downstream processing.
- How do I install llm-gemini?
- Install the plugin into the same environment as LLM: llm install llm-gemini Store your Gemini API key: llm keys set gemini Run a prompt with a Gemini model: llm -m gemini-flash-latest "A short joke about a pelican and a walrus"
- Where can I get llm-gemini?
- The source code and installation instructions are on GitHub: https://github.com/simonw/llm-gemini
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A collection of guides, tutorial notebooks, and end-to-end app examples for building with Google's open Gemma model family.
Open-source Python package that turns websites, PDFs, images, YouTube videos or topics into multilingual audio podcast conversations using GenAI.
A Python library for building multimodal language agents that can reason over text, images, video and audio inputs.
A provider package that connects the Vercel AI SDK to OpenRouter, giving access to hundreds of LLMs through one API.
A set of ROS 2 packages that run GGUF-based LLMs, vision-language and audio models via llama.cpp inside ROS 2 nodes.