Free | No tracking | Every fact with a source|German and English

Error / Models and files

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

  1. 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.
  2. Open server.log with explorer %LOCALAPPDATA%\Ollama and read the lines just before the crash. If you see out of memory or GGML_ASSERT there, you know the cause.
  3. If it only happens after a few messages, VRAM is getting tight. Reserve buffer space: create the environment variable OLLAMA_GPU_OVERHEAD with a value in bytes, for example 1073741824 for 1 GB, and restart Ollama. Alternatively, in ollama run, use /set parameter num_gpu 20 to put fewer layers on the graphics card.
  4. 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=…).
  5. 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 Path environment variable.
  6. 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:

Terms for this

Similar errors

Sources

Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.