ollama/envconfig/parallel_test.go
Daniel Hiltgen 0b243a141a
mlxrunner: choose default parallelism from available memory (#19785)
When OLLAMA_NUM_PARALLEL is unset, select 1, 2, 4 or 8 slots
using available memory and estimated per-client storage at the
model's context limit.

Preserve explicit settings and retain the serial default under
memory pressure, for unknown cache layouts and on other backends.
2026-11-20 07:13:42 -08:00

14 lines
323 B
Go

package envconfig
import "testing"
func TestNumParallelDefault(t *testing.T) {
t.Setenv("OLLAMA_NUM_PARALLEL", "")
if NumParallel() != 0 {
t.Fatal("unset parallelism must select the backend default")
}
t.Setenv("OLLAMA_NUM_PARALLEL", "1")
if NumParallel() != 1 {
t.Fatal("explicit serial setting was lost")
}
}