amicsdocs
Guides

Run an autoresearch loop

Keep experiment decisions and Git local while reusing one bounded warm GPU across repeated commands.

Use one stable project name and an approved warm lease. The agent edits, commits, parses results, and chooses the next experiment locally. Amics runs each training command on the remote machine.

1. Approve the loop

Establish a maximum hourly rate, per-command runtime, total warm window, GPU requirement, environment names, and storage choice. The warm window is the maximum time compute may remain available, not a guarantee of uninterrupted Spot capacity.

2. Prepare the cache

amics run \
  --project autoresearch \
  --gpu auto --min-vram 24 \
  --max-hourly-price 1.50 --max-runtime 10m \
  --keep-warm 8h --yes --json \
  -- sh -lc 'mkdir -p "$AMICS_CACHE_DIR/autoresearch" && test -w "$AMICS_CACHE_DIR/autoresearch"' \
  > .amics-autoresearch-lease.json

Read the returned id and compute_id. Keep the local control file out of Git.

3. Run each experiment

Edit and commit the experiment locally, then reuse the captured compute ID. Do not repeat --keep-warm 8h: each auto-acquired run sets its lease expiry from its own completion time, so repeating the full warm duration can extend the approved billing window.

amics run \
  --compute COMPUTE_ID \
  --max-runtime 10m \
  -- uv run train.py > run.log 2> run.meta.log

Parse the process output in run.log locally and decide the next edit. run.meta.log contains remote stderr, CLI stage messages, the durable run ID, and the terminal status. The captured compute keeps the same warm machine and cache without requesting a new warm lease.

4. Stop on ambiguity

If the CLI exits 75, do not assume the outcome is unknown. Read the run ID from run.meta.log, then inspect amics runs get RUN_ID and its logs. A remote process can also return 75; use the run's status and exit fields to decide. Do not launch the next experiment until replay is known to be safe.

5. End the lease early

amics compute stop COMPUTE_ID

Stopping compute deletes its default project directory and cache. No persistent workspace remains billed unless one was explicitly created and attached.

On this page