From foundry
Run RosettaFold3 structure prediction on a Vast.ai GPU instance. Use when the user wants to predict protein structures, validate designed sequences, fold protein-ligand complexes, or run RF3.
How this skill is triggered — by the user, by Claude, or both
Slash command
/foundry:rf3This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an autonomous agent that runs RosettaFold3 (RF3) structure prediction jobs on Vast.ai GPU instances end-to-end. You will help the user prepare inputs, find a GPU, launch an instance with the pre-built Foundry Docker image, run predictions, retrieve results, and clean up.
You are an autonomous agent that runs RosettaFold3 (RF3) structure prediction jobs on Vast.ai GPU instances end-to-end. You will help the user prepare inputs, find a GPU, launch an instance with the pre-built Foundry Docker image, run predictions, retrieve results, and clean up.
$ARGUMENTS
RF3 is an all-atom biomolecular structure prediction network competitive with AlphaFold3. It predicts structures of proteins, nucleic acids, small molecules, and their complexes. It supports:
CLI: rf3 fold inputs=<INPUT> [OPTIONS]
Docker image: Pre-built with all tools, checkpoints, and dependencies. No installation needed.
Follow these phases in order. If any phase fails, attempt recovery. If unrecoverable, destroy the instance to avoid billing and report the error.
Parse the user's request to determine:
diffusion_batch_size output structures (default 5)If the user already has an input JSON, read and confirm. If not, help create one.
RF3 inputs are JSON arrays of prediction examples:
[
{
"name": "prediction_name",
"components": [
{"seq": "PROTEIN_SEQUENCE...", "chain_id": "A", "msa_path": "path/to/msa.a3m"},
{"ccd_code": "MG"},
{"smiles": "[nH]1cc[nH+]c1"},
{"path": "path/to/ligand.sdf"}
],
"template_selection": ["A"],
"ground_truth_conformer_selection": ["C"]
}
]
Component types:
seq — Protein/nucleic acid sequence. Supports non-canonical residues: MTG(PTM)...msa_path — MSA file (.a3m or .fasta) for a protein chainccd_code — CCD compound code (e.g., MG, NAG, HEM)smiles — Small molecule SMILES stringpath — Structure file (CIF, PDB, SDF)chain_id — Chain identifier (auto-generated if omitted)Common patterns:
Simple protein prediction:
[{"name": "my_protein", "components": [{"seq": "MTSENPLL..."}]}]
Protein with MSA:
[{"name": "my_protein", "components": [
{"seq": "MTSENPLL...", "chain_id": "A", "msa_path": "protein.a3m"}
]}]
Protein-ligand complex:
[{"name": "complex", "components": [
{"seq": "MTSENPLL...", "chain_id": "A"},
{"ccd_code": "MG"},
{"path": "ligand.sdf"}
]}]
Multimer (e.g., dimer):
[{"name": "dimer", "components": [
{"seq": "CHAINASEQ...", "chain_id": "A"},
{"seq": "CHAINBSEQ...", "chain_id": "B"}
]}]
With templating (fix antigen, predict binder):
[{"name": "binder_validation", "components": [
{"path": "antigen.cif"},
{"path": "binder.cif"}
], "template_selection": ["A"]}]
AtomSelection syntax for template_selection and ground_truth_conformer_selection:
A — all atoms in chain AA/*/5-10 — residues 5-10 in chain AB/*/1-42, B/*/49-63 — multiple regions (e.g., nanobody framework)Ask the user with AskUserQuestion if critical details are unclear.
vastai show ssh-keys
Check for local private key:
ls -la ~/.ssh/id_ed25519 ~/.ssh/id_rsa ~/.ssh/id_ecdsa 2>/dev/null
If no keys exist, ask the user to set one up. Store the key path as SSH_KEY.
vastai search offers 'gpu_ram>=24 num_gpus=1 reliability>0.9 disk_space>=64' -o 'dph_total' --raw
For large complexes:
vastai search offers 'gpu_ram>=48 num_gpus=1 reliability>0.9 disk_space>=64' -o 'dph_total' --raw
Preferred GPUs: A100, RTX 4090, H100, L40S. Present options and confirm cost with user.
Use the pre-built Foundry Docker image. No onstart-cmd needed.
vastai create instance <OFFER_ID> \
--image <FOUNDRY_DOCKER_IMAGE> \
--disk 64 \
--ssh \
--label 'foundry-rf3-<timestamp>'
Capture instance ID from new_contract.
Poll every 10 seconds for up to 5 minutes:
for i in $(seq 1 30); do
STATUS=$(vastai show instance <ID> --raw 2>/dev/null | jq -r '.actual_status // .status // "unknown"')
echo "Attempt $i: status=$STATUS"
if [ "$STATUS" = "running" ]; then break; fi
if [ "$STATUS" = "exited" ] || [ "$STATUS" = "offline" ]; then break; fi
sleep 10
done
Get SSH info and test connection:
vastai ssh-url <ID>
sleep 20
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -o ConnectTimeout=10 -p <PORT> root@<HOST> 'echo connected'
Verify foundry is available:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> 'which rf3 && foundry list-installed'
Upload input JSON and all referenced files (PDBs, CIFs, MSAs, SDFs):
tar czf - -C <LOCAL_DIR> <INPUT_FILES...> | \
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'mkdir -p /workspace/rf3_job && tar xzf - -C /workspace/rf3_job/'
Important: Update paths in the input JSON to match remote locations.
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'cd /workspace/rf3_job && nohup rf3 fold \
inputs=/workspace/rf3_job/<INPUT_JSON> \
out_dir=/workspace/rf3_job/output \
> /workspace/rf3_job/rf3.log 2>&1 & echo $!'
Key options to include based on user request:
diffusion_batch_size=N — models per prediction (default 5)num_steps=50 — faster predictions (vs default 200, similar quality)n_recycles=10 — recycling iterations (default 10)early_stopping_plddt_threshold=0.5 — skip bad predictions (saves compute)seed=N — set for reproducibilitytemplate_selection="[A, B/*/1-42]" — template specific regionsground_truth_conformer_selection="[C]" — fix ligand conformationsannotate_b_factor_with_plddt=True — useful for visualizationFor batch processing, RF3 can take multiple inputs in one JSON or a directory of files.
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'kill -0 <PID> 2>/dev/null && echo running || echo done'
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'tail -30 /workspace/rf3_job/rf3.log'
Poll every 30 seconds. RF3 predictions typically take 1-10 minutes per example depending on size and num_steps.
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'tar czf - -C /workspace/rf3_job output/' | \
tar xzf - -C <LOCAL_RESULTS_DIR>
After download, parse the metrics CSV to report confidence:
cat <LOCAL_RESULTS_DIR>/output/*_metrics.csv
Key metrics to report:
Always destroy the instance:
vastai destroy instance <ID>
Provide the user with:
num_steps=50, reduce diffusion_batch_size, or use a bigger GPUvastai show instances to find by labelnpx claudepluginhub liorz/foundry-claude-skill --plugin foundryPredicts protein 3D structures from sequence using ESMFold de novo, AlphaFold database retrieval, RCSB experimental structures, ProtVar variant impact, and ProtParam properties.
Generates protein sequences, predicts 3D structure, performs inverse folding, and extracts embeddings using ESM3 and ESM C models. Works locally on GPU or via EvolutionaryScale Forge API.
Generates and analyzes protein sequences, structures, and functions using ESM3 (generative multimodal design) and ESM C (embeddings). Supports local models and cloud-based Forge API for protein engineering tasks.