Skip to content

Configuration

All settings are configured via environment variables prefixed with MYCELLM_. They can be set in:

  • ~/.config/mycellm/.env (written by mycellm init)
  • Shell environment
  • Docker -e flags
VariableDefaultDescription
MYCELLM_API_KEY(none)API key for dashboard/API authentication
MYCELLM_BOOTSTRAP_PEERS(none)Bootstrap node addresses (host:port, comma-separated)
MYCELLM_HF_TOKEN(none)HuggingFace token for gated models + higher rate limits
MYCELLM_DB_URLSQLiteDatabase URL (postgresql+asyncpg://user:pass@host/db)
MYCELLM_TELEMETRYfalseOpt-in anonymous usage stats
MYCELLM_LOG_LEVELINFOLog verbosity: DEBUG, INFO, WARNING, ERROR
MYCELLM_RELAY_BACKENDS(none)Relay endpoints (comma-separated OpenAI-compatible URLs)
MYCELLM_MODEL_DIR~/.local/share/mycellm/modelsGGUF model download directory
MYCELLM_DATA_DIR~/.local/share/mycellmAll persistent data
MYCELLM_CONFIG_DIR~/.config/mycellmConfiguration directory
MYCELLM_API_HOST127.0.0.1API bind address
MYCELLM_API_PORT8420API port
MYCELLM_QUIC_PORT8421QUIC transport port (UDP)
MYCELLM_EXTERNAL_HOST(none)Public IP override for NAT traversal
MYCELLM_NODE_NAMEhostnameDisplay name for this node
MYCELLM_INITIAL_CREDITS100.0Starting credit balance
MYCELLM_PREFLIGHT_KV_AWAREtrueKV-aware model-load preflight on MLX backends (since 0.6.0). Estimates weights + KV cache against the Metal working-set ceiling before loading
MYCELLM_PREFLIGHT_ACTIONclampWhat to do when a load won’t fit: warn (load anyway), clamp (reduce context length to the largest that fits), or reject
MYCELLM_PREFLIGHT_MIN_CTX_LEN2048Never clamp context below this
MYCELLM_MEMORY_WATCH_ENABLEDtrueRuntime memory-pressure watcher (macOS): kernel WARN clears the Metal cache; CRITICAL evicts idle local models before the OOM killer fires. Evicted models stay enabled and restore on restart
MYCELLM_MEMORY_WATCH_INTERVAL10.0Seconds between pressure polls
MYCELLM_MEMORY_WATCH_EVICTtrueAllow CRITICAL-pressure eviction of idle models (set false for cache-clear only)
MYCELLM_MEMORY_WATCH_IDLE_SECONDS60.0A model must be idle this long before it is eviction-eligible
MYCELLM_TRUSTED_PROXIES127.0.0.0/8,::1Reverse proxies whose X-Forwarded-For may be believed (comma-separated IPs/CIDRs). See the warning below
MYCELLM_QUEUE_ENABLEDtrueAsync job queue. Off makes /v1/jobs answer 503 queue_disabled
MYCELLM_QUEUE_MAX_CONCURRENT1Queued jobs this node runs at once
MYCELLM_QUEUE_POLL_INTERVAL5.0Seconds between scheduler polls while work is pending
MYCELLM_MLX_PREFILL_STEP_SIZE0Prefill chunk size (tokens) for MLX generation; 0 = mlx-lm default (2048). Lower it (e.g. 512) on memory-tight nodes to shave the prefill transient
PortProtocolPurpose
8420TCPHTTP API + Dashboard
8421UDPQUIC P2P transport
8422UDPDHT discovery (optional)
~/.local/share/mycellm/
├── keys/ # Ed25519 account + device keys
├── certs/ # Device certificates
├── tls/ # Self-signed TLS for QUIC
├── models/ # Downloaded GGUF files
├── federation/ # Network identity + memberships
├── secrets.json # Encrypted API keys (Fernet)
├── mycellm.db # SQLite database
└── model_configs.json # Saved model configurations
~/.config/mycellm/
└── .env # Environment overrides

For larger networks, switch from SQLite to PostgreSQL:

Terminal window
MYCELLM_DB_URL="postgresql+asyncpg://user:pass@localhost/mycellm"

Install the PostgreSQL driver:

Terminal window
pip install "mycellm[postgres]"