Metadata-Version: 2.5
Name: genkit-vertexai
Version: 0.13.0
Summary: Vertex AI and Model Garden on Genkit
Project-URL: Bug Tracker, https://github.com/genkit-ai/genkit/issues
Project-URL: Changelog, https://github.com/genkit-ai/genkit/releases
Project-URL: Documentation, https://genkit.dev/docs/get-started/?lang=python
Project-URL: Homepage, https://github.com/genkit-ai/genkit
Project-URL: Repository, https://github.com/genkit-ai/genkit/tree/main/py
Author: Google
Author-email: Yesudeep Mangalapilly <yesudeep@google.com>, Elisa Shen <mengqin@google.com>, Niraj Nepal <nnepal@google.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: genkit,model-garden,vertex-ai
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Framework :: AsyncIO
Classifier: Framework :: Pydantic
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: genkit<2,>=0.13.0
Requires-Dist: google-auth[requests]>=2.14.1
Provides-Extra: anthropic
Requires-Dist: genkit-anthropic==0.13.0; extra == 'anthropic'
Provides-Extra: openai
Requires-Dist: genkit-openai==0.13.0; extra == 'openai'
Description-Content-Type: text/markdown

# Genkit Vertex AI Plugin

Integrate Genkit with Google Cloud Vertex AI Model Garden.

> **Building with a coding agent? Install the Genkit Python skill first.**
>
> ```bash
> npx skills add genkit-ai/skills --skill developing-genkit-python
> ```
>
> It teaches your agent the current Genkit Python APIs and common gotchas.
> Source, manual install and skills for other languages:
> [genkit-ai/skills](https://github.com/genkit-ai/skills).

## Installation

Install the extra for the Model Garden publishers you call:

```bash
uv add 'genkit-vertexai[anthropic]'          # Claude
uv add 'genkit-vertexai[openai]'             # Llama, Mistral, and other OpenAI-compatible models
uv add 'genkit-vertexai[anthropic,openai]'   # both
```

The package without an extra serves no models. Calling a model without its
extra raises an error naming the command to run.

## Usage

```python
from genkit import Genkit
from genkit_vertexai import ModelGarden

ai = Genkit(
    plugins=[ModelGarden(project='my-project', location='us-central1')],
)

res = await ai.generate(
    model='modelgarden/anthropic/claude-3-5-sonnet-v2@20241022',
    prompt='Explain recursion in 10 words.',
)
print(res.text)
```

Requires Google Cloud Application Default Credentials (ADC) or explicit credentials.

Every call runs on those Google Cloud credentials. A per-request key in
`context={'secrets': {'api_key': ...}}` fails with `INVALID_ARGUMENT` before
any request is sent, so a tenant's key never runs on the app's account. Other
entries in `context.secrets` are ignored.
