Hello,
I’m trying to configure the LLM application extension for Xwiki and maybe apply RAG with WAISE later.
However, I can’t configure it and I can’t see where I might have missed a configuration.
My xwiki server communicates well with my ollama server because I can make curl requests to generate responses in the xwiki server linux command.
However, when I try the extension, the chat spools for 1min with ‘…’ then gives me an error “An error occurred: Network response was not ok”.
I can’t find the log of curl or other requests from xwiki to the ollama server, so I’m wondering how to fix the problem.
Could you help me?
Thanks, I’m attaching some captures.
Thanks in advance !
Ollama by default offers the OpenAI-compatible API at /v1/
, not at the root. Are you sure that server configuration is correct? I would suggest trying https://ollama-serv:11434/v1/
as URL. If this doesn’t help, have you checked your XWiki server’s logs?
Hello thanks for your fast reply !
Even with the /v1/ at the end it doesn’t work…
If I curl with :
curl -X POST “https://ollama-serv:11434/v1/chat/completions”
-H “Content-Type: application/json”
-d ‘{
“model”: “deepseek:14b_32k_t0.6”,
“messages”: [
{“role”: “system”, “content”: “You are an AI assistant.”},
{“role”: “user”, “content”: “Hi, how are you?”}
]
}’
I get an answer so it should be good:
{“id”:“chatcmpl-272”,“object”:“chat.completion”,“created”:1739373942,“model”:“deepseek:14b_32k_t0.6”,“system_fingerprint”:“fp_ollama”,“choices”:[{“index”:0,“message”:{“role”:“assistant”,“content”:“\u003cthink\u003e\nAlright, someone just said "Hi, how are you?" to me. I need to respond in a friendly and approachable way.\n\nI should acknowledge their greeting and let them know I’m here to help.\n\nSince I’m an AI, I don’t have feelings, but I can express that I’m ready to assist them today.\n\nKeeping it concise and warm is key.\n\u003c/think\u003e\n\nHi! I’m just a computer program, so I don’t have feelings, but thanks for asking! How can I assist you today?”},“finish_reason”:“stop”}],“usage”:{“prompt_tokens”:15,“completion_tokens”:108,“total_tokens”:123}}
Even curl https://ollama-serv:11434 output me : ollama is running.
In the logs I don’t see any curl command or anything trying to chat with my ollama server.
XWiki isn’t using curl to talk to Ollama. In the log you might see an error message that gives you more information why the request fails. Also, try disabling streaming in the configuration with the Ollama URL as non-streaming responses are easier to debug, and you might see more information about non-streaming responses in the browser’s developer tools which is another place I would suggest to look for hints what the problem is.
The LLM integration is really a beta, and we haven’t put that much work into providing useful error messages and diagnosing information for error cases.
The only thing that I can see is :
172.22.0.1 - - [12/Feb/2025:16:09:07 +0000] “POST /rest/wikis/xwiki/aiLLM/v1/chat/completions?media=json HTTP/1.0” 500 719
172.22.0.1 - - [12/Feb/2025:16:11:12 +0000] “POST /rest/wikis/xwiki/aiLLM/v1/chat/completions?media=json HTTP/1.0” 500 719
Have you encountered something similar while developping the LLM application ?
This doesn’t look like XWiki’s log but the web server’s log. Please find the log of XWiki. What you can see in that log that you pasted is basically the same as what you saw in the UI: XWiki replies to the chat completion request with an error (error 500, so internal server error). I think I added error logs to log basically all errors but if there is really nothing in the logs, you could also try if you can get the response body of that request from the browser’s developer tools. As I’ve mentioned, getting these response bodies usually works much better with streaming disabled, at least I couldn’t see anything in the browser with streaming enabled.
1 Like