Repository navigation
fix: read EMBEDDING_API_BASE/KEY/DIMS in context_enhancer and bulk_wiki_ingest - #43
Open
johnkattenhorn wants to merge 1 commit into
Open
johnkattenhorn wants to merge 1 commit into
johnkattenhorn wants to merge 1 commit into
Conversation
…ki_ingest The worker (docker/worker/services/embedding.py) already reads EMBEDDING_API_BASE, EMBEDDING_API_KEY and EMBEDDING_DIMS, but query-time recall (context_enhancer.embed_query) and bulk_wiki_ingest still call openrouter.ai directly. With a non-OpenRouter backend, ingestion embeds with one model and recall cannot embed at all, so recall falls back to lexical search. Defaults are unchanged: OpenRouter, OPENROUTER_API_KEY, 4096 dims.
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.
Checklist
.env.example)python3 -m py_compilepasses (no new files; both changed files compile)setup/orlayers/(no doc change needed:.env.example,setup/install.mdandlayers/05-qdrant.mdalready describe these variables)Description
The worker (
docker/worker/services/embedding.py) already readsEMBEDDING_API_BASE,EMBEDDING_API_KEYandEMBEDDING_DIMS(#3, #7, #30). Two scripts still callhttps://openrouter.ai/api/v1/embeddingsdirectly:scripts/context_enhancer.py(embed_query, used for recall at query time)scripts/bulk_wiki_ingest.pyWith a non-OpenRouter embedding backend, ingestion embeds with one model and recall cannot embed at all, so recall silently falls back to lexical search.
This PR makes both scripts use the same settings as the worker. Defaults are unchanged: OpenRouter,
OPENROUTER_API_KEYand 4096 dims. It also stopsbulk_wiki_ingest.pyfrom printing the first 20 characters of the API key; it prints the backend URL, model and dimensions instead.We run this change in production against an OpenAI-compatible LiteLLM proxy.
Draft #35 covers the same gap in
context_enhancer.pyas part of a larger change (timeouts, retries, degraded-recall warnings). This PR is the minimal fix, and it also coversbulk_wiki_ingest.py. Close this one if you prefer to land #35.Type
Related issues
Follows #3, #7 and #30.