feat(examples): make LLM and vision model names configurable via env vars#231
Open
zhangzhenfei wants to merge 1 commit intoHKUDS:mainfrom
Open
feat(examples): make LLM and vision model names configurable via env vars#231zhangzhenfei wants to merge 1 commit intoHKUDS:mainfrom
zhangzhenfei wants to merge 1 commit intoHKUDS:mainfrom
Conversation
Collaborator
|
Thanks for your contribution! I did find one P1 blocker.
|
- Read LLM_MODEL, VISION_MODEL, EMBEDDING_MODEL, EMBEDDING_DIM, PARSER from environment variables in example_knowledge_qa.py and examples/raganything_example.py (defaults preserved) - Document new variables in env.example - Fix --query path raising ValueError: call _ensure_lightrag_initialized() in initialize_rag() so LightRAG is loaded from WORKING_DIR before aquery()
4a5a5a4 to
fd7bec9
Compare
Author
|
Thanks for the review! The P1 blocker has been fixed — |
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
Currently, LLM and vision model names (
gpt-4o-mini,gpt-4o) are hardcoded in example scripts. Users who rely on OpenAI-compatible providers (e.g. Azure, local inference servers, third-party proxies) must edit the Python source to change models — whileEMBEDDING_MODELandEMBEDDING_DIMare already read from environment variables.This PR brings LLM/vision model configuration in line with the existing embedding pattern.
Changes
example_knowledge_qa.py: readLLM_MODEL,VISION_MODEL,EMBEDDING_MODEL,EMBEDDING_DIMfrom env (defaults preserved:gpt-4o-mini,gpt-4o,text-embedding-3-large,3072)examples/raganything_example.py: readLLM_MODEL,VISION_MODELfrom env (same defaults)env.example: document the newVISION_MODELvariable alongsideLLM_MODELUsage after this change
Users can now switch models without touching code:
Test plan
examples/lmstudio_integration_example.pyalready uses this pattern — confirm consistency