Code Monkey home page Code Monkey logo

Comments (7)

crspeller avatar crspeller commented on June 20, 2024 1

@Twilek-de It works for me if I set the API URL to http://localhost:11434/v1 Maybe just add the /v1?
If that doesn't work for you please post the mattermost server logs and any logs from ollama.

from mattermost-plugin-ai.

crspeller avatar crspeller commented on June 20, 2024

@Twilek-de Just noted Ollama adding OpenAI compatibility: https://ollama.ai/blog/openai-compatibility
Does that work for you?

from mattermost-plugin-ai.

Twilek-de avatar Twilek-de commented on June 20, 2024

Oh good catch. Just fired up Ollama with their latest docker container. OpenAI compatible endpoint works fine when evoking it with curl. With Mattermost AI plugin nothing happens. There is no error message but the ollama container does not ramp up CPU time, as it does when it is running a query. DonΒ΄t know what is happing.

I have checked that Mattermost is really seeing the ollama container in the docker network, it does. My settings look like this.
Screenshot 2024-02-09 085305

Running curl http://ollama:11434/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "llama2","messages": [{"role": "system","content": "You are a helpful assistant."},{"role": "user","content": "Hello!"}]}' inside the mattermost container works just fine, so it is not connectivity.

Mattermost config.json looks like this:

"mattermost-ai": { "config": { "allowPrivateChannels": true, "allowedTeamIds": "chat", "enableLLMTrace": false, "enableUserRestrictions": false, "imageGeneratorBackend": "Ollama", "llmBackend": "Ollama", "onlyUsersOnTeam": "", "services": [ { "apiKey": "", "defaultModel": "llama2", "id": "j5dr1bnste", "name": "Ollama", "password": "", "serviceName": "openaicompatible", "url": "http://ollama:11434", "username": "" } ], "transcriptBackend": "Ollama" } },

from mattermost-plugin-ai.

Twilek-de avatar Twilek-de commented on June 20, 2024

Hmm Ollama supports a subset of the OpenAI API, namely completion. There is no support for streaming yet and I seem to remember that the MM AI Plugin uses the streaming endpoint....

Update:
Scratch that, the Ollama docu says streaming is supported as well...

from mattermost-plugin-ai.

Twilek-de avatar Twilek-de commented on June 20, 2024

Yes! That was it. Works now for me too. Thanks!

from mattermost-plugin-ai.

Twilek-de avatar Twilek-de commented on June 20, 2024

Hmm somehow the new version does time out. Is there any way to edit the timeout,,,
{
"caller": "app/plugin_api.go:1003",
"error": "timeout streaming",
"level": "error",
"msg": "Streaming result to post failed",
"plugin_id": "mattermost-ai",
"timestamp": "2024-03-12 22:22:33.939 Z"
}

from mattermost-plugin-ai.

Twilek-de avatar Twilek-de commented on June 20, 2024

Found the "streamingTimeoutSeconds" setting. Is working again now.

from mattermost-plugin-ai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.