--- id: llama-index-llms-google-genai version: "0.9.6" license: MIT license_treatment: permissive maintenance: active --- # llama-index-llms-google-genai — llama-index llms google genai integration License: permissive · Maintenance: active · Downloads: 189.3K/mo ## 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 above — 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 pip install llama-index-llms-google-genai uv add llama-index-llms-google-genai poetry add llama-index-llms-google-genai ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 189.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags google gemini llama index integration, llm wrapper google genai, gemini api python llamaindex, google ai text generation, streaming chat with gemini, llm-integration, rag-framework, gemini-api [View on SkillFed](https://skillfed.io/packages/llama-index-llms-google-genai) · [View on PyPI](https://pypi.org/project/llama-index-llms-google-genai/)