Skip to content
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

[FEAT]: Support Ktransformers as LLM #3363

Open
WaterYue opened this issue Feb 27, 2025 · 7 comments
Open

[FEAT]: Support Ktransformers as LLM #3363

WaterYue opened this issue Feb 27, 2025 · 7 comments
Labels
enhancement New feature or request feature request Integration Request Request for support of a new LLM, Embedder, or Vector database

Comments

@WaterYue
Copy link

What would you like to see?

When will AnythingLLmm support ktransformers, the ktransformers can let the AI use less hardware to complete high quantity answers!!!

Here is the link:
https://github.com/kvcache-ai/ktransformers

@WaterYue WaterYue added enhancement New feature or request feature request labels Feb 27, 2025
@timothycarambat
Copy link
Member

If this is just another inference service that is OpenAI Compatible, you can just use the base URL and connection information in the Generic OpenAI Connector for the LLM and it will work the same.

@timothycarambat timothycarambat added the Integration Request Request for support of a new LLM, Embedder, or Vector database label Feb 27, 2025
@jiazhen-code
Copy link

I am currently trying to run KTransformer (Deepseek-R1) + Generic OpenAI Connector with AnythingLLM on an Apple M1 computer. While the server shows normal responses, the client keeps getting stuck at the last returned character until I manually click the pause button, after which the final character is displayed.

@timothycarambat
Copy link
Member

Sounds like KTransformers does not return a stop reason - thus why the connection stream does not close. Can you confirm if the last chunk from KTransformer returns a stop reason?

@jiazhen-code
Copy link

Image

There is a stop reason like this.

@jiazhen-code
Copy link

I'm sure it's because there is no finish_reason in the last chunk. I simply fix it by adding the reason in the last chunk as follows (in ktransformers/server/schemas/assistants/streaming.py):

Image

@zhugh2333
Copy link

does it work?

@timothycarambat timothycarambat changed the title [FEAT]: When will AnythingLLM support Ktransformers [FEAT]: Support Ktransformers as LLM Mar 3, 2025
@timothycarambat
Copy link
Member

That should work finish_reason is different from [DONE]. [DONE] is for Server side event streaming completion while finish_reason is for response streaming conclusion.

if (
message?.hasOwnProperty("finish_reason") && // Got valid message and it is an object with finish_reason
message.finish_reason !== "" &&
message.finish_reason !== null
) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request Integration Request Request for support of a new LLM, Embedder, or Vector database
Projects
None yet
Development

No branches or pull requests

4 participants