feat: add v2 BYOK OpenAI-compatible LLM credentials#217
Merged
Conversation
Allow users to pass text and vision provider configs on v2 job create and retrieval so KNOWHERE can drive parsing and agentic retrieval with caller-supplied OpenAI-compatible keys, models, and endpoints. Co-authored-by: Cursor <cursoragent@cursor.com>
Return early when gevent is unavailable so CodeQL no longer flags a bare ImportError pass in the BYOK override root lookup. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 15, 2026
Text-only or vision-only llm_config no longer cross-fills the other channel, so text models cannot break VLM calls (and vice versa). Co-authored-by: Cursor <cursoragent@cursor.com>
One shared provider slot covers both text and vision; text/vision still override per channel when set. Co-authored-by: Cursor <cursoragent@cursor.com>
Use flat api_key/model/base_url for multimodal BYOK; keep text/vision as full channel replacements for different provider endpoints. Co-authored-by: Cursor <cursoragent@cursor.com>
Allow shared api_key/base_url with models.text / models.vision when only the model id differs between channels. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
llm_config(OpenAI-compatible credentials) to v2 only (POST /v2/jobs,POST /v2/retrieval/query); v1 is unchanged.original_requestsnapshots; raw keys stay in job metadata for the worker only (MVP plaintext-at-rest).Usage
Semantics
{api_key, model, base_url}→ both text and visionmodels.{text,vision}→ same endpoint, different model ids (sharedapi_key/base_url)text/visionobjects → fully replace that channel (different endpoints / keys)One multimodal model
{ "llm_config": { "api_key": "sk-...", "model": "gpt-4o", "base_url": "https://api.openai.com/v1" } }Same endpoint, different models
{ "llm_config": { "api_key": "sk-...", "base_url": "https://api.openai.com/v1", "models": { "text": "gpt-4o-mini", "vision": "gpt-4o" } } }Two different provider endpoints
{ "llm_config": { "text": { "api_key": "sk-...", "model": "gpt-4o-mini", "base_url": "https://api.openai.com/v1" }, "vision": { "api_key": "sk-ali-...", "model": "qwen-vl-max", "base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1" } } }Node SDK
Companion PRs
Test plan
make check(ruff + pyright)pytest packages/shared-python/shared/tests/test_llm_config.pyllm_configapplies to both channelsmodelsmap uses shared auth with different model idstext+visionuses different endpointsllm_config