Skip to content

Configuration

File

~/.macbatch/config.toml

WARNING

Despite the extension, the contents are JSON. The name is historical. Unknown keys are ignored on load, so a config written by an older version keeps working after an upgrade.

Written by macbatch setup, and updated whenever serve or control start is given overriding flags.

Fields

FieldDefaultMeaning
control_urlhttp://127.0.0.1:8000Control plane this machine talks to
worker_id<hostname>-<6 hex>Identity used in every request
token""Unused. Reserved for authentication that does not exist yet.
jobs["embed"]Job types this worker will accept
models["nomic-embed-text"]Advertised in heartbeats. Does not pull anything.
ollama_urlhttp://127.0.0.1:11434Local runtime endpoint
max_concurrent2Shards processed in parallel threads
lease_limit2Shards leased per round trip
poll_seconds0.5Sleep between empty lease attempts
control_host127.0.0.1Bind address when this machine hosts the control plane
control_port8000Bind port
public_url""Tunnel URL, set while a tunnel is live and cleared when it exits

control_url versus public_url

Both exist, and the resolution order is deliberate:

effective_control_url() = control_url or public_url or http://127.0.0.1:8000

control_url always wins. public_url exists to be shared with other people, not to be used by this machine.

The reason is operational: a worker on the same Mac as the control plane should reach it over localhost. Preferring the tunnel URL meant a dead tunnel broke a worker that had a perfectly good local server one process away.

Paths

PathHolds
~/.macbatch/config.tomlThis file
~/.macbatch/state/serve.pidPid of the running worker, used by sleep
~/.macbatch/cache/tmp/Temp files, cleared by sleep and clean
~/.macbatch/cache/tmp/shard_results/<worker_id>/Shard results written before upload
~/.macbatch/logs/macbatch.jsonlJSON-lines log
~/.macbatch/control-plane/batch.dbSQLite queue, when this machine is the control plane
~/.macbatch/control-plane/artifacts/Artifact store

Source checkout versus installed

Benchmark output and sample corpora move depending on how macbatch was installed:

Installed viabenchmarks/ and data/ land in
pip install -e . in a cloneThe repository
npm or a regular pip install~/.macbatch/

Detection looks for a pyproject.toml declaring name = "macbatch" beside the package, and explicitly refuses to treat a site-packages location as a checkout. An installed CLI must never write benchmark artifacts into its own install directory.

Environment variables

VariableUsed byMeaning
MACBATCH_PYTHONnpm postinstallInterpreter to build the private venv with

The Python CLI itself reads no environment variables — all state is the config file plus command-line flags.

Constants that are not configurable

ConstantValueWhere
Lease duration600sLEASE_SECONDS in macbatch.control.db
Heartbeat staleness60sHEARTBEAT_STALE_SECONDS in the same module
Max attempts before failing3Hard-coded in the completion handler

Changing any of these means editing the source.

MIT licensed. Every benchmark on this site is reproducible with macbatch bench.