Skip to content

feat: add configurable rerank timeout (rerankTimeoutMs)#371

Open
ggzeng wants to merge 1 commit intoCortexReach:masterfrom
ggzeng:feat/rerank-timeout-config
Open

feat: add configurable rerank timeout (rerankTimeoutMs)#371
ggzeng wants to merge 1 commit intoCortexReach:masterfrom
ggzeng:feat/rerank-timeout-config

Conversation

@ggzeng
Copy link

@ggzeng ggzeng commented Mar 26, 2026

Summary

The cross-encoder rerank request timeout was hardcoded at 5 seconds, which is too aggressive for self-hosted rerank services (e.g. HuggingFace TEI via Infinity) that may need 6-7 seconds to respond.

Changes

  • Add rerankTimeoutMs optional field to RetrievalConfig interface
  • Replace hardcoded 5000 with config.rerankTimeoutMs ?? 10_000
  • Default raised from 5s to 10s for better compatibility with self-hosted endpoints

Usage

{
  "retrieval": {
    "rerank": "cross-encoder",
    "rerankTimeoutMs": 20000
  }
}

Backwards Compatibility

Fully backwards compatible. Existing configs without rerankTimeoutMs will get the new 10s default.

The cross-encoder rerank request timeout was hardcoded at 5 seconds,
which is too aggressive for self-hosted rerank services that may need
6-7 seconds to respond. This adds a  option to
RetrievalConfig and raises the default to 10 seconds.

- Add  field to RetrievalConfig interface
- Use  instead of hardcoded 5000
- Backwards compatible: existing configs without the field get 10s default
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