Skip to content

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

Closed
huangjeff5 wants to merge 2 commits into
feat/py-openai-compatible-google-cloudfrom
deprecate/py-vertexai-claude
Closed

huangjeff5 wants to merge 2 commits into
feat/py-openai-compatible-google-cloudfrom
deprecate/py-vertexai-claude

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Stack (merge in order): #151 (Anthropic(backend=GoogleCloud())) → #196 (OpenAICompatible) → #197 (OpenAICompatible(backend=GoogleCloud())) → #198 (deprecate genkit-vertexai)

genkit-vertexai is deprecated and will be removed in the next release. Everything in it keeps working in this release, and ModelGarden(...) raises a FutureWarning that names the replacement for Claude.

The package is pinned to the matching genkit minor version, the same treatment genkit-evaluators got. Apps that keep it stay on a working set, and no stale copy can be installed next to a newer genkit.

Stacked on #197 (after #151 and #196). Merge #151, #196, and #197 first: the warning and README point at both replacements.

from genkit_vertexai import ModelGarden

# 1. Still works this release, and warns on the caller's line
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

  • FutureWarning when ModelGarden is constructed. It's raised once, pointing at the caller's line. The message covers the removal, the Claude replacement with an example ref, and the replacement for Llama and the other OpenAI-compatible models.
  • Pinned to this genkit minor version, like genkit-evaluators. genkit-vertexai joins ZERO_X_ONLY_PACKAGES in scripts/check_consistency.py. As a result:
    • Its genkit dependency is >=0.14.0,<0.15.
    • So are genkit[vertexai] and genkit[vertex-ai].
    • bin/bump_version rolls both caps forward each 0.x release (to <0.16 when 0.15 is cut).
    • check_consistency fails a 1.0 release while the package still exists.
  • README: a deprecation banner at the top. It names the replacement for Claude and for Llama/Mistral, and says that upgrading genkit past this release means removing genkit-vertexai first. The "Moving Claude to the Anthropic plugin" section covers:
    • before/after code;
    • how model names map;
    • project/location carrying over, while model_locations doesn't (one Claude location per app; global serves every model).
  • README: a new "Moving Llama and Mistral" section. It shows before/after code with the same modelgarden/... ref, us-central1 as the default location in both plugins, and registering a second OpenAICompatible(name=..., backend=GoogleCloud(location=...)) in place of model_locations.
  • PyPI description starts with "Deprecated, removed in the next release." and names both replacement packages.

Decisions

  • Deprecate the whole package, not just Claude: Both halves of genkit-vertexai now have better homes. Claude goes to genkit-anthropic with typed refs and portable .prompt files. The OpenAI-compatible models go to OpenAICompatible, which is just the generic plugin with Google Cloud auth. That leaves nothing for a separate package under a renamed Vertex brand to do.
  • Warn at construction: Every ModelGarden user is affected now, so warning once, on the user's own line, is the clearest signal. FutureWarning, not DeprecationWarning, because Python hides DeprecationWarning outside __main__ (PEP 565), which would silence it in web servers.
  • Pin to the minor version now, not at removal: When the next release drops the package, nothing gets published to keep genkit-vertexai compatible with newer genkit. Pinning this release to genkit<0.(Y+1) means resolvers keep apps that still list genkit-vertexai on a matched set, instead of pairing an abandoned plugin with a genkit it was never tested against. This is the same reasoning as 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 working set instead of a newer genkit with no plugin.

Verification

  • packages/genkit-vertexai: 55 passed, and the run shows no stray warnings.
    • The construction warning is pinned: its text, and that it points at the caller's file.
    • Claude and Llama still resolve while the package is deprecated.
    • One conftest.py hook filters the expected warning for the rest of the package's tests.
  • tests/version_bounds_guard_test.py: 32 passed.
    • New: bump_version 0.14→0.15 rolls genkit-vertexai's genkit cap and the genkit[vertexai] cap to <0.16, and keeps the genkit-anthropic== pin in step.
    • New: check_consistency rejects genkit-vertexai at 1.0.
    • The synthetic fixture now uses a neutral genkit-model-hub package for the "normal plugin" cases.
  • Repo checks: scripts/check_consistency.py passes and uv lock --check passes.
  • Static checks: ruff passes. pyright, pyrefly and ty report 0 errors on packages/genkit-vertexai.

Breaking changes

None this release. genkit-vertexai behaves the same, plus a warning. The new genkit minor cap only limits which genkit versions it installs next to.

@huangjeff5
huangjeff5 force-pushed the feat/py-openai-compatible-google-cloud branch from 88dd349 to 9a7d5b3 Compare November 30, 2026 21:40
@huangjeff5
huangjeff5 force-pushed the deprecate/py-vertexai-claude branch from 5097754 to a58361c Compare November 30, 2026 21:40
@huangjeff5

Copy link
Copy Markdown
Collaborator Author

Superseded by #260 in a fresh clean stack off latest main (#257 → #258 → #259 → #260 → #261 [Draft]).

@huangjeff5 huangjeff5 closed this Nov 30, 2026
@huangjeff5
huangjeff5 deleted the deprecate/py-vertexai-claude branch November 30, 2026 22:40
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.

1 participant