First trial and error.
Added a new LLM entry in /admin/plugins/discourse-ai/ai-llms/new?llmTemplate=none.
Named it "Ollama" and selected OpenAI as provider and qwen3.5:2b (pulled) as model.
Set the URL to the Ollama instance and put the API key from it's cat /app/data/.api_key.
Chose QwenTokenizer and 262000 context.
Saved settings with the Submit button.
The "Run test" fails with
Non-streaming request failed: <html> <head><title>405 Not Allowed</title></head> <body> <center><h1>405 Not Allowed</h1></center> <hr><center>nginx/1.24.0 (Ubuntu)</center> </body> </html>
Changed URL to Ollama's ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}', like http://172.18.16.111:11434
The "Run test" fails with "Internal Server Error"
Jul 06 20:35:43 172.18.0.1 - - [06/Jul/2026:18:35:43 +0000] "POST /admin/plugins/discourse-ai/ai-llms/test.json HTTP/1.1" 500 46 "https://eupalinos.eu/admin/plugins/discourse-ai/ai-llms/1/edit" "Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0"
Jul 06 20:35:43 Started POST "/admin/plugins/discourse-ai/ai-llms/test.json" for 185.244.213.58 at 2026-07-06 18:35:43 +0000
Jul 06 20:35:43 Processing by DiscourseAi::Admin::AiLlmsController#test as JSON
Jul 06 20:35:43 Parameters: {"ai_llm" => {"max_prompt_tokens" => "262000", "max_output_tokens" => "", "ai_secret_id" => "2", "tokenizer" => "DiscourseAi::Tokenizer::QwenTokenizer", "url" => "http://172.18.16.111:11434", "display_name" => "Ollama", "name" => "qwen3.5:2b", "provider" => "open_ai", "vision_enabled" => "false", "input_cost" => "", "output_cost" => "", "cached_input_cost" => "", "cache_write_cost" => "0", "provider_params" => {"organization" => "", "disable_native_tools" => "", "reasoning_effort" => "default", "disable_streaming" => "false", "service_tier" => "default"}}}
Jul 06 20:35:43 Completed 500 Internal Server Error in 22ms (ActiveRecord: 0.0ms (0 queries, 0 cached) | GC: 0.0ms)
Jul 06 20:35:44 172.18.0.1 - - [06/Jul/2026:18:35:44 +0000] "POST /message-bus/99cb84f5c8754d6caf75a4140828e566/poll HTTP/1.1" 200 2 "https://eupalinos.eu/admin/plugins/discourse-ai/ai-llms/1/edit" "Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0"
More reading:
https://forum.cloudron.io/topic/14645/how-to-configure-ollama-in-openwebui
https://forum.cloudron.io/topic/13066/auto-tagging-ollama-setup