Usage¶
echoChain is a command line tool. echochain --start TEXT is the same command as
echochain run --start TEXT.
flowchart TD
Start["Start run"] --> Step["Take step"]
Step --> Stop{"Stop rule"}
Stop -->|"continue"| Step
Stop -->|"threshold"| Done["Finished"]
Stop -->|"cycles"| Done
Stop -->|"budget"| Cap["Budget stop"]
Stop -->|"errors"| Fail["Failed"]
Stop -->|"interrupt"| Pause["Interrupted"]
Commands¶
runplans one cell, or a batch, and writes a run directory.config showprints the resolved settings.modelschecks the configured models against the OpenRouter catalog.export RUNprints a CSV table derived fromchain.jsonl.analyze RUNwrites tables and figures. RepeatRUNto compare runs, and pass--out DIRto choose the directory.
Global flags¶
--config PATHreads that TOML file instead of./echochain.toml.--quiethides step progress.--verboseprints token counts and cost with each step.--helpprints command help and does not need an API key.--versionprints the package version and does not need an API key.
Run flags¶
--start TEXTis the inline seed text.--seed IDselects one seed from the seed file.--seeds PATHreads a seed file. With no--seed, every seed in that file runs.--condition NAMEchooses a schedule. Repeat the flag to run several.--repeats Nrepeats each seed and condition pair.--sampling-seed Nsets the base sampling seed.--top-p Nsets the nucleus sampling cutoff.--dry-runprints call, token, and cost upper bounds and does not call a model.--yesstarts a run whose dry-run cost is aboveconfirm_above_usd.--out DIRis the directory that receives run folders.--budget USDstops the run at that cost.--model IDadds a rotating model. Repeat the flag to replace the default list.--judge IDadds a judge model. Repeat the flag to replace the default judge.--judge-samples Nis the number of judge samples per step.--judge-temperature Nis the judge temperature.--temperature Nis the transform temperature.--max-cycles Nis the number of planned steps.--max-tokens Nis the completion token cap.--stop-score Nis the low fidelity threshold.--stop-consecutive Nis how many low scores stop a run. Zero means the threshold never stops the run.--provider SPECpins a model to providers, asmodel=provider,provider|true.--resume IDcontinues a run id, a run directory, or a batch id.
--start cannot be combined with --seed or --seeds. A run with none of the three selectors is an error. --seed with no --seeds reads the packaged seed file. --resume cannot be combined with a new selector or with --dry-run.
Configuration¶
Settings resolve in this order:
- Built-in defaults.
echochain.tomlin the working directory, or the file from--config.- Environment variables.
- CLI flags.
These settings have no flag:
base_url(OPENROUTER_API_BASE) is the OpenRouter API root.deadline_seconds(ECHOCHAIN_DEADLINE_SECONDS) is the per-call deadline.confirm_above_usd(ECHOCHAIN_CONFIRM_ABOVE) asks for--yesabove this dry-run cost.http_referer(ECHOCHAIN_HTTP_REFERER) andtitle(ECHOCHAIN_TITLE) are request headers.baseline(ECHOCHAIN_BASELINE) isofforneural. The default isoff.max_judge_error_share(ECHOCHAIN_MAX_JUDGE_ERROR_SHARE) stops the run when judge failures exceed this share of the planned steps. The default is0.1.
A TOML provider pin can also set data_collection to allow or deny, and zdr to true or false:
[providers."openai/gpt-4.1-mini"]
order = ["openai"]
allow_fallbacks = false
data_collection = "deny"
zdr = true
Output¶
Each run is a directory under --out. The directory name is a UTC timestamp and a random id. The manifest stores a short slug, the seed text, the claims, and the rules used for that run.
manifest.jsonis the run record, includingversion,seed_text,claims, andmax_judge_error_share.chain.jsonlhas one JSON object per step, includinginput_text,output_text, andsampling_seed.BATCH.batch.jsonstores the settings for a multi-cell run.echochain analyzewritescurves.tsv,survival.tsv,comparisons.tsv,curves.svg, andsurvival.svg.
Exit codes¶
0means the cycle cap or the fidelity threshold was reached.1means a runtime or API failure, including a generation error or a judge error.2means a usage or configuration error.3means the budget was exceeded or the account is out of credits.130means the process was interrupted.
Cost¶
--dry-run estimates calls, prompt tokens, and USD from catalog prices. When the estimate is above confirm_above_usd, the run waits for --yes. --budget stops a live run at a USD cap and exits 3. A missing price makes the bound unknown.
Resume¶
--resume rebuilds the run from manifest.json. It does not reread the seed file. The stored seed text, claims, models, temperatures, stop rule, and sampling seed stay in force. Client settings such as the API root and provider pins come from the current process. A manifest that recorded neural baseline models keeps those models. A run with no completed step resumes at step 1. An interrupted batch cell resumes from its own manifest, and a cell that never started uses the batch file.
Data handling¶
Prompts and model replies are sent to OpenRouter and then to the selected providers. The API key is read from OPENROUTER_API_KEY or .env and redacted in logs, errors, and run files. Run files store the seed, the prompts' visible text, and the replies on disk under --out. Provider pins can set data_collection and zdr for a model. Fallbacks stay off unless a pin sets allow_fallbacks to true.