From foundry
Run ProteinMPNN, LigandMPNN, SolubleMPNN, or Enhanced MPNN sequence design on a Vast.ai GPU instance. Use when the user wants to design protein sequences for a given backbone structure, redesign sequences around ligands, optimize for solubility, or maximize designability.
How this skill is triggered — by the user, by Claude, or both
Slash command
/foundry:mpnnThis 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 ProteinMPNN/LigandMPNN/SolubleMPNN/Enhanced MPNN sequence design 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 design, retrieve results, and clean up.
You are an autonomous agent that runs ProteinMPNN/LigandMPNN/SolubleMPNN/Enhanced MPNN sequence design 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 design, retrieve results, and clean up.
$ARGUMENTS
These are lightweight inverse-folding models for fixed-backbone protein sequence design:
CLI: mpnn --model_type <TYPE> --structure_path <FILE> [OPTIONS]
Or from JSON: mpnn --config_json config.json
Docker image: Pre-built with all tools, checkpoints (including Enhanced MPNN), 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:
batch_size x number_of_batches| Scenario | model_type | Checkpoint | is_legacy_weights |
|---|---|---|---|
| Standard protein redesign | protein_mpnn | proteinmpnn_v_48_020.pt | True |
| Design around small molecules/DNA/ions | ligand_mpnn | ligandmpnn_v_32_010_25.pt | True |
| Optimize for E. coli expression / reduce aggregation | protein_mpnn | solublempnn_v_48_020.pt | True |
| De novo binder/enzyme design (recommended) | ligand_mpnn | enhanced_mpnn_step_80000.pt | not needed |
| Maximize designability / validation pass rate | ligand_mpnn | enhanced_mpnn_step_80000.pt | not needed |
Enhanced MPNN is recommended for most de novo design pipelines (RFD3 → MPNN → RF3). It uses ResiDPO (Residue-level Designability Preference Optimization) to optimize directly for AlphaFold2/RF3 validation success rather than native sequence recovery. Key improvements:
Use standard MPNN/LigandMPNN when sequence recovery (similarity to native) matters or when benchmarking against published results.
If the user has a JSON config, read and confirm. If not, help create one or build the CLI command.
For Enhanced MPNN (recommended for de novo design):
{
"checkpoint_path": "/root/.foundry/checkpoints/enhanced_mpnn_step_80000.pt",
"model_type": "ligand_mpnn",
"out_directory": "./outputs/",
"inputs": [
{
"structure_path": "backbone.cif",
"name": "design_1",
"seed": 42,
"batch_size": 1,
"number_of_batches": 8,
"temperature": 0.1,
"designed_chains": ["B"],
"fixed_chains": ["A"]
}
]
}
For ProteinMPNN:
{
"checkpoint_path": "/root/.foundry/checkpoints/proteinmpnn_v_48_020.pt",
"model_type": "protein_mpnn",
"is_legacy_weights": true,
"out_directory": "./outputs/",
"inputs": [
{
"structure_path": "backbone.pdb",
"name": "design_1",
"seed": 42,
"batch_size": 1,
"number_of_batches": 10,
"temperature": 0.1,
"designed_chains": ["B"],
"fixed_chains": ["A"]
}
]
}
For LigandMPNN:
{
"checkpoint_path": "/root/.foundry/checkpoints/ligandmpnn_v_32_010_25.pt",
"model_type": "ligand_mpnn",
"is_legacy_weights": true,
"out_directory": "./outputs/",
"inputs": [
{
"structure_path": "complex.cif",
"name": "ligand_design",
"batch_size": 1,
"number_of_batches": 10,
"temperature": 0.1,
"designed_chains": ["A"],
"fixed_chains": ["B"]
}
]
}
Key parameters:
structure_path — Input backbone structure (PDB/CIF)model_type — protein_mpnn or ligand_mpnncheckpoint_path — Path to weights (use full path on instance)is_legacy_weights — true for original repository weights (ProteinMPNN, LigandMPNN, SolubleMPNN). Not needed for Enhanced MPNN.batch_size — Sequences per batch (default 1)number_of_batches — Number of batches (default 1)temperature — 0.1 (conservative) to 0.3+ (diverse). Default 0.1.designed_chains — Chains to redesignfixed_chains — Chains to keep fixeddesigned_residues — Specific residue indices to designfixed_residues — Specific residue indices to fixomit — Amino acids to exclude (default: ["UNK"])bias — Per-residue logit biasessymmetry_residues — For symmetric designhomo_oligomer_chains — For homo-oligomer designstructure_noise — Add noise to backbone coords (default 0.0)Ask the user with AskUserQuestion if the model type or design scope is unclear.
vastai show ssh-keys
Check local keys:
ls -la ~/.ssh/id_ed25519 ~/.ssh/id_rsa ~/.ssh/id_ecdsa 2>/dev/null
Store key path as SSH_KEY.
MPNN is lightweight. A small GPU is sufficient:
vastai search offers 'gpu_ram>=16 num_gpus=1 reliability>0.9 disk_space>=32' -o 'dph_total' --raw
For cost savings, even smaller works:
vastai search offers 'gpu_ram>=8 num_gpus=1 reliability>0.9' -o 'dph_total' --raw
Present options and confirm cost with user.
Use the pre-built Foundry Docker image. No onstart-cmd needed — all checkpoints including Enhanced MPNN are pre-installed.
vastai create instance <OFFER_ID> \
--image <FOUNDRY_DOCKER_IMAGE> \
--disk 32 \
--ssh \
--label 'foundry-mpnn-<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:
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 mpnn && foundry list-installed'
Upload structure files and config:
tar czf - -C <LOCAL_DIR> <INPUT_FILES...> | \
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'mkdir -p /workspace/mpnn_job && tar xzf - -C /workspace/mpnn_job/'
From JSON config:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'cd /workspace/mpnn_job && mpnn --config_json /workspace/mpnn_job/config.json \
> /workspace/mpnn_job/mpnn.log 2>&1'
From CLI — Enhanced MPNN:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'mpnn \
--model_type ligand_mpnn \
--checkpoint_path /root/.foundry/checkpoints/enhanced_mpnn_step_80000.pt \
--structure_path /workspace/mpnn_job/<STRUCTURE> \
--out_directory /workspace/mpnn_job/outputs/ \
--batch_size 1 \
--number_of_batches 8 \
--temperature 0.1 \
> /workspace/mpnn_job/mpnn.log 2>&1'
From CLI — ProteinMPNN:
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'mpnn \
--model_type protein_mpnn \
--checkpoint_path /root/.foundry/checkpoints/proteinmpnn_v_48_020.pt \
--is_legacy_weights True \
--structure_path /workspace/mpnn_job/<STRUCTURE> \
--out_directory /workspace/mpnn_job/outputs/ \
--batch_size 1 \
--number_of_batches 10 \
--temperature 0.1 \
> /workspace/mpnn_job/mpnn.log 2>&1'
MPNN is fast — most jobs complete in under a minute. Run directly (no nohup needed for typical jobs).
ssh -i $SSH_KEY -o StrictHostKeyChecking=no -p <PORT> root@<HOST> \
'tar czf - -C /workspace/mpnn_job outputs/' | \
tar xzf - -C <LOCAL_RESULTS_DIR>
Check what was generated:
ls -la <LOCAL_RESULTS_DIR>/outputs/
Show designed sequences to user:
cat <LOCAL_RESULTS_DIR>/outputs/*.fasta
Always destroy the instance:
vastai destroy instance <ID>
Provide the user with:
is_legacy_weights=True for original weights (not needed for Enhanced MPNN)vastai show instances to find by labelnpx claudepluginhub liorz/foundry-claude-skill --plugin foundryDesigns therapeutic proteins using RFdiffusion backbone generation, ProteinMPNN sequence optimization, and structure validation with ESMFold/AlphaFold2. Useful for protein binders, scaffolds, enzyme variants, and miniprotein design.
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.