fix(cli): add google/ publisher prefix normalization for Vertex AI - #658
Closed
hashbender wants to merge 1 commit into
Closed
fix(cli): add google/ publisher prefix normalization for Vertex AI#658hashbender wants to merge 1 commit into
hashbender wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a dedicated normalization handler for the
vertexprovider innormalize_model_for_provider(). Vertex AI endpoints require model IDs in thegoogle/MODEL_NAMEformat (e.g.google/gemini-3.1-flash-lite), but bare names likegemini-3.1-flash-litewere passed through unchanged, causing HTTP 400INVALID_ARGUMENTerrors from the Vertex API.Related Issue
Fixes NousResearch#56778
Type of Change
Changes Made
hermes_cli/model_normalize.py: Added avertexprovider block that prependsgoogle/to bare model names, preserves names already carrying thegoogle/prefix, and strips a matchingvertex/prefix before addinggoogle/. Added two docstring examples.tests/hermes_cli/test_vertex_provider.py: AddedTestVertexModelNormalizationclass with 4 test methods covering bare names, already-prefixed names,vertex/prefix stripping, and empty input.How to Test
Run the new normalization tests:
python -m pytest tests/hermes_cli/test_vertex_provider.py -q -k "TestVertexModelNormalization"All 7 parametrized cases should pass.
Run the full vertex provider test suite to check for regressions:
All 29 tests should pass.
Verify normalization behavior interactively:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — docstring examples addedcli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AMirror-of: NousResearch#56805
NousResearch#56805