mirror of
https://github.com/ollama/ollama.git
synced 2026-11-22 00:01:45 +00:00
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.
14 lines
323 B
Go
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")
|
|
}
|
|
}
|