Fixes the Gemini integration example in the README#2537
Merged
danielaskdd merged 1 commit intoHKUDS:mainfrom Dec 26, 2025
Merged
Fixes the Gemini integration example in the README#2537danielaskdd merged 1 commit intoHKUDS:mainfrom
danielaskdd merged 1 commit intoHKUDS:mainfrom
Conversation
This update fixes several critical issues in the Gemini integration example: 1. Corrected import: Changed from gemini_complete to gemini_model_complete (the correct function name per lightrag/llm/gemini.py) 2. Fixed parameter name: Changed 'model' to 'model_name' in gemini_model_complete() call to match the function signature 3. Added llm_model_name to LightRAG initialization: This is required for gemini_model_complete to retrieve the model name from hashing_kv.global_config 4. Updated to latest model: gemini-1.5-flash → gemini-2.0-flash Without these changes, users get "404 NOT_FOUND" errors as the code defaults to gpt-4o-mini when model_name is not properly configured. Tested and verified working with Gemini 2.0 Flash API.
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.
Description
This update fixes several critical issues in the Gemini integration example:
Corrected import: Changed from
gemini_completetogemini_model_complete(the correct function name per
lightrag/llm/gemini.py)Fixed parameter name: Changed 'model' to 'model_name' in gemini_model_complete() call to match the function signature
Added llm_model_name to LightRAG initialization: This is required for gemini_model_complete to retrieve the model name from hashing_kv.global_config
Updated to latest model: gemini-1.5-flash → gemini-2.0-flash
Without these changes, users get "404 NOT_FOUND" errors as the code defaults to gpt-4o-mini when model_name is not properly configured.
Tested and verified working with Gemini 2.0 Flash API.
Related Issues
Fixes incorrect example code that causes user confusion and setup failures.
This addresses a documentation bug rather than a code functionality issue.
Changes Made
gemini_complete→gemini_model_completemodel=→model_name=in function callllm_model_name="gemini-2.0-flash"to LightRAG initializationgemini-1.5-flash→gemini-2.0-flashFiles Modified
README.md- Gemini integration example sectionChecklist
Additional Notes
Why These Changes Matter
The current example in README doesn't match the actual library implementation.
Looking at
lightrag/llm/gemini.pylines 438-448,gemini_model_complete()requires the model name to be configured via:
hashing_kv.global_config.get("llm_model_name")(checked first)kwargs.pop("model_name", None)(fallback)Without proper configuration, it defaults to
gpt-4o-mini, causing 404 errors.Testing Environment
Reference
Implementation details:
lightrag/llm/gemini.pylines 438-448