Skip to content

feat(api): attribute remote reranker calls by bank#2740

Open
Jordan-Jarvis wants to merge 5 commits into
vectorize-io:mainfrom
Jordan-Jarvis:upstream/feat-reranker-bank-attribution-20260716
Open

feat(api): attribute remote reranker calls by bank#2740
Jordan-Jarvis wants to merge 5 commits into
vectorize-io:mainfrom
Jordan-Jarvis:upstream/feat-reranker-bank-attribution-20260716

Conversation

@Jordan-Jarvis

@Jordan-Jarvis Jordan-Jarvis commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add opt-in HINDSIGHT_API_RERANKER_SEND_BANK_AS_HEADER configuration
  • emit the fixed X-Hindsight-Bank-Id header from Hindsight's existing current-bank context
  • cover TEI, Cohere-compatible HTTP, LiteLLM proxy, and LiteLLM SDK reranker transports
  • keep local rerankers unchanged and omit attribution when disabled or no non-empty bank is bound
  • require LiteLLM's documented typed RerankResponse instead of accepting guessed legacy response shapes

This resolves #2729. The setting remains disabled by default, and the documentation explicitly limits bank attribution to trusted endpoints because enabling it transmits the current bank ID.

The generic Reflect context correction discovered during qualification is submitted independently as #2764 so it can merge without waiting for the reranker feature. This branch currently contains the same correction; once #2764 lands, GitHub will exclude the identical change from this PR's effective diff.

Validation

  • Ruff format/check passed for all changed Python files
  • 66 focused attribution/Cohere/LiteLLM/TEI tests passed; 6 network benchmarks skipped
  • 35 hierarchical-config and reranker-timeout tests passed
  • 7 embed env-template tests passed
  • ty check --ignore unresolved-import passed for the changed runtime modules (the repository's optional MLX imports are unavailable on this Linux environment)

…ibution-20260716' into upstream/feat-reranker-bank-attribution-20260716
@Jordan-Jarvis

Copy link
Copy Markdown
Contributor Author

Updated the branch to current upstream main while preserving the complete reranker bank-attribution stack, including the Reflect bank-binding commit.

Validation on the updated head:

  • focused Ruff check and format check: passed
  • focused bank attribution and reranker suite: 65 passed, 6 environment-dependent tests skipped

@Jordan-Jarvis

Copy link
Copy Markdown
Contributor Author

@benfrank241 @dcbouius could one of you review this bank-attribution fix? The current head is clean, mergeable, and green, and focused bank/reranker coverage passes. This is required so remote reranker provider usage is attributed through the canonical bank boundary rather than losing tenant ownership.

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.

feat(api): opt-in per-bank attribution for remote reranker requests

1 participant