Skip to main content

default_max_concurrency

Function default_max_concurrency 

Source
pub fn default_max_concurrency() -> u32
Expand description

Resolves the default LLM max-host-concurrency value.

Calibrated for the LLM-only build: each worker holds one subprocess codex or claude invocation. The formula mirrors the CLI semaphore in lock::calculate_safe_concurrency: min(ncpus, available_memory_mb / LLM_WORKER_RSS_MB)

Falls back to MAX_CONCURRENT_CLI_INSTANCES (16) when sysinfo cannot read /proc/meminfo (rare).