Skip to content

fix(rerankers): send the Nvidia reranker base URL as "baseURL" - #610

Open
dudanogueira wants to merge 1 commit into
mainfrom
fix/nvidia-reranker-baseurl
Open

fix(rerankers): send the Nvidia reranker base URL as "baseURL"#610
dudanogueira wants to merge 1 commit into
mainfrom
fix/nvidia-reranker-baseurl

Conversation

@dudanogueira

Copy link
Copy Markdown

Motivation

NvidiaReranker sends the base URL as baseUrl. The reranker-nvidia module reads baseURL. The value is stored in the schema and then ignored, so reranking silently goes to the default NVIDIA endpoint instead of the configured one — no error, just the wrong endpoint.

Note that #607 originally claimed the opposite — that 28 classes used the wrong key and NvidiaReranker was the correct example. That was wrong; the issue has been rewritten with the evidence. The 28 baseURL classes are correct, and this is the only broken one.

Why baseURL is canonical

Modules read the key through a plain case-sensitive map lookup (usecases/modulecomponents/settings/class_settings_property_helper.go), and every module passes "baseURL" — including reranker-nvidia:

// modules/reranker-nvidia/config/class_settings.go
return cs.propertyValuesHelper.GetPropertyAsString(cs.cfg, "baseURL", DefaultBaseURL)

text2vec-weaviate even declares an explicit migration away from the lowercase spelling: {Name: "baseUrl", NewName: "baseURL"}. And this repo's own history already normalised in that direction once — 657865ab moved Text2VecVoyageAiVectorizer from baseUrl to baseURL.

Empirical confirmation

Not taken on faith from the source. Weaviate 1.39.0 with reranker-nvidia enabled and the base URL pointed at a stub reranker; two collections identical but for the key spelling:

baseURL  ->  stub receives POST /v1/retrieval/nvidia/reranking
             query returns the stub's scores: [{"score":2},{"score":1}]

baseUrl  ->  stub receives nothing
             "client rank: connection to NVIDIA API failed with status: 401"

The 401 is the module falling back to the real endpoint — the configured URL never reached it.

Approach

@SerializedName(value = "baseURL", alternate = {"baseUrl"}).

The alternate matters for upgrades: collections created by earlier versions of this client have the URL stored under baseUrl, and Gson drops unknown keys silently. Without it, upgrading would turn a value that was wrong-but-present into one that is missing. Gson only ever writes value, so new configs use the canonical key. The construct is already used in this repo (UserType, TenantStatus), though this is its first use on a record component.

Testing

  • NvidiaRerankerTest — a legacy baseUrl document still deserializes; serialization emits baseURL and never baseUrl.
  • A JSONTest row for reranker-nvidia. It had none, which is how this slipped through — the modules with a base-url row all had the right key.

Locally green: 386 unit tests.

What this does not cover

No integration test exercises a real provider module (the container enables only the dummy generative/reranker), so the end-to-end proof is the stub probe above rather than something CI re-runs. Wiring a stub-backed module into the IT suite would be a reasonable follow-up.

Separately worth reporting upstream, not fixed here: text2vec-cohere and text2vec-nvidia inject their default config under "baseUrl" (config.go) while their readers look for "baseURL". Harmless — the reader's own fallback is the same value — but it is what made the original report look correct.

Closes #607

🤖 Generated with Claude Code

https://claude.ai/code/session_01WmY5dAGWCccWDoqkKNC2JU

reranker-nvidia looks the key up verbatim, so the "baseUrl" spelling was
stored in the schema and then ignored: reranking silently went to the
default NVIDIA endpoint instead of the configured one.

Verified against Weaviate 1.39.0 with a stub reranker endpoint. Two
collections identical but for the key spelling:

  baseURL -> the stub is called, the query returns the stub's scores
  baseUrl -> no call to the stub, "connection to NVIDIA API failed
             with status: 401" from the real endpoint

Every other module config in this client already uses "baseURL", which
matches the server: each module reads it through a case-sensitive map
lookup, and text2vec-weaviate goes as far as declaring the migration
{Name: "baseUrl", NewName: "baseURL"}.

The alternate keeps configs written by older versions of this client
readable, so upgrading turns a wrong value into a working one rather
than a missing one.

Closes #607

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmY5dAGWCccWDoqkKNC2JU

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

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.

v6: NvidiaReranker sends "baseUrl"; the module reads "baseURL"

1 participant