# RFD4-Proteina
Co-design structure and sequence with RFD4-Proteina: protein binders, antibody/VHH CDRs, motif scaffolds, partial-diffusion refinement and inverse folding in one model.
- Job type: `RFD4_PROTEINA`
- Task: Binder design
- Price: 45 credits per design
- Workload: A fixed number of designs; time scales with the count.
- Behavior and limits: `task` selects the mode and which fields apply. Outputs are full-atom complexes with sequences, so no separate inverse-folding step is needed; `task=spec` runs an RFD4 YAML condition spec verbatim.
- Hotspot input: `params.hotspots`, author numbered
- Source: Baker Lab and NVIDIA, RosettaCommons (https://github.com/RosettaCommons/RFD4-Proteina)
- Paper: Corley, Didi, Kazman, Brent et al., Biomolecular design through latent reasoning with RFD4-Proteina. preprint 2026.

## Example

### CLI

```bash
phi jobs submit RFD4_PROTEINA \
  --input target_cif=@target.cif \
  --input target_chain_id=A \
  --input framework_cif=@framework.cif \
  --param task=binder \
  --param num_designs=1 \
  --param hotspots=A150,A154,A156 \
  --param binder_length_min=70 \
  --wait --out out
```

### Python

```python
from phi import PhiClient

with PhiClient() as phi:
    target_cif = phi.files.upload(path="target.cif")
    framework_cif = phi.files.upload(path="framework.cif")
    job = phi.jobs.submit(
        "RFD4_PROTEINA",
        inputs={
        "target_cif_gcs_uri": target_cif,
        "target_chain_id": "A",
        "framework_cif_gcs_uri": framework_cif
        },
        params={
        "task": "binder",
        "num_designs": 1,
        "hotspots": [
                "A150",
                "A154",
                "A156"
        ],
        "binder_length_min": 70
        },
    )
    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": "RFD4_PROTEINA",
  "inputs": {
    "target_cif_gcs_uri": "<gs:// uri from POST /v1/uploads/url>",
    "target_chain_id": "A",
    "framework_cif_gcs_uri": "<gs:// uri from POST /v1/uploads/url>"
  },
  "params": {
    "task": "binder",
    "num_designs": 1,
    "hotspots": [
      "A150",
      "A154",
      "A156"
    ],
    "binder_length_min": 70
  }
}'
```

## 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. |
| `binder_length_min` (essential) | integer | `70` | Minimum designed binder length. |
| `binder_length_max` (essential) | integer | `100` | Maximum designed binder length. |
| `task` (essential) | string one of binder, antibody, motif_scaffold, partial_diffusion, inverse_folding, unconditional, spec | `"binder"` | Design task: binder (de novo protein binder), antibody (CDR design onto a VHH/Fv framework), motif_scaffold (scaffold a contig from an input structure), partial_diffusion (refine an input structure), inverse_folding (resample sequence on a fixed backbone), unconditional (a de novo monomer of binder_length_min..max residues, no input), or spec (run an RFD4 YAML condition spec verbatim). |
| `num_designs` (essential) | integer | `1` | Designs per input example (RFD4 num_replicates). A spec task multiplies this by the number of design keys in the file. |
| `seed` | integer | `null` | Random seed; unset samples a fresh seed. |
| `thinking` (essential) | string one of low, medium, high | `null` | Trunk recycling budget (RFD4 'thinking level'): low, medium or high. Higher raises pass rates and roughly halves throughput. Unset uses medium; the schedule shape follows the task. |
| `recycle_strategy` | string one of low/flat, low/midpeak, low/front_loaded, medium/flat, medium/midpeak, medium/front_loaded, high/flat, high/midpeak, high/front_loaded | `null` | Advanced: exact RFD4 recycle preset '<low\|medium\|high>/<flat\|midpeak\|front_loaded>'. Overrides the task's shape; must agree with `thinking` when both are set. |
| `num_steps` | integer | `60` | Flow-matching integration steps. |
| `backbone_temperature_k` | number | `16` | Backbone TSR temperature control (tsr_k; RFD4 default 16). Higher is colder. |
| `sequence_temperature_k` | number | `4` | Sequence/sidechain latent TSR temperature control (tsr_k; RFD4 default 4). Higher is colder. |
| `deterministic_ode` | boolean | `false` | Deterministic ODE sampling with no mid-trajectory noise injection. |
| `refold` (essential) | boolean | `true` | Refold every design with the selected oracle and report RFD4's refolding metrics and pass criterion. False computes inline design metrics only. |
| `oracle` | string one of af3, of3 | `"of3"` | Refolding oracle weights: of3 (OpenFold3 ported weights, the default) or af3 (AlphaFold 3 weights, when mounted). Used only when refold is true. |
| `rfd4_batch_size` | integer | `1` | Designs generated in parallel on the GPU (RFD4 batch_size). |
| `compile` | boolean | `null` | torch.compile the trunk. Unset compiles only when the job generates 16 or more designs; the warm-up costs minutes. |
| `save_pdb` | boolean | `false` | Also emit PDB alongside CIF outputs. |
| `hydra_overrides` | list of string |  | Advanced: RFD4 Hydra 'key=value' overrides forwarded verbatim (generation.*, search.*, metrics_tags, recycle_strategy, nn.*). |
| `metrics_tags` | list of string | `null` | Advanced: replace the task's computed RFD4 metrics_tags list. |
| `hotspots` (essential) | list of string |  | Target hotspot residues (max 12), author numbering, e.g. ['A56', 'A115:CG,SD']. A bare residue selects its sidechain heavy atoms. |
| `sample_hotspot_patches` | boolean | `null` | Resample a fresh 2-3 atom hotspot patch around the given hotspots for every design (RFD4 SampleNearbyHotspots; needs at least one hotspot as the seed). Unset: on for antibody when hotspots are given, off otherwise. |
| `target_conditioning` | string one of internal_backbone, fixed_backbone, fixed_all_atom | `"internal_backbone"` | How the target is given to the model: internal_backbone keeps the target backbone's internal geometry and sequence while its pose stays free (RFD4's PPI recommendation); fixed_backbone pins backbone coordinates; fixed_all_atom pins every target atom. |
| `design_loops` (essential) | string | `null` | CDR loops to design with length ranges, e.g. 'H1:7,H2:6,H3:5-13'. Unset designs every CDR at its framework length -2..+2 (H3: -3..+5). |
| `contig` | string | `null` | RFD4 contig over the input structure (author numbering), e.g. 'A1-50, LINK:10-30, /0, BINDER:60-90'. Required for motif_scaffold. |
| `fix_motif_sequence` | boolean | `true` | Fix the identity of every preserved contig residue (C_SEQ). |
| `unindex_motif` | boolean | `false` | Let the model place the preserved segments anywhere along the chain (C_IDX false, one index group). |
| `conditions` | object | `null` | Advanced: RFD4 'conditions' mapping merged over the generated defaults, e.g. {'C_SEC': {'HELIX': [{'select': "sel('*/LINK')"}]}}. |
| `partial_fraction` | number | `0.3` | Fraction of the trajectory to rerun from the noised input (RFD4 partial_trajectory_fraction_steps). 0.3 stays close to the input; larger drifts. |
| `keep_conditions` | boolean | `true` | Reuse the conditions saved in an RFD4-generated input CIF (hotspots, fixed regions). False treats the input as a plain structure. |

