Skip to content

feat(py): deprecate genkit-vertexai; remove it in the next release - #260

Merged
huangjeff5 merged 1 commit into
feat/py-openai-google-cloudfrom
feat/py-deprecate-vertexai
Dec 1, 2026
Merged

huangjeff5 merged 1 commit into
feat/py-openai-google-cloudfrom
feat/py-deprecate-vertexai

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Stack (merge in order): #257 (Anthropic(backend=GoogleCloud())) → #258 (OpenAICompatible) → #259 (OpenAICompatible(backend=GoogleCloud())) → #260 (deprecate genkit-vertexai)

genkit-vertexai is deprecated and will be removed in the next release. Everything continues to work in this release, and constructing ModelGarden(...) emits a FutureWarning pointing to both replacements:

Following the same deprecation pattern as genkit-evaluators (#131), genkit-vertexai is pinned to the current genkit minor version so apps that keep it don't end up pairing it with a newer genkit release after removal.

from genkit_vertexai import ModelGarden

# 1. Still works in this release, emitting a FutureWarning
ai = Genkit(plugins=[ModelGarden(project='bistro-prod', location='global')])
# => FutureWarning: genkit-vertexai is deprecated and will be removed in the next release.
#    For Claude, use the Anthropic plugin on Google Cloud: uv add 'genkit-anthropic[google-cloud]',
#    then Anthropic(backend=GoogleCloud()) and model=Anthropic.claude('claude-sonnet-5-5')
#    in place of model='modelgarden/anthropic/claude-sonnet-5-5'.
#    For Llama, Mistral and the other OpenAI-compatible models: uv add 'genkit-openai[google-cloud]',
#    then OpenAICompatible(backend=GoogleCloud()); refs stay modelgarden/<publisher>/<model>.

# 2. The replacement for Claude
ai = Genkit(plugins=[Anthropic(backend=GoogleCloud(project='bistro-prod', location='global'))])
await ai.generate(model=Anthropic.claude('claude-sonnet-5-5'), prompt='Suggest a dish.')

# 3. The replacement for Llama and the other open models: same refs
ai = Genkit(plugins=[OpenAICompatible(backend=GoogleCloud(project='bistro-prod', location='us-central1'))])
await ai.generate(model='modelgarden/meta/llama-3.3-70b-instruct-maas', prompt='Suggest a dish.')

Changes

  • Deprecation warning on ModelGarden: Emits a FutureWarning once per construction (with stacklevel pointing at the caller) covering the removal and migration steps for both Claude and OpenAI-compatible models.
  • Minor-version cap (ZERO_X_ONLY_PACKAGES): Adds genkit-vertexai to ZERO_X_ONLY_PACKAGES in scripts/check_consistency.py. Its genkit dependency and the genkit[vertexai] / genkit[vertex-ai] extras are capped at >=0.14.0,<0.15; bin/bump_version advances the cap on future 0.x releases, and check_consistency blocks a 1.0 release while the package still exists.
  • README & PyPI metadata: Adds a deprecation banner and migration sections for Claude (including project/location carryover and why global replaces model_locations) and Llama/Mistral (showing unchanged modelgarden/... refs and multi-instance OpenAICompatible(name=..., ...) in place of model_locations). Prefixes the PyPI description with "Deprecated, removed in the next release." and names both replacement packages.

Decisions

  • Deprecate the entire package: Both model families in genkit-vertexai now live in genkit-anthropic (with typed refs and portable .prompt files) and genkit-openai's OpenAICompatible, leaving no remaining functionality for a standalone Vertex package.
  • Emit FutureWarning at construction: Every ModelGarden user is affected immediately. Using FutureWarning ensures it shows up in web servers and apps outside __main__, where Python suppresses DeprecationWarning by default (PEP 565).
  • Cap the genkit minor version ahead of removal: Once genkit-vertexai is dropped next release, no new version will be published to stay compatible with newer genkit. Capping it at genkit<0.(Y+1) now ensures dependency resolvers keep apps that still declare genkit-vertexai on a compatible genkit minor version (matching genkit-evaluators in revert: restore evaluators for 0.14 #131).

Removal (next release, separate PR)

  • Delete packages/genkit-vertexai, and drop it from the publish and samples workflows.
  • Keep genkit[vertexai] and genkit[vertex-ai] frozen at the last release, and exempt them from bump_version/check_consistency, as revert: restore evaluators for 0.14 #131 did for genkit[evaluators]. That way genkit[vertexai] keeps resolving to a compatible set instead of a newer genkit with no plugin.

Verification

  • Unit tests: packages/genkit-vertexai (55 passed, no stray warnings; verifies the warning text, stacklevel, and continued Claude/Llama resolution) and tests/version_bounds_guard_test.py (32 passed, including 0.14→0.15 minor-cap roll and 1.0 rejection). Full stack suite across genkit-anthropic, genkit-openai, genkit-vertexai, and version_bounds_guard_test.py: 1,648 passed, 5 skipped.
  • Static & repo checks: ruff, ty, pyrefly (0 errors), scripts/check_consistency.py, uv lock --check, and addlicense -check all pass (pyright runs in CI).

Breaking changes

None this release. genkit-vertexai behaves the same, plus a warning. The new genkit minor cap only limits which genkit versions it can be installed alongside.

@pavelgj pavelgj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@huangjeff5
huangjeff5 force-pushed the feat/py-deprecate-vertexai branch from 7f98b20 to 28ec744 Compare December 1, 2026 21:20
@huangjeff5
huangjeff5 force-pushed the feat/py-deprecate-vertexai branch from 28ec744 to f32f88f Compare December 1, 2026 21:37
@huangjeff5
huangjeff5 enabled stacked auto-merge (squash) December 1, 2026 21:52
@huangjeff5
huangjeff5 merged commit 61171d4 into main Dec 1, 2026
21 checks passed
@huangjeff5
huangjeff5 deleted the feat/py-deprecate-vertexai branch December 1, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants