llama-index-llms-google-genai
llama-index llms google genai integration
What it is and what it does
This package bridges Google's Gemini language models into the LlamaIndex framework, letting you use Gemini as a drop-in LLM backend for RAG pipelines and AI applications. It wraps the google-genai client library and exposes standard LlamaIndex LLM methods: complete() for simple text generation, chat() for multi-turn conversations, and stream_complete()/stream_chat() for real-time token streaming. The package handles API authentication via environment variable and supports both synchronous and asynchronous execution patterns.
The integration depends on llama-index-core for the base LLM interface contract, google-genai for the underlying API client, and Pillow for image handling. It targets Python 3.10 and above and is actively maintained. No known security vulnerabilities are recorded. The package is positioned as a thin adapter layer rather than a feature-rich wrapper, so you interact with Gemini's capabilities as exposed by the google-genai library.
Use it for:
- Build RAG applications that retrieve documents and send them to Gemini for synthesis via LlamaIndex's standard LLM interface.
- Implement multi-turn chatbots with conversation history using the chat() method and ChatMessage objects.
- Stream long-form content generation (stories, documentation) to users in real-time without waiting for full completion.
- Prototype AI features quickly by swapping Gemini in place of other LLM backends in existing LlamaIndex code.
- Run async LLM calls in concurrent applications using acomplete() and astream_complete() methods.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Google's Gemini models into LlamaIndex applications, providing a unified interface for text generation, chat, and streaming responses via the Google GenAI API.
Yes, if you are building with LlamaIndex and want to use Gemini as your LLM backend. Install friction is low, the license is permissive, maintenance is active, and no vulnerabilities are known. The main prerequisite is a valid Google API key and familiarity with LlamaIndex's LLM abstraction layer.
Install
llama-index-llms-google-genai on PyPI
pip
pip install llama-index-llms-google-genaiuv
uv add llama-index-llms-google-genaipoetry
poetry add llama-index-llms-google-genaiInstalling llama-index-llms-google-genai
Before you install
Low friction install with a pure Python wheel and three straightforward runtime dependencies. Active maintenance status with recent releases.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for most production and proprietary projects.
Quickstart
pip install llama-index-llms-google-genai
from llama_index.llms.google_genai import GoogleGenAI
llm = GoogleGenAI(model="gemini-3-flash-preview")
resp = llm.complete("Write a poem about a magic backpack")
print(resp)
Requires GOOGLE_API_KEY environment variable set with a valid Google API key.
Verify before relying
- Whether all Gemini model variants are supported or only specific versions like gemini-3-flash-preview.
- Rate limits or quota constraints imposed by Google GenAI API on requests.
- Whether image handling via Pillow is for input preprocessing, output rendering, or both.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — google-genai, llama-index-core, pillow |
| Maintenance | actively maintained — 37 days since the last release |
| First released | |
| Downloads | 189,310/month — #9,931 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: llama_index_llms_google_genai-0.9.6-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
llama-index-llms-openaiIntegrates OpenAI's language models into…
permissive · top 1,000 on PyPI
llama-index-llms-geminiIntegrates Google's Gemini LLM with LlamaIndex,…
permissive · top 15,000 on PyPI
llama-index-llms-ollamaIntegrates local Ollama language models with…
permissive · top 15,000 on PyPI
llama-index-llms-vertexIntegrates Google Vertex AI's LLM capabilities…
permissive · top 15,000 on PyPI
llama-index-llms-litellmIntegrates LiteLLM with LlamaIndex to provide…
permissive · top 15,000 on PyPI
llama-index-llms-azure-openaiIntegrates Azure OpenAI language models into…
permissive · top 15,000 on PyPI
llama-index-embeddings-google-genaiIntegrates Google's Gemini and Vertex AI…
permissive · top 15,000 on PyPI
llama-index-llms-langchainBridges LlamaIndex with LangChain LLM…
permissive · top 15,000 on PyPI
llama-index-llms-ibmIntegrates IBM watsonx.ai foundation models…
permissive · top 15,000 on PyPI
llama-index-llms-bedrockIntegrates AWS Bedrock LLMs into LlamaIndex,…
permissive · top 15,000 on PyPI