Enable learning
Set the optimizer, register gVisor and run the executor so that workspaces can run learning loops.
Set up the optimizer and the executor, the container that runs each learning rollout in a sandbox, on a self-hosted deployment. Run the commands from the checkout. Afterwards a workspace administrator saves a model provider and turns on learning, as in Before you start.
The executor has administrator authority on the host
The executor alone mounts the host's Docker socket, which gives it administrator authority on the host. It runs as root with outbound network access and holds each workspace's provider API key in memory while it runs that workspace's rollouts. Run it only on a host you trust with every workspace's provider API key.
Register gVisor with Docker
Each rollout runs in a sandbox container under gVisor. Docker must have a runtime named runsc with the runtime argument --host-uds=open, which lets a sandbox reach the gateway (the executor's proxy to the model provider) through a socket. Follow gVisor's installation guide and add that argument to the runtime it registers.
Do this first. Restarting Docker restarts every container, so the console and API pause briefly. Then check that docker info --format '{{json .Runtimes}}' lists runsc.
Set the optimizer model
The optimizer is the model that proposes bundle changes, set once for the whole service.
-
Add its settings to
service.envin the private directory.ACCLIMATE_MODEL_ENDPOINTis the full URL of an OpenAI-compatible Chat Completions endpoint, used as written.ACCLIMATE_MODEL_ENDPOINT=https://provider.example.com/v1/chat/completions ACCLIMATE_MODEL_TOKEN=<optimizer-api-key> ACCLIMATE_MODEL=<optimizer-model-id> -
Recreate the service so that it reads them.
docker compose up -d --wait service
Without an optimizer, starting a loop is refused with optimizer-required. For the other settings, see Optimizer.
Check the provider encryption key
The service needs ACCLIMATE_PROVIDER_ENCRYPTION_KEY to save a model provider and to give the executor work. deploy/init.sh writes it to service.env. If yours has none, add ACCLIMATE_PROVIDER_ENCRYPTION_KEY= followed by the output of openssl rand -hex 32, then run docker compose up -d --wait service.
Never replace an existing key
Once the service has started with a key, it refuses a different one. Store a copy off the server before any workspace saves a model provider. See Keep the provider encryption key.
Start the executor
-
Add this line to
.envin the checkout. Compose then includes the executor and the runner image that each sandbox runs.COMPOSE_PROFILES=learning -
Create the executor credential. The file keeps the credential's
id, which you need to revoke it.docker compose exec -T service acclimate-service --create-executor-token > ~/.config/acclimate/executor-token -
Build and start the executor with the rest of the stack. With release images, run
docker compose pullfirst and leave out--build.docker compose up -d --build --wait
The executor runs one rollout at a time by default. To run more, add ACCLIMATE_EXECUTOR_CONCURRENCY=<number> to .env and run docker compose up -d --wait again. Rounds finish sooner, at more load on the model provider and the host.
Allow a private model provider address
A model provider over plain HTTP or at a private address needs its host in ACCLIMATE_PROVIDER_HTTP_HOSTS. Set the same value in service.env and in .env, which reaches the executor. If they differ, the executor can refuse a provider URL that the service accepted.
The executor reaches model providers over the Compose network executor-egress. Attach a model proxy container that you address by its Compose hostname to that network.
Check the executor
docker compose up --wait returns once the executor is healthy, within about two minutes. Its health check, acclimate-executor --health, passes while the service has answered the executor in the last 120 seconds. If it keeps restarting instead, a startup check failed and the log names the cause.
docker compose logs acclimate-executorIt exits with status 78 when:
- the service refuses its credential with HTTP 401
- the credential file is missing, unreadable, empty or neither a token nor the JSON that
--create-executor-tokenprints ACCLIMATE_SANDBOX_RUNTIMEis neitherrunscnordocker- the runner image is missing
- the throwaway sandbox it runs at startup fails, for example because
runscis not registered with Docker or is registered without--host-uds=open
Verifying a model provider in the console passes even without gVisor, because that check runs outside a sandbox. To list the executor credentials without their tokens, run:
docker compose exec -T service acclimate-service --list-executor-tokensUpgrade the executor
Upgrade the executor after the service, because an older service rejects results from a newer executor, and while no round runs. A round pins the executor build and runner image it started with. If no running executor matches them for five minutes, the round fails with no-matching-executor, which does not count toward the automatic pause after failed rounds. The next round uses the new executor.
With COMPOSE_PROFILES=learning in .env, the steps in Upgrade upgrade the executor with everything else, in the right order. They pause the loops first. Stopping the old executor waits up to an hour for the rollouts it holds to finish. Afterwards, check the executor and start the loops again.
Rotate the executor credential
-
Note the old credential's
idin the file, then create a new credential with the command in Start the executor. -
Recreate the executor, which reads the file only at startup.
docker compose up -d --wait --force-recreate acclimate-executor -
Revoke the old credential by its ID. If you did not keep it, find it with
--list-executor-tokens.docker compose exec -T service acclimate-service --revoke-executor-token <old-id>
Revoking a credential requeues the rollouts it still held.
Self-host Acclimate
Set up a single Linux server with PostgreSQL, Keycloak and Caddy in three commands, then deliver a bundle to your application.
Use your own reverse proxy
Replace the bundled Caddy with your own proxy while keeping Acclimate's HTTPS origins, private listeners and trusted proxy headers.