# googleapis/python-genai

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/googleapis-python-genai).**

3,819 stars · 923 forks · Python · Apache-2.0

## Links

- GitHub: https://github.com/googleapis/python-genai
- Homepage: https://googleapis.github.io/python-genai/
- awesome-repositories: https://awesome-repositories.com/repository/googleapis-python-genai.md

## Description

This project is a Python software development kit and framework for building applications that integrate with large language models. It serves as a multimodal content generator and vector embedding library, enabling the production and editing of text, images, audio, and video.

The toolkit provides specialized capabilities for adapting base models through supervised and reinforcement training. It further distinguishes itself by offering tools for orchestrating complex workflows, including stateful chat sessions, the enforcement of structured output via schemas, and the integration of external tools and function calling.

The library covers a broad range of functional areas, including large-scale AI inference via asynchronous batch predictions, semantic search through text embeddings, and the management of server-side context caching to reduce latency. It also provides utilities for calculating token counts, managing uploaded media files, and configuring model hyperparameters.

## Tags

### Artificial Intelligence & ML

- [Generative](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-orchestration-frameworks/generative.md) — Acts as a framework for orchestrating LLM workflows, stateful chats, and structured output enforcement.
- [Generative AI Models](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-models.md) — Produces text, code, or media by interfacing with large-scale generative AI models. ([source](https://googleapis.github.io/python-genai/](https://googleapis.github.io/python-genai/))
- [Generative Content APIs](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-content-apis.md) — Provides programmatic interfaces for sending prompts to AI models and retrieving generated content. ([source](https://github.com/googleapis/python-genai/blob/main/MANIFEST.in))
- [Multimodal Input Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-model-inference/multimodal-input-processing.md) — Processes multimodal inputs including text, images, and audio within a single request. ([source](https://github.com/googleapis/python-genai#readme))
- [Multimodal Media Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-powered-image-selection/ai-background-removal-and-inpainting/ai-powered-image-and-video-generation/multimodal-media-generation.md) — Produces a variety of media types including text, images, and audio based on multimodal prompts. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))
- [Chat Session Management](https://awesome-repositories.com/f/artificial-intelligence-ml/chat-session-management.md) — Provides stateful conversation management to track dialogue history across multiple turns. ([source](https://github.com/googleapis/python-genai#readme))
- [Conversation State Management](https://awesome-repositories.com/f/artificial-intelligence-ml/conversation-state-management.md) — Tracks dialogue history across multiple turns to maintain context and session state during interactive chats.
- [External Tool Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/external-service-integrations/external-knowledge-integrators/external-tool-integrations.md) — Integrates external utilities like search engines and code execution to extend model functionality. ([source](https://github.com/googleapis/python-genai#readme))
- [Function Calling Interfaces](https://awesome-repositories.com/f/artificial-intelligence-ml/function-calling-interfaces.md) — Provides function calling interfaces that enable models to execute external tools and APIs. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [Automatic Tool Executions](https://awesome-repositories.com/f/artificial-intelligence-ml/function-calling-interfaces/automatic-tool-executions.md) — Executes external tools automatically when the language model triggers a function call. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))
- [Generative AI Development](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/generative-ai-development.md) — Provides a comprehensive SDK for building applications that integrate large language models for text, code, and media generation.
- [Image Editing](https://awesome-repositories.com/f/artificial-intelligence-ml/image-generation/image-editing.md) — Provides capabilities to generate new images from text prompts and edit existing visuals using AI. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [Tool Call Executions](https://awesome-repositories.com/f/artificial-intelligence-ml/local-model-structured-outputs/function-calling-interfaces/tool-call-executions.md) — Performs the actual runtime invocation of external functions based on structured model outputs. ([source](https://googleapis.github.io/python-genai/))
- [Multimodal Content Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/multimodal-content-generation.md) — Creates high-resolution images, videos, and text from mixed-modality prompts. ([source](https://github.com/googleapis/python-genai#readme))
- [Multimodal Content Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/multimodal-content-generators.md) — Serves as a toolkit for producing and editing text, images, audio, and video using multimodal inputs.
- [Tool Calling](https://awesome-repositories.com/f/artificial-intelligence-ml/pure-function-model-execution/tool-calling.md) — Connects a model to custom functions or external tools to request and receive real-world data. ([source](https://github.com/googleapis/python-genai#readme))
- [Structured Output Enforcements](https://awesome-repositories.com/f/artificial-intelligence-ml/structured-output-enforcements.md) — Constrains model responses to specific formats using schemas or predefined values for reliable processing. ([source](https://googleapis.github.io/python-genai/))
- [Text Embeddings](https://awesome-repositories.com/f/artificial-intelligence-ml/text-embeddings.md) — Converts text into numerical vector representations to enable semantic searches and similarity tasks. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [Video Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/video-generation.md) — Produces video content from text or image prompts and allows extending existing video clips. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [Batch Prediction Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/batch-prediction-processing.md) — Implements batch prediction processing for high-throughput inference on large datasets. ([source](https://github.com/googleapis/python-genai#readme))
- [Code Execution Tools](https://awesome-repositories.com/f/artificial-intelligence-ml/code-execution-tools.md) — Integrates built-in code execution tools for performing mathematical and algorithmic tasks. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [High Volume AI Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/high-volume-ai-processing.md) — Supports high-throughput inference through asynchronous batch predictions and server-side context caching.
- [Hyperparameter Configurations](https://awesome-repositories.com/f/artificial-intelligence-ml/hyperparameter-configurations.md) — Provides tools to manage and tune model hyperparameters like temperature, presence penalty, and frequency penalty. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))
- [Context Caching](https://awesome-repositories.com/f/artificial-intelligence-ml/kv-cache-optimizations/kv-cache-aware-request-routing/context-caching.md) — Implements context caching for prompt and conversation history to improve response speed. ([source](https://googleapis.github.io/python-genai/))
- [Large Language Model Fine-Tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-model-fine-tuning.md) — Enables adaptation of base models through supervised and reinforcement training on custom datasets.
- [Asynchronous Batch Processing](https://awesome-repositories.com/f/artificial-intelligence-ml/large-scale-dataset-processing/asynchronous-batch-processing.md) — Provides high-throughput inference by processing large volumes of requests as asynchronous background jobs.
- [LLM Fine-Tuning Toolsets](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-fine-tuning-toolsets.md) — Provides a toolkit for supervised fine-tuning and parameter-efficient updates of language models.
- [Model Response Streaming](https://awesome-repositories.com/f/artificial-intelligence-ml/model-response-parsers/model-response-aggregation/model-response-streaming.md) — Streams model-generated content incrementally to the client to improve responsiveness. ([source](https://github.com/googleapis/python-genai#readme))
- [Real-time Multimodal Sessions](https://awesome-repositories.com/f/artificial-intelligence-ml/real-time-multimodal-sessions.md) — Establishes low-latency multimodal connections supporting voice activity detection and audio transcription. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))
- [Stateful Agent Orchestration](https://awesome-repositories.com/f/artificial-intelligence-ml/stateful-agent-orchestration.md) — Orchestrates complex, multi-step agent workflows using state-based transitions and tool execution. ([source](https://github.com/googleapis/python-genai#readme))
- [Vector Embeddings](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-embeddings.md) — Provides a library for generating vector representations of text to enable semantic search.
- [Semantic Vector Search](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-embeddings/semantic-vector-search.md) — Converts text into vector embeddings to enable semantic search and grounded data retrieval.

### Part of an Awesome List

- [Model Fine-Tuning](https://awesome-repositories.com/f/awesome-lists/ai/model-training-and-fine-tuning/model-fine-tuning.md) — Enables fine-tuning of base models using custom datasets to optimize performance for specific tasks. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [Supervised Fine-Tuning](https://awesome-repositories.com/f/awesome-lists/ai/model-training-and-fine-tuning/model-fine-tuning/supervised-fine-tuning.md) — Supports adapting base models through supervised training on custom datasets to create specialized model versions. ([source](https://googleapis.github.io/python-genai/))
- [AI Image Processing](https://awesome-repositories.com/f/awesome-lists/media/image-editing-and-processing/ai-image-processing.md) — Provides AI-powered image generation, upscaling, and segmentation with aspect ratio control. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))
- [Agent Frameworks](https://awesome-repositories.com/f/awesome-lists/ai/agent-frameworks.md) — Official SDK for integrating Google generative models into Python applications.

### Data & Databases

- [LLM Schema Outputs](https://awesome-repositories.com/f/data-databases/data-governance-modeling/data-modeling-schemas/data-schemas/schema-validated-data-structures/schema-enforced-output-parsers/llm-schema-outputs.md) — Enforces structured output by constraining model responses to a provided JSON schema. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [Schema-Constrained Outputs](https://awesome-repositories.com/f/data-databases/json-schema-modeling/schema-validators/llm-json-constraints/schema-constrained-outputs.md) — Forces model responses to conform to specific machine-readable structures using JSON schemas.
- [Multimodal Search](https://awesome-repositories.com/f/data-databases/semantic-search/multimodal-search.md) — Performs multimodal search across uploaded files and documents to provide grounded responses. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))
- [Content Caching Controls](https://awesome-repositories.com/f/data-databases/content-caching-controls.md) — Controls the storage and expiration of cached content to optimize performance and operational cost. ([source](https://github.com/googleapis/python-genai#readme))
- [Server-Side Context Caches](https://awesome-repositories.com/f/data-databases/data-caching/client-side-state-caches/server-side-context-caches.md) — Stores large inputs and system instructions on the server to reduce latency and token costs.
- [Input Caches](https://awesome-repositories.com/f/data-databases/data-caching/input-caches.md) — Caches large inputs and system instructions to reduce latency and token costs. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [Batch Processing Jobs](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/batch-processing-systems/batch-processing-utilities/cloud-batch-processing/cluster-batch-processing/kubernetes-batch-jobs/batch-processing-jobs.md) — Implements batch processing jobs for handling large volumes of requests with configurable dataset inputs and outputs. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))
- [Web Search Grounding](https://awesome-repositories.com/f/data-databases/data-synchronization/real-time/ai-grounding-services/business-context-grounding/web-search-grounding.md) — Grounds model responses using real-time web search results to ensure factual accuracy. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))
- [Uploaded File Management](https://awesome-repositories.com/f/data-databases/uploaded-file-management.md) — Manages the lifecycle of media files and documents uploaded for use in model prompts. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))

### Development Tools & Productivity

- [JSON Output Constraints](https://awesome-repositories.com/f/development-tools-productivity/json-output-constraints.md) — Enforces a specific schema for generated responses to ensure the output is machine-readable. ([source](https://github.com/googleapis/python-genai#readme))
- [LLM Client Libraries](https://awesome-repositories.com/f/development-tools-productivity/sdk-integrations/python-sdks/llm-client-libraries.md) — Ships as a comprehensive Python SDK for programmatic integration with large language models.

### Graphics & Multimedia

- [Generative Video Editing](https://awesome-repositories.com/f/graphics-multimedia/ai-video-editing-automation/generative-video-editing.md) — Implements generative video editing, including frame interpolation and clip extension. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))
- [Multimodal Content Generation](https://awesome-repositories.com/f/graphics-multimedia/multimodal-content-generation.md) — Produces and edits a wide range of media types including text, images, audio, and video. ([source](https://github.com/googleapis/python-genai#readme))

### Software Engineering & Architecture

- [LLM Orchestration](https://awesome-repositories.com/f/software-engineering-architecture/api-workflow-automation/llm-orchestration.md) — Orchestrates complex model interactions including stateful chat sessions, tool calling, and structured output enforcement.
- [Tool-Call Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/request-dispatchers/hybrid-tool-dispatching/tool-call-dispatchers.md) — Maps model-generated function requests to executable Python functions or external servers.

### Security & Cryptography

- [AI Content Safety Filtering](https://awesome-repositories.com/f/security-cryptography/data-validation-and-sanitization/ai-content-safety-filtering.md) — Filters and sanitizes AI inputs and outputs to ensure safety and policy compliance. ([source](https://github.com/googleapis/python-genai/blob/main/CHANGELOG.md))

### System Administration & Monitoring

- [Token Count Calculation](https://awesome-repositories.com/f/system-administration-monitoring/usage-monitoring/token-usage-analytics/token-cost-calculators/token-count-calculation.md) — Calculates the number of tokens in a prompt using remote APIs or local tokenizers. ([source](https://github.com/googleapis/python-genai/blob/main/README.md))

### Web Development

- [Incremental Response Streaming](https://awesome-repositories.com/f/web-development/incremental-response-streaming.md) — Delivers model-generated content and function arguments to clients in real-time via incremental streaming.
