beetlebug▾
/

jcode start

Synopsis

jcode start --dir DIR --model MODEL --brief FILE ?OPTION ...?

Description

Starts an agent and prints its id: a1, a2, and on. The agent works in the folder DIR with the model MODEL, and its task is the text of FILE. The command returns at once; the agent runs in the daemon. Use jcode wait to wait for it.

The level of isolation applies to the commands of the run tool (Isolation). A level that the host cannot give makes start fail with the reason; jcode never falls back to a weaker level.

Options

Option Description
--dir DIR The work folder. It must exist, unless --clone makes it.
--model MODEL The model id of Bedrock, such as us.amazon.ergo-1.0, or fake:FILE: the fake provider with the steps of FILE (Configuration).
--brief FILE The file of the task.
--isolation LEVEL none, process, vm, or cloud. The default is isolation of config.json, else process.
--net Gives the commands of the agent the network.
--run MODE The run tool: off (the default), all (a shell), or WORD,WORD (only the commands whose first word is in the list, with no shell syntax).
--max-turns N The cap of model calls. The default is 40.
--max-tokens N The cap of the sum of the tokens. The default is 400000.
--max-out N The output tokens of one model call. The default is 4096; Ergo starts at 8192 and goes up once, to 16384, after a reply that stops at the cap.
--max-usd N The cap of the model USD. It needs a price of the model.
--size S|M|L The size of the ticket: the caps of turns and USD. S is 60 turns and 0.50 USD, M is 120 and 1.50, L is 200 and 4. --max-turns and --max-usd win.
--idle-timeout S A command with no output for S seconds gets a kill. 0 is no limit. The default is 300.
--exec-timeout S The longest time of one command. 0 is no limit. The default is 1800.
--mem SIZE The memory of the commands at the level process or vm, such as 4G.
--write PATH One more path that the commands can change, at the level process. Give it again for more.
--env NAME=VALUE A variable for the commands. Give it again for more.
--check NAME=COMMAND A trusted check: the tool check NAME runs COMMAND on the host (Tools). Give it again for more.
--clone URL Makes DIR as a git clone of URL (a path or a URL). Needs --branch.
--branch NAME The new branch of the clone.
--seed-cache DIR Copies DIR into the clone, such as a build cache. Needs --clone.
--instance-type TYPE The EC2 type of the instance at the level cloud, or a list of types in quotes: the first with capacity. The default is instance_type of the config.
--save-cache NAME=DIR At the level cloud: at the end, saves the folder DIR of the instance as the cache NAME (NAME.tgz) for the next jobs. Repeat it for each cache.

Examples

$ jcode start --dir hello --model fake:run.json --brief brief.md --run all
a1
$ jcode wait a1 --timeout 20
a1 asks none turns 4/40 tokens 480 (in400 out80 cr0 cw0) fake:… …/hello | asks: Both cases work. Shall I also add a --help option?
$ jcode start --dir w-readme --clone hello --branch agent/readme --model fake:run.json --brief brief.md
a1
$ git -C w-readme branch --show-current
agent/readme

Errors

Message Cause
start needs --dir --dir, --model, or --brief is missing.
400: no folder DIR The work folder does not exist.
400: no isolation level "LEVEL": use one of none, process, vm, cloud A bad --isolation.
400: the host gives no process isolation: … The host or the program has no isolated threads (Platforms).
400: no guest image "ztcl-guest" in the store of ztcl::vm: … The level vm needs the guest image (Run an agent in a VM).
--clone needs --branch, and --branch needs --clone Give both.
the folder of --dir exists: DIR; --clone makes it Remove the folder, or give another --dir.
$ jcode start --dir nowhere --model fake:run.json --brief brief.md
jcode: 400: no folder …/nowhere
$ jcode start --dir hello --model fake:run.json --brief brief.md --isolation moon
jcode: 400: no isolation level "moon": use one of none, process, vm, cloud