finds.dev

googleapis/python-genai

Google Gen AI Python SDK provides an interface for developers to integrate Google's generative models into their Python applications.

View on GitHubHomepage ↗

★ 4,049PythonApache-2.0updated Oct 2026

// the take

Google's official Python SDK for Gemini, unifying the consumer-facing Gemini Developer API and the enterprise Vertex AI-based platform (now rebranded 'Gemini Enterprise Agent Platform') behind one client. For anyone building on Gemini from Python, whether you're hitting it with a plain API key or need GCP-backed auth and enterprise features.

One client surface for both backends — swap `enterprise=True` and the same `generate_content`/`chat`/`embed_content` calls work against either API. The async client (`client.aio`) mirrors every sync method 1:1, and both sync/async variants ship context managers that actually close the underlying httpx connections, fixing a real resource-leak bug rather than leaving cleanup to callers. Automatic function calling works straight off a typed Python function's signature and docstring, with a documented escape hatch to disable it and drive the function-call loop manually. Structured output accepts either raw JSON Schema or a Pydantic model's `model_json_schema()` interchangeably for `response_json_schema`.

The README itself warns of a near-term major version that removes or renames methods you may already depend on (`Live.send`, `Live.start_stream`, the `prompt`/`text`/`image` args on `generate_videos`, `GenerationConfigThinkingConfig`) — pin below 3.0.0 or plan for a migration. It defaults to the beta API endpoint rather than the stable `v1`; you have to opt in explicitly to get production-stable behavior, which is an easy thing to miss. MCP tool support is explicitly labeled experimental, so treat it as unstable for anything beyond prototyping. The SDK also rides Google's own platform naming churn — Vertex AI was renamed mid-stream to 'Gemini Enterprise Agent Platform,' and the large `_gaos` module tree suggests a second, separately-generated SDK bolted on for that platform's agent APIs, adding surface area most `generate_content` users will never touch but still have to carry.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
4,049
Forks
1,051
Language
Python
License
Apache-2.0
Last commit
29 Oct 2026

// nearby

If python-genai isn't quite it.

All repos →