# ESM-IF1
Inverse-fold a backbone with ESM-IF1: design sequences for one chain, or score existing sequences against the backbone. A GPU alternative to PROTEINMPNN.
- Job type: `ESM_IF1`
- Task: Sequence design
- Price: 1 credit per 32 backbones
- Behavior and limits: Designs one chain per pass. Takes its structure under `pdb`/`pdb_gcs_uri`. `mode=score` writes per-residue negative log-likelihoods (lower is better).
- Source: pending
- Paper: citation pending

## Example

### CLI

```bash
phi jobs submit ESM_IF1 \
  --input pdb=@structure.pdb \
  --input binder_chain_id=A \
  --input target_chain_id=A \
  --param mode=design \
  --param num_seq_per_target=4 \
  --param sampling_temp=1 \
  --param multichain_backbone=true \
  --wait --out out
```

### Python

```python
from phi import PhiClient

with PhiClient() as phi:
    pdb = phi.files.upload(path="structure.pdb")
    job = phi.jobs.submit(
        "ESM_IF1",
        inputs={
        "pdb_gcs_uri": pdb,
        "binder_chain_id": "A",
        "target_chain_id": "A"
        },
        params={
        "mode": "design",
        "num_seq_per_target": 4,
        "sampling_temp": 1,
        "multichain_backbone": true
        },
    )
    print(phi.jobs.wait(job.job_id).status)
```

### HTTP

```bash
curl -X POST https://api.dynophi.com/v1/jobs \
  -H "x-api-key: $PHI_KEY" -H "content-type: application/json" \
  -d '{
  "job_type": "ESM_IF1",
  "inputs": {
    "pdb_gcs_uri": "<gs:// uri from POST /v1/uploads/url>",
    "binder_chain_id": "A",
    "target_chain_id": "A"
  },
  "params": {
    "mode": "design",
    "num_seq_per_target": 4,
    "sampling_temp": 1,
    "multichain_backbone": true
  }
}'
```

## Parameters

| Name | Type | Default | Description |
|---|---|---|---|
| `gpu` | string one of a100, t4, a100_80gb, h100, a100_or_h100, a100_80gb_or_h100, a100_preferred, h100_preferred | `null` | Per-job GPU class override. |
| `mode` (essential) | string one of design, score | `"design"` | 'design' samples num_seq_per_target sequences per backbone. 'score' returns the per-residue negative log-likelihood (lower is better) for each caller-supplied inputs.sequences entry on the backbone; num_seq_per_target and sampling_temp are ignored. |
| `num_seq_per_target` (essential) | integer | `4` | Sequences to sample per input backbone (ESM-IF1 --num-samples). |
| `sampling_temp` (essential) | number | `1` | Sampling temperature (ESM-IF1 --temperature). Upstream's default is 1.0; unlike ProteinMPNN there is no near-deterministic setting. |
| `multichain_backbone` (essential) | boolean | `true` | Condition on the whole complex and design only the binder chain. False designs the binder chain in isolation, discarding target context. |
| `batch_size` | integer | `64` | (backbone, sample) rows per forward pass under mode=fast (kit --batch_size). A throughput/VRAM knob only — batch composition does not change the draws. The kit does not fall back to a smaller batch on OOM, it fails the pass. |
| `seed` | integer | `37` | Sampling seed under mode=fast (kit --seed), which selects the sampled sequences: fast repeats by the seed alone. Reported NOT APPLIED under mode=off, which upstream leaves unseeded. |
| `opt_mode` | string one of off, fast | `"fast"` | Optimization-kit mode. 'fast' is the kit's accelerated batched sampler; 'off' runs stock ESM-IF1 and is the kill switch. There is no 'exact' mode for this model. |

## Inputs

| Name | Type | Default | Description |
|---|---|---|---|
| `pdb` | string | `null` | Backbone structure as base64-encoded PDB. Provide this or pdb_gcs_uri. |
| `pdb_gcs_uri` (essential) | string | `null` | gs:// URI to the backbone PDB. Provide this or pdb. |
| `binder_chain_id` (essential) | string | `"A"` | Chain ID of the binder to design. |
| `target_chain_id` (essential) | string | `"A"` | Chain ID of the (fixed) target. |
| `designed_chain_ids` | list of string | `null` | The single chain to design (ESM-IF1 designs one chain per pass). Mutually exclusive with binder_chain_id / target_chain_id. |
| `sequences` (essential) | list of ESMIf1ScoreSequence | `null` | Caller sequences scored against the backbone (params.mode='score'). Each entry carries a name and exactly one of sequence (scored 1:1), alignment (explicit two-track), or oligomer_alignment (one shared sequence across every chain of a homo-oligomer); names must be unique. Omit for design mode. |

---
Source: https://dynophi.com/docs/models/ESM_IF1. From the live API schema and phi-api's model catalog, 2026-11-23.