CLI Flags & Environment Variables

CLI Flags

FlagShortDescription
--port <PORT>-pListen port
--data-dir <PATH>-dData directory
--config <PATH>-cConfig file path
--model <PATH>-mPath to a GGUF model file
--gpu-layers <N>Layers to put on the graphics card (0 = processor only; leave it out for automatic placement)
--bootstrap <ADDR>Bootstrap peer address (repeatable)
--shards <RANGE>Advanced: shard range for split inference (e.g., "0-4"; all clears a saved range)
--verbose-vIncrease log verbosity (-v, -vv, -vvv)
--log-file <PATH>Write the log to this file as well as the window (off: the window only). Default: logs/swarmllm.log in the data directory; overrides logging.file

Subcommands

CommandDescription
runStart SwarmLLM (the default when no subcommand is given). --anchor runs a relay-only computer with no models; --no-update-check turns update checking off for that run
statusShow what the running SwarmLLM is doing (--json for raw output)
chatChat in the terminal with streaming replies
benchMeasure speed against the running SwarmLLM
peersList connected computers (--json for raw output)
diagnosticsPrint a report for a bug report — safe to post publicly (--full includes network addresses; don't post that)
get-model [smoke|standard|stress]Download a shared test model (no tier lists them; --all downloads every part)
privacy <model-id>Fetch the first and last parts of a model so "Start and finish on this computer" can switch on for it
unload <model-id>Stop a model's worker and free its memory; the files stay
remove-model <model-id>Delete a model from this computer and tell the network it's gone (-y skips the question)
updateCheck for an update and install it (--check-only to only check)
poolLink your own devices into a private group
test-splitDeveloper diagnostic: test split inference locally (--max-tokens, default 20; --prompt; --prompt-chunk N reads the prompt N tokens per forward, as a node does — default 0, one forward)
versionPrint version

chat Options

FlagDefaultDescription
--model <ID>first availableModel to chat with
--max-tokens <N>1024Maximum tokens per reply
--temperature <F>0.7Sampling temperature

bench Options

FlagDefaultDescription
--model-id <ID>first listedModel to benchmark. Not --model, which names a GGUF file for run
--prompt <TEXT>"Explain the theory of relativity in simple terms."Benchmark prompt
--max-tokens <N>100Tokens to generate
--iterations <N>5Number of runs
--concurrency <N>1Requests sent at once
--streamoffStream replies and report time to first token
--jsonoffMachine-readable output

pool Subcommands

Link your own devices so they serve each other privately. With the group's Private Mode on, your requests stay on these devices (and, by default, other SwarmLLM computers on your local network).

CommandDescription
pool create --name "My Devices"Create a device group (this machine becomes the main device)
pool invite-codeGenerate an invite code — a long swarmpool://… code, valid for 24 hours, single use
pool join <CODE>Link this device using a code from your main machine
pool statusShow linked devices, their contribution level and online status
pool leaveUnlink this device from the group

Example flow:

# Main device:
swarmllm pool create --name "My Devices"
swarmllm pool invite-code   # → swarmpool://… (a long code)

# On each other device:
swarmllm pool join 'swarmpool://…'

Note: This links YOUR own devices. It's different from connecting to the SwarmLLM network (which uses swarm:// peer addresses).

Environment Variables

A small, fixed set of options — the ones a headless or Docker deployment needs before a config file exists — can be set with a SWARMLLM_ environment variable. This table is the complete list of settings that can be given this way — there is no general SWARMLLM_<SECTION>_<KEY> rule, and any other setting goes in config.toml or the dashboard. A few diagnostic switches are also read (for example SWARMLLM_HYBRID_OFFLOAD, see gpu_layers in the configuration reference), and SWARMLLM_PORT is the port swarmllm update checks for a running node (default 8800).

Config PathEnvironment VariableNotes
node.listen_portSWARMLLM_NODE_LISTEN_PORT
node.data_dirSWARMLLM_NODE_DATA_DIR
logging.levelSWARMLLM_LOGGING_LEVELtrace, debug, info, warn or error; -v/-vv still take precedence
inference.model_pathSWARMLLM_INFERENCE_MODEL_PATH
inference.gpu_layersSWARMLLM_INFERENCE_GPU_LAYERS0 = processor only
api.api_keySWARMLLM_API_KEYa deterministic key for Docker; empty means unset
network.bootstrap_peersSWARMLLM_NETWORK_BOOTSTRAP_PEERSmultiaddrs separated by commas, spaces or newlines

Example:

SWARMLLM_NODE_LISTEN_PORT=9000 ./swarmllm run -v

Provider API Keys via Environment

Cloud provider API keys use standard environment variable names:

ProviderEnvironment Variable
OpenAIOPENAI_API_KEY
AnthropicANTHROPIC_API_KEY
DeepSeekDEEPSEEK_API_KEY
MistralMISTRAL_API_KEY
GroqGROQ_API_KEY
NVIDIA NIMNVIDIA_NIM_API_KEY
CerebrasCEREBRAS_API_KEY
SambaNovaSAMBANOVA_API_KEY
FireworksFIREWORKS_API_KEY
TogetherTOGETHER_API_KEY
DeepInfraDEEPINFRA_API_KEY
Moonshot/KimiMOONSHOT_API_KEY

These can also be placed in a .env file in your data directory:

# ~/.local/share/swarmllm/.env
OPENAI_API_KEY=sk-proj-...
DEEPSEEK_API_KEY=sk-...
NVIDIA_NIM_API_KEY=nvapi-...

The .env file is loaded at startup. It does not override existing environment variables or keys already configured via the dashboard/database. The dashboard settings UI shows "From .env" for keys loaded this way.