Llama-server process has terminated: invalid argument --load-mode with Ollama client 0.32.6 and langchain-ollama 1.1.0

Hello,

I am encountering an issue when using the langchain-ollama Python package version 1.1.0 with Ollama client version 0.32.6.

When I try to embed documents using Ollama embeddings, I get the following error:

ollama._types.ResponseError: llama-server process has terminated: exit status 1: error: invalid argument: --load-mode (status code: 500)

Steps to reproduce:

  1. Ollama client version: 0.32.6 (confirmed via ollama -v)
  2. langchain-ollama version: 1.1.0 (installed via pip)
  3. Simple embedding test script using OllamaEmbeddings with model nomic-embed-text:latest
  4. Running the script results in the above error.

It seems that the --load-mode argument is no longer supported or causes the server to terminate unexpectedly.

Could you please advise on:

  • Whether this is a known compatibility issue between Ollama client 0.32.6 and langchain-ollama 1.1.0?
  • If there is a recommended version of langchain-ollama that works with Ollama client 0.32.6?
  • Any workarounds or fixes planned for this issue?

Thank you for your help!

Best regards, dakain98

hi @dakain98

It looks like this is not a langchain-ollama bug - it’s a broken Ollama installation, new with Ollama v0.32.6. The evidence chain I verified:

  1. --load-mode is generated by Ollama’s own daemon, in appendLoadModeArgs() in llm/llama_server.go, when it spawns its bundled llama-server runner. It’s added only when (a) Linux + integrated CUDA/ROCm GPU → --load-mode dio, or (b) use_mmap: false in options/Modelfile → --load-mode none.
  2. Exact version boundary confirmed by diffing tags: v0.32.5 and earlier pass --no-mmap and bundle llama.cpp b10091 (no such flag); v0.32.6 (released Aug 4, five days before the post) switched to --load-mode and bundles llama.cpp b10242, where upstream added -lm, --load-mode MODE. Introduced via Ollama PRs #17286 and #17545.
  3. Therefore “invalid argument: --load-mode” can only happen when the 0.32.6 daemon launches a stale llama-server binary from ≤0.32.5 - a partial upgrade or duplicate install (e.g. leftover /usr/lib/ollama vs /usr/local/lib/ollama; Ollama resolves the runner from lib/ollama/ relative to the executable per ml/path.go).
  4. langchain-ollama 1.1.0 is exonerated by its source (the checkout in ./sources/ is exactly 1.1.0): OllamaEmbeddings just POSTs to /api/embed with sampling options only - no use_mmap, no CLI flags. A plain curl http://localhost:11434/api/embed -d '{"model":"nomic-embed-text","input":"hello"}' reproduces the error without LangChain.

Fix: fully restart the Ollama daemon, remove any duplicate/stale install (check which -a ollama and for both /usr/lib/ollama and /usr/local/lib/ollama), then reinstall 0.32.6 cleanly. Or temporarily downgrade Ollama to 0.32.5. Keep langchain-ollama as is.

Hello Pawel!

Thank you for your detailed analysis. I want to share the steps I have taken so far and ask for further advice.

I have downloaded the Ollama CLI tools version 3.2.5 from the official GitHub repository and tried to run ollama.exe from the extracted package on Windows. However, I encountered the error message “could not locate ollama app,” which indicates that the package does not include the server (daemon) part necessary for the client to function ??

I also completely uninstalled the previous Ollama 3.2.6 installation to avoid any conflicts or partial installations, but the problem persists.

I understand from your explanation that the issue with version 3.2.6 is related to a mismatch between the daemon and the llama-server binary, caused by partial or duplicate installations. But my main problem is that I cannot find the server part for version 3.2.5 anywhere. The CLI alone is not enough.

Could you please advise me where I can download the complete server part compatible with Ollama 3.2.5? Or should I give up on this version and install the latest full package from the official website instead?

Also, if I switch to the full package will the client and server be fully compatible and work smoothly without such errors? I had done it before I installed the 3.2.5, but as I have explained in the beginning it had not wroked…

Thank you very much for your help !!!

hi @dakain98

thanks for the extra detail! And this is a really useful detail - you are on Windows.
You already have the server. Let me untagle the three misunderstandings one by one.

Btw, as of today there’s also 0.32.7.

  1. the zip does include the server part - ollama.exe is the server

you start the server with ollama.exe serve

then in a second terminal use the client ollama.exe run ..., ollama.exe pull ... or just un your python script against http://localhost:11434

So what is "could not locate ollama app"? It’s not about a missing server. When you run a client command and no server is listening on port 11434, the Windows CLI tries to auto-start the desktop tray app - literally a file named ollama app.exe. You can see this in the source, cmd/start_windows.gostartApp(): it looks for ollama app.exe (1) next to ollama.exe, (2) in %LOCALAPPDATA%\Ollama, (3) on PATH - and if it’s nowhere, it returns exactly could not locate ollama app. The standalone zip deliberately ships without the GUI app - the official Windows docs describe it as “containing only the Ollama CLI and GPU library dependencies”, intended for “embedding Ollama in existing applications, or running it as a system service via ollama serve” (e.g. with NSSM). One extra gotcha from the same docs: if you have an AMD GPU, you also need to extract ollama-windows-amd64-rocm.zip into the same directory.

