mattermost-plugin-agents: 🐛 bug: not work with LocalAI backend
Description
The AI-plugin currently does not work with LocalAI backend. It somehow cannot read the response from Localai-api correctly.
LocalAI version: 2.9.0 (latest)
AI Plugin version: 0.6.0 (latest)
Steps to reproduce
Call Localai API:
curl http://{LOCALAI}/v1/chat/completions -H "Content-Type: application/json" -d '{
"messages": [{"role": "user", "content": "hello"}],
"temperature": 0.9,
"stream": true
}'
Response:
data: {"created":1709115341,"object":"chat.completion.chunk","id":"d8073704-b273-4340-a57b-6280a7fece33","choices":[{"index":0,"finish_reason":"","delta":{"role":"assistant","content":""}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
data: {"created":1709115341,"object":"chat.completion.chunk","id":"d8073704-b273-4340-a57b-6280a7fece33","choices":[{"index":0,"finish_reason":"","delta":{"role":"","content":"H"}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
data: {"created":1709115341,"object":"chat.completion.chunk","id":"d8073704-b273-4340-a57b-6280a7fece33","choices":[{"index":0,"finish_reason":"","delta":{"role":"","content":"e"}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
data: {"created":1709115341,"object":"chat.completion.chunk","id":"d8073704-b273-4340-a57b-6280a7fece33","choices":[{"index":0,"finish_reason":"","delta":{"role":"","content":"l"}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
data: {"created":1709115341,"object":"chat.completion.chunk","id":"d8073704-b273-4340-a57b-6280a7fece33","choices":[{"index":0,"finish_reason":"","delta":{"role":"","content":"l"}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
data: {"created":1709115341,"object":"chat.completion.chunk","id":"d8073704-b273-4340-a57b-6280a7fece33","choices":[{"index":0,"finish_reason":"","delta":{"role":"","content":"o"}}],"usage":{"prompt_tokens":0,"completion_tokens":0,"total_tokens":0}}
...
As you can see the response “Hello …” is generated in “content” object, but the plugin does not read it. There is no response in mattermost and also no error log in mattermost Server Logs(System Console).
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (4 by maintainers)
Hi @novo-github, thanks for sharing your error. It looks like the request is reaching your model in Ollama but the model does not support tool usage or function calling. As a result, it’s getting confused by the prompt, which uses some functions to fetch data about the user when the query is made.
At the bottom of the model’s configuration panel, try setting Disable Tools to true and see if that allows the model to respond. Alternatively, you may want to use a local model that is tuned to support function calling.
Same. Can’t get it to work with LocalAI.
Call
Error
@crspeller Thanks for the reply!
I build the LocalAI as binary and run it locally on Macbook Pro M3.
I updated the mattermost-ai-plugin to 0.6.2. which contains major fixes and tested again.
Now there are two types of errors:
part of the LocalAI debug info:
error from mattermost server log:
I hope these information could be helpful.