Install and configure managed OpenCode¶
Use this How-to guide only in CI or an approved isolated lab VM. See the reference for interface facts and limits.
Install¶
Install LilRAE with Python 3.14. Use the package installation instructions. Before you start a trial, install OpenCode:
bash tools/install-opencode.sh "$HOME/.local/lib/lilrae-opencode-1.19.5"
"$HOME/.local/lib/lilrae-opencode-1.19.5/opencode" --version
For a wheel-only installation, use the official 1.19.5 archive. Read the build identities and verification contract. Before extraction, calculate the archive SHA-256 digest. Compare it with the reference digest.
Install the executable in an operator-owned directory.
Calculate the executable SHA-256 digest.
Compare it with the reference digest.
Pass its absolute path to OpenCodeOptions.executable.
Configure and invoke¶
Set the approved model and credential-variable reference in the project:
{
"experiment": {
"participant_models": {"opencode": "openrouter/approved-vendor/approved-model"},
"participant_credential_sources": {
"opencode": {"kind": "process-environment", "variable": "APPROVED_MODEL_CREDENTIAL"}
}
}
}
Replace the example model with an approved selection. Pass the selected credential through the approved environment source. Never put it in a command argument, prompt, or project JSON file.
Read the factory contract. Set the absolute executable and an operator-owned work root outside the checkout. Pass the configured model, credential source, and explicit source-environment mapping.
Do these steps separately for each participant address:
- Create
opencode_manifest(version=...)fromaptl.backends.lilrae_participant_configuration. - Realize the seven manifest targets through RAES
realize_participant_configuration(). - Resolve the prompt through the experiment's admitted artifact owner.
- Create
OpenCodeParticipantRequestfromaptl.workbench.opencode_bootstrapwith the admitted configuration, manifest, prompt, reference, and model domain. - Pass it to
managed_opencode_executor()from the same module. - Bind the executor and its configuration digest through
LilraeParticipantBinding. - Admit the bindings through
ScenarioAdmissionSource.autonomous_bindings. - Execute with
run_participant_workload()and the existing experiment evaluator. - Cancel and drain the runtime before you leave the managed executor context.
See the OpenCode reference for these contracts.