chore(llm): using nuitka to provide a binary/perf way for the service#242
Merged
imbajin merged 8 commits intoapache:mainfrom May 21, 2025
Merged
chore(llm): using nuitka to provide a binary/perf way for the service#242imbajin merged 8 commits intoapache:mainfrom
imbajin merged 8 commits intoapache:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new Docker image build process using Nuitka for a binary/embed release along with enhancements to batch text embedding methods across multiple embedding providers.
- Removed threaded processing in favor of a batched embedding API call in build_semantic_index.py
- Added new get_texts_embeddings methods with documentation in embedding provider implementations (qianfan, openai, ollama)
- Updated dependency versions for Ollama in requirements.txt and pyproject.toml, and added a new Dockerfile.nk for the build process
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| hugegraph_llm/operators/index_op/build_semantic_index.py | Removed ThreadPoolExecutor and switched to using batched embedding API |
| hugegraph_llm/models/embeddings/qianfan.py | Added batched embedding method with new docstring |
| hugegraph_llm/models/embeddings/openai.py | Added batched embedding method with comprehensive docstring |
| hugegraph_llm/models/embeddings/ollama.py | Updated API usage for embeddings and added batched embedding method |
| hugegraph_llm/models/embeddings/base.py | Added abstract method for batched embedding to maintain consistency |
| hugegraph-llm/requirements.txt, pyproject.toml | Updated Ollama dependency version |
| docker/Dockerfile.nk | Added new Dockerfile using Nuitka for binary/embed release |
Comments suppressed due to low confidence (3)
hugegraph_llm/models/embeddings/qianfan.py:55
- [nitpick] Consider revising the docstring phrasing for clarity, e.g., changing 'Usage refer:' to 'See:' or 'Usage:' to align with standard documentation practices.
""" Usage refer: https://cloud.baidu.com/doc/WENXINWORKSHOP/s/hlmokk9qn"""
hugegraph_llm/operators/index_op/build_semantic_index.py:40
- The change from using ThreadPoolExecutor to a direct batched API call assumes that get_texts_embeddings scales well with larger lists. Please verify that this approach performs adequately for high-volume inputs.
embeddings = self.embedding.get_texts_embeddings(vids)
hugegraph_llm/models/embeddings/ollama.py:43
- The update from self.client.embeddings to self.client.embed reflects the new API version. Please ensure that the parameters and expected return structure are fully aligned with the updated Ollama documentation.
return list(self.client.embed(model=self.model, input=text)["embeddings"][0])
Collaborator
Author
imbajin
approved these changes
May 21, 2025
Member
imbajin
left a comment
There was a problem hiding this comment.
better to attach a tree structure for it
merge it & add docs for it later
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.

follow #199 to build a new docker image using Nuitka in Dockerfile.nk
close #200