Ollama: POST predict … /completion: EOF / wsarecv: An existing connection was forcibly closed by the remote host (model process crashed in the middle of the response)
The process that runs the model dropped out during the response, and Ollama loses its internal connection to it.
The message
Error: POST predict: Post "http://127.0.0.1:56993/completion": read tcp 127.0.0.1:56995->127.0.0.1:56993: wsarecv: An existing connection was forcibly closed by the remote host.
Affects: Ollama, Open WebUI
Why is this happening?
Ollama starts a separate compute process for each model, and it talks to it internally over 127.0.0.1. If that process crashes, Ollama only sees a broken connection: on Windows, "wsarecv: An existing connection was forcibly closed by the remote host", otherwise just EOF. Common causes are too little VRAM (Ollama loads too many layers onto the graphics card), bugs in a specific Ollama version, or third-party llama.cpp files in the Windows path. The actual cause is in the server log.
How to fix it
- Update Ollama: right-click the taskbar icon → "Restart to update", or install the latest version from ollama.com. In the best-known case, the issue was fixed by an update.
- Open
server.logwithexplorer %LOCALAPPDATA%\Ollamaand read the lines just before the crash. If you seeout of memoryorGGML_ASSERTthere, you know the cause. - If it only happens after a few messages, VRAM is getting tight. Reserve buffer space: create the environment variable
OLLAMA_GPU_OVERHEADwith a value in bytes, for example1073741824for 1 GB, and restart Ollama. Alternatively, inollama run, use/set parameter num_gpu 20to put fewer layers on the graphics card. - Important: environment variables have to reach the Ollama server. On Windows, set them via "Edit environment variables for this account", quit Ollama through the taskbar icon, and restart it from the Start menu. You can see whether they take effect in the first line of
server.log(server config env=…). - If you installed llama.cpp yourself or have an older Docker Desktop version, its DLL files in the Windows path can conflict with Ollama. Update Docker Desktop or llama.cpp, or temporarily remove their folder from the
Pathenvironment variable. - Test with a smaller version of the same model (for example 4B instead of 12B). If that runs stably, your memory is not enough for the larger model.
Better not: Don't set variables like OLLAMA_GPU_OVERHEAD only in the terminal with set while the Ollama app keeps running in the background: the server won't see them.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Your own ChatGPT with Ollama and Open WebUI
Run a language model locally on Windows - with the Ollama app, suitable models for 8 to 24 GB, context length, command line, and Open WebUI… - Chat with your own documents (AnythingLLM)
Set up AnythingLLM Desktop on Windows, load PDFs into a workspace, and ask questions locally — with sources and privacy.
Terms for this
Similar errors
- Open WebUI: Ollama: 500, message='Internal Server Error' (Ollama reached, but model cannot respond)
- Ollama: model "…" not found, try pulling it first (model missing on this server)
- Model forgets the beginning or ignores long texts (context length too small)
- Confusing answers, endless loops, or tags like <|im_end|> (wrong chat template)
- Ollama: model requires more system memory
Sources
- https://github.com/ollama/ollama/issues/9674
- https://github.com/ollama/ollama/issues/9509
- https://docs.ollama.com/troubleshooting
- https://docs.ollama.com/faq
Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.