Issue #18: LightRAG option parity (embedding token limit, dimensions gate, Cohere rerank chunking)#19
Merged
joonsoome merged 2 commits intoFeb 10, 2026
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.
LightRAG recently added new embedding/rerank options via env vars. embed-rerank previously ignored or didn’t correctly apply these options, which could break LightRAG compatibility. This PR adds env parity and wires the options into the OpenAI embeddings and Cohere rerank flows while keeping default behavior unchanged when options are unset.
What Changed
EMBEDDING_TOKEN_LIMIT->default_max_tokens_override(alias ofDEFAULT_MAX_TOKENS_OVERRIDE)EMBEDDING_SEND_DIM->embedding_send_dim(gate for honoring OpenAIdimensions)RERANK_ENABLE_CHUNKING->rerank_enable_chunkingRERANK_MAX_TOKENS_PER_DOC->rerank_max_tokens_per_doc(min 1, default 4096)/v1/embeddingsnow forwardsmax_tokens_per_textto internalEmbedRequest.max_tokens_overrideOverrides are clamped to absolute max (warn + clamp; no error)
dimensionspad/truncate is now gated byEMBEDDING_SEND_DIM(default: enabled, preserving current behavior)max), deterministic sort (score desc, index asc)top_nis applied after aggregation (document-level semantics)MAX_PASSAGES_PER_RERANK, return 400 with guidance.env.exampleand README.md with the new LightRAG parity optionsBackward Compatibility
dimensionsbehavior remains enabled by default (same as before).Tests