So the 0.32.5 zip you downloaded was already complete- it just wanted ollama serve in a separate window instead of relying on the tray-app auto-start.

  1. “I completely uninstalled 0.32.6 but the problem persists”

Two different symptoms may be mixed up here:

  • If what persists is could not locate ollama app from the zip → that’s expected and harmless; see point 1, run ollama serve.
  • If what persists is the original --load-mode error → then a 0.32.6 server is still alive or still on disk somewhere, and that leftover is almost certainly also the original cause of your problem. The Windows uninstaller doesn’t necessarily catch a manually extracted zip folder, stale PATH entries, or a still-running process.

Quick audit (each answers one question):

curl.exe http://localhost:11434/api/version   # is any server still running, and which version?
where.exe ollama                              # how many ollama.exe's are on PATH? (should be exactly one)
ollama -v                                     # prints client version AND warns if the server version differs

Also check Task Manager for ollama.exe / ollama app.exe processes, and look in %LOCALAPPDATA%\Ollama\server.log - per the troubleshooting docs that’s where the server logs live, and the log contains the exact command line used to spawn llama-server, including which binary path it picked and the --load-mode flag. That one log line is the definitive proof of the mismatch: a 0.32.6 daemon path spawning a llama-server.exe from an older directory.

This mixed state is also the most plausible story for why the full 0.32.6 package “had not worked” the first time: an installer-based app in %LOCALAPPDATA%\Programs\Ollama plus an extracted zip elsewhere on PATH (or a partially-applied auto-update where a running/locked llama-server.exe didn’t get replaced). The docs even warn for the standalone zip: “If you are upgrading from a prior version, you should remove the old directories first.”

  1. “Where do I download the complete server for 0.32.5?”

You have three options, best first:

  • don’t pin 0.32.5 at all. 0.32.6’s --load-mode isn’t a bug - it only crashes when the daemon and runner binaries are from different versions. A clean install of the current release (v0.32.7, released today) gives you a matched set and full forward compatibility. Downgrading was only ever a stop-gap.
  • If you really want a full 0.32.5 desktop install: every GitHub release page ships the complete installer. OllamaSetup.exe under the v0.32.5 release assets contains app + server + CLI in one matched bundle. Be aware the installer-based app keeps itself updated (the docs say the installer “will help you keep up to date”), so it may not stay pinned at 0.32.5 for long.
  • If you want a pinned, server-only 0.32.5: the zip you already have + ollama serve (optionally installed as a Windows service with NSSM) is precisely the supported way to do that.
  1. “If I switch to the latest full package, will client and server be fully compatible?”

Yes - the installer ships client, tray app, daemon and the llama-server runner as one matched bundle; version-mismatch errors like yours only arise when two installations coexist or an upgrade half-applies. Do it as a genuinely clean slate, in this order:

  1. Stop everything: quit the tray app; in Task Manager kill any remaining ollama.exe / ollama app.exe.
  2. Uninstall “Ollama” via Settings → Apps (the registered uninstaller, per the docs).
  3. Delete leftovers by hand: %LOCALAPPDATA%\Programs\Ollama (binaries), %LOCALAPPDATA%\Ollama (logs/updates), every folder where you extracted a zip, and any ollama* folders in %TEMP%. You can keep %HOMEPATH%\.ollama - that’s just your downloaded models and config; model blobs are version-independent, so nomic-embed-text won’t need re-downloading.
  4. Clean PATH: open a new terminal, run where.exe ollama - it should now find nothing. If it still finds something, remove that entry in Environment Variables.
  5. Install fresh: download OllamaSetup.exe from Download Ollama on Linux (currently 0.32.7) and install.
  6. Verify the pair matches: ollama -v must show one version with no server-mismatch warning; curl.exe http://localhost:11434/api/version must agree.
  7. Test the failing path without LangChain first:
    curl.exe http://localhost:11434/api/embed -d "{\"model\":\"nomic-embed-text\",\"input\":\"hello\"}"
    
    If that returns embeddings, your original repro is fixed.
  8. Then run your OllamaEmbeddings script unchanged - langchain-ollama 1.1.0 stays as-is; nothing on the Python side ever needed to change.

If - and only if - the --load-mode error survives this exact procedure, that would mean a genuinely broken 0.32.7 bundle on your hardware. In that case grab the spawn line from %LOCALAPPDATA%\Ollama\server.log (it shows the full llama-server path + arguments) and open an issue at github.com/ollama/ollama/issues - that log line plus ollama -v output is everything they need. But I’d bet on the cleanup solving it.