Skip to content

fix(cli): add google/ publisher prefix normalization for Vertex AI - #658

Closed
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-56805
Closed

fix(cli): add google/ publisher prefix normalization for Vertex AI#658
hashbender wants to merge 1 commit into
mainfrom
mirror/pr-56805

Conversation

@hashbender

Copy link
Copy Markdown
Owner

What does this PR do?

Adds a dedicated normalization handler for the vertex provider in normalize_model_for_provider(). Vertex AI endpoints require model IDs in the google/MODEL_NAME format (e.g. google/gemini-3.1-flash-lite), but bare names like gemini-3.1-flash-lite were passed through unchanged, causing HTTP 400 INVALID_ARGUMENT errors from the Vertex API.

Related Issue

Fixes NousResearch#56778

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/model_normalize.py: Added a vertex provider block that prepends google/ to bare model names, preserves names already carrying the google/ prefix, and strips a matching vertex/ prefix before adding google/. Added two docstring examples.
  • tests/hermes_cli/test_vertex_provider.py: Added TestVertexModelNormalization class with 4 test methods covering bare names, already-prefixed names, vertex/ prefix stripping, and empty input.

How to Test

  1. Run the new normalization tests:

    python -m pytest tests/hermes_cli/test_vertex_provider.py -q -k "TestVertexModelNormalization"

    All 7 parametrized cases should pass.

  2. Run the full vertex provider test suite to check for regressions:

    python -m pytest tests/hermes_cli/test_vertex_provider.py -q

    All 29 tests should pass.

  3. Verify normalization behavior interactively:

    from hermes_cli.model_normalize import normalize_model_for_provider
    assert normalize_model_for_provider("gemini-3.1-flash-lite", "vertex") == "google/gemini-3.1-flash-lite"
    assert normalize_model_for_provider("google/gemini-2.5-pro", "vertex") == "google/gemini-2.5-pro"

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS (Python 3.12)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — docstring examples added
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — pure string normalization, no platform-specific code
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Mirror-of: NousResearch#56805
NousResearch#56805

@hashbender hashbender closed this Jul 2, 2026
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.

bug(providers): Vertex AI provider fails with HTTP 400 due to missing mandatory 'google/' publisher prefix

1 participant