WARN invalid environment variable, using default key=OLLAMA_NUM_PARALLEL value=many default=1
in the Ollama server log means the server could not read many as a value
for OLLAMA_NUM_PARALLEL, so it ignored it and carried on with the default. Set the variable to a value of the right kind,
such as OLLAMA_NUM_PARALLEL=2, and restart the server.
The server did not stop, so the signs were this warning and the values in its
server config line. Read both after every change. A bad
OLLAMA_KEEP_ALIVE was worse in the test: no warning at all.
The error
2026/11/13 11:11:37 config.go:265: WARN invalid environment variable, using default key=OLLAMA_NUM_PARALLEL value=many default=1
time=2026-11-13T11:11:37.045+05:30 level=WARN source=config.go:265 msg="invalid environment variable, using default" key=OLLAMA_NUM_PARALLEL value=many default=1
From the server config line of the same start, only the two keys that matter:
OLLAMA_KEEP_ALIVE:5m0s OLLAMA_NUM_PARALLEL:1.
Why it happens
OLLAMA_NUM_PARALLEL is a count, and many is not a number. The
warning names the key, the value it got and the default it used instead, and the server
kept running until it was stopped. The setting in effect was the default
1, not what was intended, and the log is where that shows.
OLLAMA_KEEP_ALIVE=forever gave no warning line at all. The server started, and
its server config line showed OLLAMA_KEEP_ALIVE:5m0s, the
default, so the five-minute keep-alive was in effect instead of the intended one. Reading the
value back from the log is how that one showed up in the test.
The fix
OLLAMA_NUM_PARALLEL=2, OLLAMA_KEEP_ALIVE=24h
WARN lines in the log: 0
server config: OLLAMA_KEEP_ALIVE:24h0m0s OLLAMA_NUM_PARALLEL:2
time=2026-11-13T11:11:57.071+05:30 level=INFO source=routes.go:2536 msg="Listening on 127.0.0.1:15191 (version 0.40.16)"
With a whole number and a duration with a unit, the log had no warning and the
server config line showed both values as set: 24h was read as
24h0m0s. The variables were set in the environment of the process that
ran ollama serve, and each test started a new server.
How it was reproduced
On Windows 11 in Windows PowerShell 5.1 with Ollama 0.40.16. A second test server of my
own was started three times on 127.0.0.1:15191 with its own models folder,
via Start-Process ollama -ArgumentList serve with the log redirected to a
file: once with OLLAMA_KEEP_ALIVE=forever, once with
OLLAMA_NUM_PARALLEL=many, once with 2 and 24h.
Each log was read after four seconds and the server stopped by its process id. The two
keys were extracted from the long server config line; the summary lines in
the fix block are from that read, not raw log lines.
Frequently asked
- What does 'invalid environment variable, using default' mean in the Ollama log?
- An OLLAMA_ variable held a value the server could not read, so it used the default shown in the same line. In the test OLLAMA_NUM_PARALLEL=many fell back to 1.
- Does Ollama warn about a bad OLLAMA_KEEP_ALIVE?
- Not in the test with Ollama 0.40.16. OLLAMA_KEEP_ALIVE=forever printed no warning, and the server config line showed the default 5m0s.
- How do I check which settings the Ollama server is using?
- Read the server config line near the start of the server log; in the test it was the third line, right after the warnings. It lists the OLLAMA_ variables with their values, for example OLLAMA_KEEP_ALIVE:24h0m0s and OLLAMA_NUM_PARALLEL:2.
More decoded errors in the Fixes category. For a keep_alive value sent in a request rather than the environment, see Ollama: keep_alive 'missing unit in duration'.