# RFantibody
Design antibody and VHH CDR loops against an antigen epitope with RFdiffusion-Ab.
- Job type: `RFANTIBODY`
- Task: Binder design
- Price: 10 credits per 100 designs
- Workload: A fixed number of designs; time scales with the count.
- Automatic routing: RFantibody diffuses CDR loops onto a supplied framework against the epitope.
- Behavior and limits: Antigen chain defaults to 'T', not 'A', because it uses HLT-format structures.
- Hotspot input: `params.hotspots`, author numbered
- Source: Baker Lab, RosettaCommons (https://github.com/RosettaCommons/RFantibody)
- Paper: Bennett et al., Atomically accurate de novo design of antibodies with RFdiffusion. bioRxiv 2024.

## Example

### CLI

```bash
phi jobs submit RFANTIBODY \
  --input target_pdb=@target.pdb \
  --input target_chain_id=T \
  --input framework_pdb=@framework.pdb \
  --param hotspots=A150,A154,A156 \
  --param num_designs=20 \
  --param design_loops="<design_loops>" \
  --param seqs_per_design=1 \
  --wait --out out
```

### Python

```python
from phi import PhiClient

with PhiClient() as phi:
    target_pdb = phi.files.upload(path="target.pdb")
    framework_pdb = phi.files.upload(path="framework.pdb")
    job = phi.jobs.submit(
        "RFANTIBODY",
        inputs={
        "target_pdb_gcs_uri": target_pdb,
        "target_chain_id": "T",
        "framework_pdb_gcs_uri": framework_pdb
        },
        params={
        "hotspots": [
                "A150",
                "A154",
                "A156"
        ],
        "num_designs": 20,
        "design_loops": "<design_loops>",
        "seqs_per_design": 1
        },
    )
    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": "RFANTIBODY",
  "inputs": {
    "target_pdb_gcs_uri": "<gs:// uri from POST /v1/uploads/url>",
    "target_chain_id": "T",
    "framework_pdb_gcs_uri": "<gs:// uri from POST /v1/uploads/url>"
  },
  "params": {
    "hotspots": [
      "A150",
      "A154",
      "A156"
    ],
    "num_designs": 20,
    "design_loops": "<design_loops>",
    "seqs_per_design": 1
  }
}'
```

## 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. |
| `num_designs` (essential) | integer | `20` | Antibody backbones to diffuse (RFdiffusion-Ab -n). |
| `design_loops` (essential) | string | `null` | CDR loop-length spec (RFdiffusion-Ab -l), e.g. 'H1:7,H2:6,H3:5-13,L1:8-13,L2:7,L3:9-11'. Omit to use the framework's loops. |
| `hotspots` (essential) | list of string |  | Target epitope hotspot residue IDs (max 12), e.g. ['T305','T456']. |
| `seqs_per_design` (essential) | integer | `1` | ProteinMPNN sequences per backbone (proteinmpnn -n). |
| `mpnn_temperature` | number | `0.1` | ProteinMPNN sampling temperature (proteinmpnn -t). |
| `num_recycles` | integer | `10` | RF2 recycling iterations (rf2 -r). |
| `pae_filter` | number | `null` | Optional maximum RF2 interaction PAE. Designs above the threshold are omitted from sequences.json; unset returns every scored design. |
| `seed` | integer | `null` | Random seed for reproducible RF2 prediction. |
| `deterministic` | boolean | `false` | Enable deterministic RFdiffusion-Ab and ProteinMPNN sampling. |

## Inputs

| Name | Type | Default | Description |
|---|---|---|---|
| `target_pdb` | string | `null` | Target structure as base64-encoded PDB (CIF is auto-converted). Provide this or target_pdb_gcs_uri. |
| `target_pdb_gcs_uri` (essential) | string | `null` | gs:// URI to the target PDB. Provide this or target_pdb. |
| `target_chain_id` (essential) | string | `"T"` | Chain ID of the target in the antigen PDB (RFantibody HLT convention). |
| `framework_pdb` | string | `null` | Antibody framework scaffold as base64-encoded PDB in HLT format (heavy=H, light=L, target=T chains). Provide this or framework_pdb_gcs_uri. |
| `framework_pdb_gcs_uri` (essential) | string | `null` | gs:// URI to the HLT-format framework PDB. Provide this or framework_pdb. |

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