[GH-ISSUE #513] Support Koboldcpp #300

Closed
opened 2026-02-22 18:18:50 -05:00 by yindo · 14 comments
Owner

Originally created by @Botoni on GitHub (Jan 2, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/513

Originally assigned to: @shatfield4 on GitHub.

Hi, could be possible to support koboldcpp? It is faster and loads more models than lm studio and has a better compatibility with linux.

In fact, it connects using the lm studio option and writing the koboldcpp address, but responses on the chat get truncated at the first or second word, in the koboldcpp terminal the response is fully generated.

Originally created by @Botoni on GitHub (Jan 2, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/513 Originally assigned to: @shatfield4 on GitHub. Hi, could be possible to support koboldcpp? It is faster and loads more models than lm studio and has a better compatibility with linux. In fact, it connects using the lm studio option and writing the koboldcpp address, but responses on the chat get truncated at the first or second word, in the koboldcpp terminal the response is fully generated.
yindo added the enhancementfeature request labels 2026-02-22 18:18:50 -05:00
yindo closed this issue 2026-02-22 18:18:50 -05:00
Author
Owner

@Botoni commented on GitHub (Jan 17, 2024):

If it helps the implementation, using the lmstudio config, the koboldcpp terminal gives this response when sending a prompt:

Processing Prompt [BLAS] (509 / 509 tokens) Generating (10 / 100 tokens) (EOS token triggered!) ContextLimit: 519/2048, Processing:11.37s (22.3ms/T), Generation:1.19s (118.9ms/T), Total:12.56s (0.80T/s) Output: Hello! How can I help you today?

@Botoni commented on GitHub (Jan 17, 2024): If it helps the implementation, using the lmstudio config, the koboldcpp terminal gives this response when sending a prompt: `Processing Prompt [BLAS] (509 / 509 tokens) Generating (10 / 100 tokens) (EOS token triggered!) ContextLimit: 519/2048, Processing:11.37s (22.3ms/T), Generation:1.19s (118.9ms/T), Total:12.56s (0.80T/s) Output: Hello! How can I help you today? `
Author
Owner

@intulint commented on GitHub (Apr 3, 2024):

I couldn’t connect to kobaldcpp, I thought support for such a convenient backend would be built in right away
How can I connect?

@intulint commented on GitHub (Apr 3, 2024): I couldn’t connect to kobaldcpp, I thought support for such a convenient backend would be built in right away How can I connect?
Author
Owner

@zacanbot commented on GitHub (Apr 17, 2024):

Koboldcpp says its API is OpenAI compatible. But if I configure LocalAI or LM Studio endpoints to point to Koboldcpp, I get the same truncation experience as the OP. Maybe it is a configuration issue in Koboldcpp?

One motivation I can add for Koboldcpp support, other than it being a really convenient and configurable LLM engine, is that it is the only way to get hardware acceleration for older AMD cards that are not officially supported by ROCm (I have an RX 6600).

@zacanbot commented on GitHub (Apr 17, 2024): Koboldcpp says its API is OpenAI compatible. But if I configure LocalAI or LM Studio endpoints to point to Koboldcpp, I get the same truncation experience as the OP. Maybe it is a configuration issue in Koboldcpp? One motivation I can add for Koboldcpp support, other than it being a really convenient and configurable LLM engine, is that it is the only way to get hardware acceleration for older AMD cards that are not officially supported by ROCm (I have an RX 6600).
Author
Owner

@kenhuang commented on GitHub (Apr 27, 2024):

https://petstore.swagger.io/?url=https://lite.koboldai.net/kobold_api.json

koboldcpp api ref

@kenhuang commented on GitHub (Apr 27, 2024): https://petstore.swagger.io/?url=https://lite.koboldai.net/kobold_api.json koboldcpp api ref
Author
Owner

@timothycarambat commented on GitHub (Apr 27, 2024):

If its OpenAI Compatible, cant the Generic OpenAI connector (last LLM connector) work here?

@timothycarambat commented on GitHub (Apr 27, 2024): If its OpenAI Compatible, cant the Generic OpenAI connector (last LLM connector) work here?
Author
Owner

@zacanbot commented on GitHub (May 2, 2024):

Thank you for adding the Koboldcpp connection options. However, can we re-open the issue? The original truncation issue still persists with the latest version of AnythingLLM using the new Koboldcpp connector:

image

While in the Koboldcpp server logs, I see that the whole message is generated:

...
Input: {"model": "koboldcpp/Meta-Llama-3-8B-Instruct-Q5_K_M", "stream": true, "messages": [{"role": "system", "content": "Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed."}, {"role": "user", "content": "hello"}], "temperature": 0.7}

Processing Prompt [BLAS] (61 / 61 tokens)
Generating (100 / 100 tokens)
CtxLimit: 161/8192, Process:0.01s (0.2ms/T = 4066.67T/s), Generate:2.88s (28.8ms/T = 34.76T/s), Total:2.89s (34.58T/s)
Output: Hello! How can I assist you today? What's on your mind?
...
@zacanbot commented on GitHub (May 2, 2024): Thank you for adding the Koboldcpp connection options. However, can we re-open the issue? The original truncation issue still persists with the latest version of AnythingLLM using the new Koboldcpp connector: ![image](https://github.com/Mintplex-Labs/anything-llm/assets/7732489/ab216675-a5b7-4884-9d08-6a8947993032) While in the Koboldcpp server logs, I see that the whole message is generated: ```text ... Input: {"model": "koboldcpp/Meta-Llama-3-8B-Instruct-Q5_K_M", "stream": true, "messages": [{"role": "system", "content": "Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed."}, {"role": "user", "content": "hello"}], "temperature": 0.7} Processing Prompt [BLAS] (61 / 61 tokens) Generating (100 / 100 tokens) CtxLimit: 161/8192, Process:0.01s (0.2ms/T = 4066.67T/s), Generate:2.88s (28.8ms/T = 34.76T/s), Total:2.89s (34.58T/s) Output: Hello! How can I assist you today? What's on your mind? ... ```
Author
Owner

@timothycarambat commented on GitHub (May 2, 2024):

@shatfield4

@timothycarambat commented on GitHub (May 2, 2024): @shatfield4
Author
Owner

@shatfield4 commented on GitHub (May 2, 2024):

@zacanbot Can you give me any more information on how to replicate this bug? I have downloaded the same Llama3 model you are using and the streaming is working fine for me and showing the entire message inside AnythingLLM. Are you running the latest version of KoboldCPP? Did you change any config settings inside KoboldCPP?

@shatfield4 commented on GitHub (May 2, 2024): @zacanbot Can you give me any more information on how to replicate this bug? I have downloaded the same Llama3 model you are using and the streaming is working fine for me and showing the entire message inside AnythingLLM. Are you running the latest version of KoboldCPP? Did you change any config settings inside KoboldCPP?
Author
Owner

@zacanbot commented on GitHub (May 2, 2024):

I just updated to the latest version (1.64) and it seems to be working correctly now! Thanks for digging into this. Appreciated 👍

@zacanbot commented on GitHub (May 2, 2024): I just updated to the latest version (1.64) and it seems to be working correctly now! Thanks for digging into this. Appreciated 👍
Author
Owner

@intulint commented on GitHub (May 24, 2024):

image
image
For some reason it’s not working for me again, I just downloaded a new version of AnythingLLM.
Kobaldcpp Version 1.65
Doesn't let me select a model, there's an empty window. Apparently something has disappeared again.

@intulint commented on GitHub (May 24, 2024): ![image](https://github.com/Mintplex-Labs/anything-llm/assets/56724224/0916049b-809b-4f06-93bc-83d3d5eb286f) ![image](https://github.com/Mintplex-Labs/anything-llm/assets/56724224/a3687430-e36a-44f5-9795-7425e6883442) For some reason it’s not working for me again, I just downloaded a new version of AnythingLLM. Kobaldcpp Version 1.65 Doesn't let me select a model, there's an empty window. Apparently something has disappeared again.
Author
Owner

@timothycarambat commented on GitHub (May 24, 2024):

Then this likely is because whatever you have put in as the baseURL is not correct. Does http://localhost:5001/v1/models even return data in the browser?

cc @shatfield4

@timothycarambat commented on GitHub (May 24, 2024): Then this likely is because whatever you have put in as the baseURL is not correct. Does http://localhost:5001/v1/models even return data in the browser? cc @shatfield4
Author
Owner

@intulint commented on GitHub (May 25, 2024):

image
image

Yes, the browser opens the link http://localhost:5001/v1/models
I also pull out the value in Python using the API.
Should the base url be "http://localhost:5001/v1"?
This path is written in the tooltip.

@intulint commented on GitHub (May 25, 2024): ![image](https://github.com/Mintplex-Labs/anything-llm/assets/56724224/d6674166-3eee-4e47-9c6f-40685138cada) ![image](https://github.com/Mintplex-Labs/anything-llm/assets/56724224/8d0e6e12-79dc-44bb-b94e-d9597544b98f) Yes, the browser opens the link http://localhost:5001/v1/models I also pull out the value in Python using the API. Should the base url be "http://localhost:5001/v1"? This path is written in the tooltip.
Author
Owner

@Negatrev commented on GitHub (Jun 6, 2024):

image image

Yes, the browser opens the link http://localhost:5001/v1/models I also pull out the value in Python using the API. Should the base url be "http://localhost:5001/v1"? This path is written in the tooltip.

Exact same issue for me. Koboldcpp has a few different api options and none of them are loading with AnythingLLM. But other clients, including koboldai, koboldlite, SillyTavern can all use it without issue.

@Negatrev commented on GitHub (Jun 6, 2024): > ![image](https://private-user-images.githubusercontent.com/56724224/333773011-d6674166-3eee-4e47-9c6f-40685138cada.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc2NjMyMTksIm5iZiI6MTcxNzY2MjkxOSwicGF0aCI6Ii81NjcyNDIyNC8zMzM3NzMwMTEtZDY2NzQxNjYtM2VlZS00ZTQ3LTljNmYtNDA2ODUxMzhjYWRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjA2VDA4MzUxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYzMGYyYWY0ZmY3Yjg3MmEwMWE3ZmRkYjdmNjg5ZmY5OTk3MWVmYzUzYTUzN2JjZGFjMTFjOGVkNGI3YmZlMTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.RAqd5zst2uB_zlr_l2mSueU27DQ2gwh5grBaebaMMSo) ![image](https://private-user-images.githubusercontent.com/56724224/333773229-8d0e6e12-79dc-44bb-b94e-d9597544b98f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc2NjMyMTksIm5iZiI6MTcxNzY2MjkxOSwicGF0aCI6Ii81NjcyNDIyNC8zMzM3NzMyMjktOGQwZTZlMTItNzlkYy00NGJiLWI5NGUtZDk1OTc1NDRiOThmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjA2VDA4MzUxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE2NjIzZjgxNGY2OGQzNjA5YmY1MGQwYTY5YWY4MjJmZDAwZTMyY2U0YjhjYmM3ZGI4YWI4NTc4ZjhhYmM3N2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.SDwItCgtShSBJSvIv8QEzCTKVzB4W7TcCbQbWPfQ4Dw) > > Yes, the browser opens the link http://localhost:5001/v1/models I also pull out the value in Python using the API. Should the base url be "http://localhost:5001/v1"? This path is written in the tooltip. Exact same issue for me. Koboldcpp has a few different api options and none of them are loading with AnythingLLM. But other clients, including koboldai, koboldlite, SillyTavern can all use it without issue.
Author
Owner

@attyru commented on GitHub (Jul 11, 2024):

Exact same issue for me. Koboldcpp has a few different api options and none of them are loading with AnythingLLM. But other clients, including koboldai, koboldlite, SillyTavern can all use it without issue.

У меня получилось обойти эту проблему так: вместо http://localhost:5001/v1 поставил http://127.0.0.1/v1 и все заработало

@attyru commented on GitHub (Jul 11, 2024): > Exact same issue for me. Koboldcpp has a few different api options and none of them are loading with AnythingLLM. But other clients, including koboldai, koboldlite, SillyTavern can all use it without issue. У меня получилось обойти эту проблему так: вместо `http://localhost:5001/v1` поставил `http://127.0.0.1/v1` и все заработало
yindo changed title from Support Koboldcpp to [GH-ISSUE #513] Support Koboldcpp 2026-06-05 14:34:34 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#300