## Inputs

| Name | Type | Default | Description |
|---|---|---|---|
| `design_spec_files` | list of SpecFile | `null` | Design-spec bundle: the entry YAML plus every file it references (scaffold YAMLs, target/framework structures), each tagged with its relative path. Provide a design spec via this, design_spec_gcs_prefix, or design_spec_yaml. |
| `design_spec_entry` | string | `null` | Relative path (within the bundle) of the YAML to run with `boltzgen run`. Defaults to the sole top-level *.yaml when unambiguous. |
| `design_spec_gcs_prefix` | string | `null` | gs:// prefix whose objects already mirror the design-spec bundle tree (alternative to design_spec_files for large/reused frameworks). Use with design_spec_entry. |
| `design_spec_yaml` (essential) | string | `null` | Inline single-file design spec with no external file references. Sugar for a one-file design_spec_files bundle. |
| `target_chain_id` (essential) | string | `"A"` | Auth chain ID(s) of the target in the structure. A single chain ('A') or a comma-separated list ('V,W') for a multi-chain target. Omit when target_crop names the chains. |
| `target_crop` | string | `null` | Target crop range(s) in unambiguous 'Chain:Start-End' format ('A7:17-209'), comma-separated per chain for multi-chain targets. Legacy forms such as 'V14-107,W14-107' remain accepted. Omit to use the full target chain(s). |
| `target_cif` | string | `null` | Target structure as base64-encoded CIF (preferred). Falls back to target_cif_gcs_uri, then target_pdb / target_pdb_gcs_uri. |
| `target_cif_gcs_uri` (essential) | string | `null` | gs:// URI to the target CIF. |
| `target_pdb` | string | `null` | Target structure as base64-encoded PDB (CIF is auto-converted). |
| `target_pdb_gcs_uri` | string | `null` | gs:// URI to the target PDB. |
| `framework_cif` | string | `null` | Antibody framework (VHH or Fv) as base64-encoded CIF. Provide one of framework_cif, framework_cif_gcs_uri, framework_pdb, framework_pdb_gcs_uri. |
| `framework_cif_gcs_uri` (essential) | string | `null` | gs:// URI to the framework CIF. |
| `framework_pdb` | string | `null` | Antibody framework as base64-encoded PDB (converted to CIF). |
| `framework_pdb_gcs_uri` | string | `null` | gs:// URI to the framework PDB. |
| `framework_heavy_chain_id` | string | `"H"` | Heavy-chain ID in the framework structure. |
| `framework_light_chain_id` | string | `null` | Light-chain ID in the framework structure; omit for a VHH. |
| `structure_cif` | string | `null` | Starting structure for motif_scaffold, partial_diffusion or inverse_folding as base64-encoded CIF. Provide one of structure_cif, structure_cif_gcs_uri, structure_pdb, structure_pdb_gcs_uri, or design_set. |
| `structure_cif_gcs_uri` | string | `null` | gs:// URI to the starting CIF. |
| `structure_pdb` | string | `null` | Starting structure as base64-encoded PDB (converted to CIF). |
| `structure_pdb_gcs_uri` | string | `null` | gs:// URI to the starting PDB. |
| `structure_binder_chain_id` | string | `null` | Binder chain in an uploaded starting structure. Required for motif_scaffold, partial_diffusion and inverse_folding unless design_set supplies the chain roles. |
| `structure_target_chain_ids` | list of string | `null` | Target chains in an uploaded starting structure. Required with structure_binder_chain_id; an empty list is a monomer. |
| `design_set` | object | `null` | Start from one Phi design instead of an uploaded structure: {'design_ids': ['<uuid>']} naming a generated structure in this project. The new structure is recorded as its child. |

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