-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Add Xinference implementation #1179 #25
Conversation
@alvinlee518 Hi! Thank you for your contribution. Will review it asap. BTW, it looks like XInference support docker container. Would it possible to use testcontainers in IT? |
BTW, could you make all static method call by using And, could you please add tests about |
Okay, got it. |
It's a bit tricky for me to test the docker container locally, but I can try adding it. |
2. use import static to call all static methods
Xinference model
enhance unit tests
@Martin7-1 The Xinferenrece testcontainers require GPU support. How can I configure it in GitHub Actions to ensure the unit tests pass? |
Since we're using the free tier, Github Actions do not support GPU... Are there any ways that Xinference can run on CPU (such as If the test takes too long to run with CPU, maybe I'll consider disabling Xinference's IT in Github Actions and just running it locally. Xinference's ITs are like Ollama's ITs in that they both take a long time to execute tests, and I'm also thinking about and trying to figure out how to optimise them and get them working perfectly in Github Actions. You can try the ideas I suggested above, but if it doesn't work that's fine, I'd run those test cases locally. I think I will review it next week :) |
@Martin7-1 I have modified the image to the CPU version. When executed in GitHub Actions, the entire process takes approximately 10 minutes. |
Thank you! Will try to review it this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alvinlee518 Thank you!
...xinference/src/main/java/dev/langchain4j/community/model/xinference/XinferenceChatModel.java
Outdated
Show resolved
Hide resolved
...xinference/src/main/java/dev/langchain4j/community/model/xinference/XinferenceChatModel.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/dev/langchain4j/community/model/xinference/XinferenceStreamingChatModel.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/dev/langchain4j/community/model/xinference/XinferenceStreamingChatModel.java
Outdated
Show resolved
Hide resolved
...e/src/main/java/dev/langchain4j/community/model/xinference/XinferenceStreamingChatModel.java
Outdated
Show resolved
Hide resolved
...c/main/java/dev/langchain4j/community/model/xinference/XinferenceStreamingLanguageModel.java
Outdated
Show resolved
Hide resolved
...c/main/java/dev/langchain4j/community/model/xinference/XinferenceStreamingLanguageModel.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alvinlee518 Thank you! About IT: maybe we should give up comitting new image, because so much images will exceed Github Actions disk space limit. WDYT?
...c/main/java/dev/langchain4j/community/model/xinference/client/RequestLoggingInterceptor.java
Show resolved
Hide resolved
.../main/java/dev/langchain4j/community/model/xinference/client/ResponseLoggingInterceptor.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Would you mind removing all final
in method level if it's not really needed?
...rence/src/main/java/dev/langchain4j/community/model/xinference/InternalXinferenceHelper.java
Outdated
Show resolved
Hide resolved
...rence/src/main/java/dev/langchain4j/community/model/xinference/InternalXinferenceHelper.java
Outdated
Show resolved
Hide resolved
...rence/src/main/java/dev/langchain4j/community/model/xinference/InternalXinferenceHelper.java
Outdated
Show resolved
Hide resolved
...xinference/src/main/java/dev/langchain4j/community/model/xinference/XinferenceChatModel.java
Outdated
Show resolved
Hide resolved
...xinference/src/main/java/dev/langchain4j/community/model/xinference/XinferenceChatModel.java
Outdated
Show resolved
Hide resolved
...xinference/src/main/java/dev/langchain4j/community/model/xinference/XinferenceChatModel.java
Outdated
Show resolved
Hide resolved
...xinference/src/main/java/dev/langchain4j/community/model/xinference/XinferenceChatModel.java
Outdated
Show resolved
Hide resolved
|
2.remove final on local variable and parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alvinlee518 Thank you! LGTM. Could you please add docs in langchain4j main repo?
Okay, I'll add it later. |
> ## Issue > Closes [langchain4j-community #25](langchain4j/langchain4j-community#25) > > ## Change > Add `langchain4j-community-xinference` document. > > ## General checklist > * [x] There are no breaking changes > * [ ] I have added unit and integration tests for my change > * [ ] I have manually run all the unit and integration tests in the module I have added/changed, and they are all green > * [ ] I have manually run all the unit and integration tests in the [core](https://github.com/langchain4j/langchain4j/tree/main/langchain4j-core) and [main](https://github.com/langchain4j/langchain4j/tree/main/langchain4j) modules, and they are all green > > * [x] I have added/updated the [documentation](https://github.com/langchain4j/langchain4j/tree/main/docs/docs) > * [ ] I have added an example in the [examples repo](https://github.com/langchain4j/langchain4j-examples) (only for "big" features) > * [ ] I have added/updated [Spring Boot starter(s)](https://github.com/langchain4j/langchain4j-spring) (if applicable) Co-authored-by: lixw <>
Issue
Contributes to langchain4j/langchain4j#1179
Change
Support for Xorbits Inference.
General checklist
Checklist for adding new maven module