> ## Documentation Index
> Fetch the complete documentation index at: https://proto.evodesign.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# RFD4-Proteina

> [RFD4-Proteina](https://github.com/RosettaCommons/RFD4-Proteina) is a generative model from the Institute for Protein Design and NVIDIA that designs protein sequences and all-atom structures jointly. It supports unconstrained generation, motif scaffolding, binder design, enzyme design, and fixed-backbone sequence design.

![RFD4-Proteina](https://proto-bio.github.io/proto-assets/images/tool/rfd4/hero.png)[![](https://mintcdn.com/bio-pro/_UGa2jUMKeVPCbLk/assets/images/cached/6c4da2f317fc.png?fit=max\&auto=format\&n=_UGa2jUMKeVPCbLk\&q=85\&s=e0eec78648cb6cc4938f40ab18608b31) IPD](https://proto.evodesign.org/docs/tools/organizations/institute-for-protein-design.md) [![](https://mintcdn.com/bio-pro/HNsZvj6f9nz_ewfp/assets/images/cached/e6d687cf4821.png?fit=max\&auto=format\&n=HNsZvj6f9nz_ewfp\&q=85\&s=e0609b9aba9a1d5e08532b56b495692f) NVIDIA](https://proto.evodesign.org/docs/tools/organizations/nvidia.md)

> [!NOTE]
>
> **License:** RFD4-Proteina is open source and free for academic and commercial use under a BSD-3-Clause license. Please refer to [the license](https://github.com/RosettaCommons/RFD4-Proteina/blob/main/LICENSE) for full terms.

Proto is not affiliated with Institute for Protein Design and NVIDIA. This toolkit is open source and builds on the implementations produced by these organizations. Product names, logos, and trademarks are the property of their respective owners.

***

&#x20;GitHub GitHub ![](https://huggingface.co/front/assets/huggingface_logo-noborder.svg) HuggingFace![](https://huggingface.co/front/assets/huggingface_logo-noborder.svg) HuggingFace  Website Website  Preprint Preprint  Cite Cite  Tool Source Tool Source  Open as Notebook Open as Notebook  Run Locally Run Locally

![RosettaCommons/RFD4-Proteina](https://opengraph.githubassets.com/1/RosettaCommons/RFD4-Proteina)

&#x20;RosettaCommons/RFD4-Proteina

&#x20;View repo

[Open](https://github.com/RosettaCommons/RFD4-Proteina)

![RFD4-Proteina](https://cdn-thumbnails.huggingface.co/social-thumbnails/models/nvidia/RFD4-Proteina.png)

![](https://huggingface.co/front/assets/huggingface_logo-noborder.svg) RFD4-Proteina

[Open](https://huggingface.co/nvidia/RFD4-Proteina)

![nvidia](https://cdn-thumbnails.huggingface.co/social-thumbnails/models/datasets/nvidia.png)

![](https://huggingface.co/front/assets/huggingface_logo-noborder.svg) nvidia

[Open](https://huggingface.co/datasets/nvidia/RFD4-Proteina)

&#x20;rfd4-proteina.org

&#x20;Visit website

[Open](https://rfd4-proteina.org/)

[ Read preprint](https://rfd4-proteina.org/assets/paper/RFD4-Proteina.pdf)

@articlecorley2026rfd4proteina

```bibtex theme={null}
@article{corley2026rfd4proteina,
  title={Biomolecular design through latent reasoning with {RFD4-Proteina}},
  author={Corley, Nathaniel and Didi, Kieran and Kazman, Maxwell W. and Brent, Rafael I. and Bauer, Magnus S. and Biswas, Riti and Bonzanini, Julia E. and Chazin-Gray, Adam M. and Chen, Jie and Favor, Andrew and Gantz, Maximilian and Jones, Henry A. and Kim, Paul and Lunn-Halbert, Margaret C. and McNamara-Bordewick, Nora K. and Salike, Saman and See, D{\'e}Jena{\'e} L. and Sharma, Shajesh and Sun, Eric and Venkatesh, Preetham and Woodbury, Seth M. and Wu, Kejia and Zhang, Yuyang and Allen, Joel D. and Butcher, Jasper and Chang, Lemuel and Cho, Yehlin and Courbet, Alexis and Coventry, Brian and Dallago, Christian and Delfosse, Elliot S. and Eisenach, Helen E. and Garcia Sanchez, Mariana and Geffner, Tomas and Goreshnik, Inna and Greisen, Per and Kim, David E. and Kim, Donghyo and King, Brianne R. and Krishna, Rohith and Li, Yanjing and Li, Zi Ming and Muraishi, Aiko and Muratspahi{\'c}, Edin and Nagl, Oliver and Rangel, Griffin H. and Ruder, Antonia and Shin, Hojeong and Xu, Zefei and Yang, Yuwei and Crispin, Max and King, Neil P. and DiMaio, Frank and Bhardwaj, Gaurav and Bronstein, Michael and Kreis, Karsten and Hilvert, Donald and Green, Anthony P. and Vahdat, Arash and Baker, David},
  year={2026},
  note={Preprint},
  url={https://rfd4-proteina.org/assets/paper/RFD4-Proteina.pdf}
}
```

&#x20;Copy citation

![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678)

evo-design/proto-tools

&#x20;View source

[Open](https://github.com/evo-design/proto-tools/tree/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4)

Open Notebook

&#x20;Open notebook

[Open](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/examples/example.ipynb)

[![proto-tools on GitHub](https://opengraph.githubassets.com/1/evo-design/proto-tools)](https://github.com/evo-design/proto-tools)

Run locally with proto-tools

```bash theme={null}
pip install git+https://github.com/evo-design/proto-tools.git
```

Toolkit contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)

| Function | Description | |
| - | - | - |
| `run_rfd4_design()` | Joint sequence and all-atom structure design with RFD4-Proteina (GPU) | [ Docs](#api-run-rfd4-design) [ Source](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/rfd4_design.py#L1371) |
| `run_rfd4_inverse_folding()` | All-atom sequence and sidechain design on a fixed backbone with RFD4-Proteina (GPU) | [ Docs](#api-run-rfd4-inverse-folding) [ Source](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/rfd4_inverse_folding.py#L117) |

## Background

RFD4-Proteina ([Corley et al., 2026](https://rfd4-proteina.org/assets/paper/RFD4-Proteina.pdf)) uses a flow-based generative framework to model biomolecular sequences and three-dimensional structures. Its central contribution is a shared representation of molecular geometry and chemical identity, allowing sequence and structure to be generated together rather than treated as separate prediction problems.

The model uses a partially latent representation. Polymer backbones are represented by explicit anchor coordinates, such as the Cα atoms of proteins, while additional residue-level features encode chemical identity and local conformation. An associated autoencoder converts these latent features into amino acid sequences and all-atom structures. Atomized components, including small-molecule ligands, retain information about their constituent atoms and chemical connectivity.

RFD4-Proteina builds on the Proteina line of models and incorporates several architectural and training improvements. Its training data extend beyond experimentally determined structures to include predicted structures and physically simulated conformations, broadening the range of molecular systems represented during training. The model also uses more extensive pairwise representations and recurrent updates during generation.

Two approaches allow additional computation to be applied during inference. The first, termed *intrinsic reasoning* by the authors, repeatedly updates intermediate representations during individual generative steps. Increasing these recurrent updates gives the model additional opportunities to refine the evolving structure. The second, *extrinsic reasoning*, uses search over candidate generation trajectories, selecting candidates according to external structural, geometric, or energetic scores. The latter is supported upstream but is not exposed through this Proto toolkit.

The authors report improved performance across several computational protein-design benchmarks, including protein binding, small-molecule binding, enzyme design, and DNA binding. For example, the reported clustered pass rates for small-molecule and DNA binding were 14.3% and 3.5%, respectively, compared with 2.4% and 0.5% for the corresponding RFdiffusion3 comparisons. These are computational success metrics based on structural and predictive criteria, rather than direct measurements of experimental binding or activity. The paper also presents separate experimental validation of selected designs.

For practical design workflows, the principal advantage is the joint generation of sequence and structure. RFD4-Proteina produces an all-atom model with its corresponding sequence, avoiding the need to run a separate inverse-folding model simply to assign amino acid identities to a generated backbone. The resulting designs should still be evaluated independently, for example through structure prediction, sequence analysis, or experimental characterization.

The model supports a range of conditioning options, including fixed and flexible structural motifs, sequence constraints, target hotspots, ligand interactions, solvent exposure, hydrogen-bond roles, secondary structure, CATH fold classifications, and specified amino acid probabilities. These are documented in the upstream [annotations reference](https://github.com/RosettaCommons/RFD4-Proteina/blob/main/docs/reference/annotations.md). Symmetry-conditioned generation is not currently supported.

### Learning Resources

* [RFD4-Proteina documentation](https://rfd4-proteina.org/latest/) — Official documentation covering model inputs, conditioning, generation settings, and example workflows.
* [RFD4-Proteina model card](https://huggingface.co/nvidia/RFD4-Proteina) — Model weights, checkpoint information, training details, and licensing.
* [RFD4-Proteina on NVIDIA build](https://build.nvidia.com/ipd/rfd4-proteina) — Hosted inference endpoint for running the model without managing a local GPU environment.

## Tools

### RFD4-Proteina Design (`rfd4-design`)

Generates protein sequences and all-atom structures according to the constraints specified in each `RFD4DesignSpec`. Each specification represents an independent design task and produces `num_replicates` candidate designs. Results are returned as `RFD4Designs` collections, with one collection corresponding to each input specification.

#### API Reference

[ Source](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/rfd4_design.py#L617)

> [accordion] Input: RFD4Input
>
> **design\_specs** `List[RFD4DesignSpec]`
>
> Independent design tasks, each with its own input structure and constraints. Processed in a single run.
>
> **RFD4DesignSpec**
>
> **input\_structure** `Structure` *required*
>
> Starting structure. RFD4 requires one even for unconditional generation, and consumes bonds and formal charges, so the implementation always hands it a CIF (PDB input is converted automatically).
>
> **input\_as\_annotated\_cif** `boolean` (default: False)
>
> When `True`, load `input_structure` as-is and preserve condition annotations it already carries (e.g. a prior RFD4 output, for refinement or partial diffusion). When `False` (default), treat it as a raw structure: add heavy atoms, convert MSE to MET, and ignore any existing conditioning.
>
> **contig** `string`
>
> Design topology as one comma-separated token string, e.g. `"50-120, /0, A17-131"` (a de novo 50-120 residue binder chain, then the whole target). Tokens: `/0` chainbreak; `A42-48` preserved input segment; `A52` a single preserved residue; `20-30` an unnamed expandable segment; `E1:2-20` a named expandable segment (the name becomes its `res_name` so conditions can select it). An expandable segment may carry a trailing `P`/`R`/`D` chain type, so `10R` is a ten-residue RNA segment rather than ten repeats; it defaults to the run's anchor chain type and is rejected when it disagrees with it. Omit to keep the whole input. A contig must contain at least one preserved segment, since there is no `length` field. The token forms match RFdiffusion3's, but the semantics do not: residue ids resolve against `label_seq_id` and a preserved segment is mandatory. RFdiffusion1's slash-separated contigs are an unrelated grammar.
>
> **residue\_numbering** `enum` (default: auth)
>
> How residue ids in `contig` and selections are read. `'auth'` (default) is the author numbering shown in PDB files and used elsewhere in proto-tools; the implementation translates it to the mmCIF `label_seq_id` RFD4 resolves against. `'label'` passes ids through untouched, for annotated-CIF inputs already in label numbering.
>
> Available options: `auth`, `label`
>
> **fixed\_coordinates** `array`
>
> Selections whose real coordinates are given to the model (indexed motif scaffolding). Pair with `is_protein_backbone` to fix a backbone without revealing its sequence.
>
> **free\_coordinates** `array`
>
> Selections whose coordinate conditioning is cleared. Needed before moving atoms into a `rigid_groups` entry.
>
> **known\_sequence** `array`
>
> Selections whose residue identity is revealed to the model (folding, or a known target chain).
>
> **free\_sequence** `array`
>
> Selections whose residue identity is designed rather than revealed.
>
> **hotspots** `array`
>
> Target-interface atoms the designed binder should engage. Trained as target atoms within 4.5 Å of any binder atom, so select the specific sidechain atoms to contact.
>
> **rigid\_groups** `Dict[integer, List[string]]`
>
> Internal-coordinate groups keyed by group id (`1`-`32767`). Atoms in one group have known relative geometry but no fixed global pose — the standard way to give a binder target its backbone shape while leaving the dock free. Geometry is unknown across groups.
>
> **unindexed\_groups** `Dict[string, List[string]]`
>
> Unindexed motif groups keyed by a label you choose. Selections sharing a label keep their relative offsets but the model chooses where they sit in the chain — active-site scaffolding.
>
> **burial** `Dict[enum, List[string]]`
>
> Target burial per selection, keyed by `BURIED` / `INTERMEDIATE` / `EXPOSED` / `UNSPECIFIED`.
>
> **hbond** `Dict[enum, List[string]]`
>
> Requested hydrogen-bond role, keyed by `DONOR` / `ACCEPTOR` / `BOTH` / `NONE`. `BOTH` asks for donation and acceptance in different bonds; separate entries do not combine.
>
> **pi\_stacking** `array`
>
> Selections requesting aromatic stacking. Select every atom of the intended ring.
>
> **pi\_cation** `Dict[enum, List[string]]`
>
> Requested π-cation role, keyed by `AROMATIC` / `CATION` / `BOTH` / `NONE`. `AROMATIC` describes the selected atoms, not the desired partner.
>
> **secondary\_structure** `Dict[enum, List[string]]`
>
> Requested secondary structure, keyed by `HELIX` / `SHEET` / `LOOP` / `NONE`.
>
> **fold\_class** `Dict[string, List[string]]`
>
> CATH class/architecture/topology label keyed by a quoted C.A.T string (`"2.60.40"`, `"1.x.x"`; `"x.x.x"` clears it). Labels are checked against the checkpoint's vocabulary at runtime. Select a whole chain or domain.
>
> **chain\_centroid** `Dict[string, List[string]]`
>
> Target chain centre of mass keyed by an `"x,y,z"` string in Ångströms. Per chain and all-or-nothing: each selection must cover an entire chain, and either every chain gets a centroid or none does.
>
> **sequence\_probabilities** `array`
>
> Per-identity sequence probability constraints, e.g. `probability=0.0` on `CYS` to request a cysteine-free design. Values specified on one residue may not sum above 1.
>
> **raw\_conditions** `Dict[string, any]`
>
> Escape hatch merged last into the compiled `conditions` mapping, for conditions without a typed field above (e.g. `C_SALT`, `C_HPHOB`, `C_MCOORD`, `C_NTR`). Uses the upstream shape `{alias: {value: [{"select": query}]}}`. Residue ids in raw conditions are **not** translated — write them in label numbering.
>
> **raw\_json** `string`
>
> Raw upstream condition-spec JSON for callers who need conditions without a typed field. When set, `design_specs` is ignored and the JSON is forwarded as-is, so `input` paths must already point at CIF files and residue ids must already be in label numbering.

[ Source](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/rfd4_design.py#L1013)

> [accordion] Config: RFD4DesignConfig
>
> **guidance\_w** `number` (default: 1.0)
>
> Classifier-free guidance weight. `1.0` is no guidance; `0.0` excludes the main model.
>
> **partial\_trajectory\_fraction\_steps** `number`
>
> Run only the final fraction of the trajectory, to refine or diversify an input rather than generate from scratch. `0.3` runs the last 30% and stays close to the input; higher values drift further. Mutually exclusive with the `partial_t_*` settings.
>
> **partial\_t\_backbone** `number`
>
> Starting corruption level for the backbone, in `(0, 1)`. Note the inverted sense relative to `partial_trajectory_fraction_steps`: values near `1` stay close to the input, near `0` approach full generation.
>
> **partial\_t\_latent** `number`
>
> Starting corruption level for the sidechain/sequence latents, in `(0, 1)`, with the same inverted sense.
>
> **couple\_partial\_t** `boolean` (default: False)
>
> Derive the unset modality's corruption level from the one that is set, through the default schedule coupling.
>
> **verbose** `integer` (default: 0)
>
> Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). `True` is coerced to `1` and `False` to `0`.
>
> **device** `string` (default: cuda)
>
> Execution device. `rfd4-generate` builds its Lightning trainer with `accelerator="gpu"` unconditionally, so a GPU is required.
>
> **timeout** `integer` (default: 3600)
>
> Maximum execution time in seconds. `None` waits indefinitely.
>
> **seed** `integer`
>
> Random seed. When set, tools run reproducibly up to small GPU float noise (see `BaseToolOutput.approx_equal`), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
>
> **num\_replicates** `integer` (default: 1)
>
> Designs generated per input spec.
>
> **batch\_size** `integer` (default: 1)
>
> Designs denoised in parallel on the GPU. Confirm the longest input fits at `1` before raising it.
>
> **nsteps** `integer` (default: 60)
>
> Integration steps per design (upstream default 60). A `recycle_strategy` preset expands to exactly 60 steps and upstream requires the two to agree, so changing this requires `recycle_strategy=None`.
>
> **recycle\_strategy** `string` (default: thinking\_medium)
>
> Trunk recycling schedule as `<low|medium|high>/<flat|midpeak|front_loaded>`, trading compute for quality. `midpeak` totals 120/150/180 trunk passes; `flat` and `front_loaded` total 120/180/300. The `thinking_*` aliases are the front-loaded schedules. Setting any preset pins `nsteps` to 60. `None` disables the schedule and runs a fixed recycle depth of 0, which is the only way to use a custom `nsteps`.
>
> **backbone\_sampling** `RFD4SamplerTuning`
>
> Temperature for the backbone modality.
>
> **RFD4SamplerTuning**
>
> **tsr\_k** `number`
>
> Temporal score-rescaling sharpness; higher `k` is a lower temperature. Upstream defaults are `16.0` for the backbone and `4.0` for the latent modality.
>
> **tsr\_sigma** `number`
>
> How quickly sharpening takes effect; higher is faster. Upstream defaults are `3.0` for the backbone and `12.0` for the latents.
>
> **noise\_scale** `number`
>
> Injected-noise variance multiplier (upstream default `1.0`). Note that `0.0` removes noise but retains stochastic drift, so it is not equivalent to deterministic sampling.
>
> **sequence\_sampling** `RFD4SamplerTuning`
>
> Temperature for the sidechain/sequence latent modality. Lowering `tsr_k` raises sequence diversity.
>
> **RFD4SamplerTuning**
>
> **tsr\_k** `number`
>
> Temporal score-rescaling sharpness; higher `k` is a lower temperature. Upstream defaults are `16.0` for the backbone and `4.0` for the latent modality.
>
> **tsr\_sigma** `number`
>
> How quickly sharpening takes effect; higher is faster. Upstream defaults are `3.0` for the backbone and `12.0` for the latents.
>
> **noise\_scale** `number`
>
> Injected-noise variance multiplier (upstream default `1.0`). Note that `0.0` removes noise but retains stochastic drift, so it is not equivalent to deterministic sampling.
>
> **deterministic\_sampling** `boolean` (default: False)
>
> Switch both modalities to ODE integration, with no mid-trajectory noise injection.
>
> **model\_checkpoint** `string` (default: nvidia/RFD4-Proteina)
>
> HuggingFace repo id or a local model-bundle directory. The denoiser and its matching autoencoder always load together.
>
> **model\_revision** `string` (default: a06e2509c7033b010fc43614e9fd840303588502)
>
> HuggingFace commit to pin, for reproducible loads. Ignored when `model_checkpoint` is a local directory.
>
> **adapter\_path** `string`
>
> Local PEFT/LoRA adapter directory, loaded onto the base and autoencoder pair it was fine-tuned against.
>
> **use\_torch\_compile** `boolean` (default: False)
>
> Compile the trunk across the upstream length buckets. Off by default: the first call otherwise pays a long compile across 15 buckets, which only pays off for large runs.
>
> **save\_trajectory\_every** `integer` (default: 0)
>
> Snapshot the trajectory every N steps. `0` disables. Rejected unless `output_dir` is set.
>
> **output\_dir** `string`
>
> Directory for run outputs; `None` uses a tempdir. Each call writes into a fresh `run-<id>` subdirectory of it, so a reused `output_dir` cannot return a previous run's designs, and the trajectory frames for a run land in that run's own subdirectory. The `<id>` is random and is deliberately not returned, since a per-run path in the output would break seeded reproducibility; locate a run by directory mtime, or pass a fresh `output_dir` per call.

[ Source](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/rfd4_design.py#L1241)

> [accordion] Output: RFD4Output
>
> **designed\_structures** `List[RFD4Designs]`
>
> One bundle per input spec, in input order. Total design count is at most `len(design_specs) * num_replicates`; a spec that produced nothing contributes an empty bundle.
>
> **RFD4Designs**
>
> **spec\_key** `string` *required*
>
> Identifier of the spec that produced these designs. Positional (`"spec-0"`) for typed specs, or the caller's key under `raw_json`.
>
> **designs** `List[RFD4Design]`
>
> The designs generated for this spec, in the order RFD4 emitted them. Length is `num_replicates` for a spec that generated successfully, and `0` for a spec that produced nothing.

#### Applications

Use `rfd4-design` when both the protein sequence and structure are design variables. Applications include de novo protein generation, binder design against specified target sites, scaffolding of structural or functional motifs, enzyme active-site design, and generation conditioned on fold class or solvent exposure.

The tool also supports partial diffusion, allowing an existing design to be modified rather than generated entirely from scratch. Fixed-coordinate motifs can be used when their positions must be preserved, while internal-coordinate constraints allow motifs to retain their internal geometry without fixing their global orientation.

Because the model generates sequences alongside structures, designs can proceed directly to independent evaluation without a separate inverse-folding stage. A useful initial assessment is to predict the structure from the generated sequence and compare the result with the designed structure.

#### Usage Tips

* **Input structures and file formats.** The Proto implementation accepts both PDB and mmCIF structures and prepares an mmCIF input for RFD4-Proteina. The upstream implementation requires mmCIF because PDB files do not reliably preserve all of the chemical connectivity and formal-charge information required by the model. During normal input preparation, the Proto implementation also standardizes chain identifiers so selections refer to the expected chains. Setting `input_as_annotated_cif=True` bypasses this conversion and preserves the supplied mmCIF, including existing conditioning annotations. Use this option for annotated structures produced by previous RFD4 runs.

* **Residue numbering.** RFD4-Proteina resolves residue selections using the mmCIF `label_seq_id` field rather than the author-provided `auth_seq_id` numbering. By default, Proto uses `residue_numbering="auth"` and translates selections into the numbering used by the prepared input. This is convenient when working from PDB files or structures whose displayed residue numbers differ from their internal indices. Set `residue_numbering="label"` when specifying `label_seq_id` values directly. Annotated mmCIF inputs are passed through without translation, and selections supplied through `raw_conditions` are likewise not modified. Check the numbering in the actual mmCIF whenever using either option.

* **Contig specification.** The `contig` field defines which parts of an input structure are retained and where new residues may be generated. Its comma-separated syntax resembles that of RFdiffusion3: `A42-48` retains an existing segment, `20-30` defines an expandable segment, and `/0` separates output chains. RFD4 additionally supports named expandable segments such as `E1:2-20`, single-residue selections such as `A52`, and polymer-type suffixes such as `10R` for an RNA segment. Preserved residues are selected using the original input's `label_seq_id` values, and output chain assignment follows the upstream contig rules. A contig must include at least one preserved segment; fully de novo generation instead requires an appropriately prepared input structure, such as an annotated expandable-chain template. Older specification fields, including `length`, `symmetry`, `unindex`, and `select_*`, are not supported. Omitting `contig` retains the full input structure.

* **Combining conditions.** Different conditioning types can interact. Fixing sidechain coordinates also constrains the corresponding sequence identity, while atomized components such as ligands and modified residues retain their chemical identities. Within a condition, overlapping selections are applied in order, with later entries taking precedence. Absolute and internal-coordinate conditioning cannot be applied simultaneously to the same atom. To move an atom from a fixed-coordinate region into a `rigid_groups` region, first release its absolute-coordinate constraint using `free_coordinates`. Ligands and modified residues should also have valid bond orders, including explicit Kekulized aromatic bonds rather than generic `AROMATIC` bonds.

* **Recycling and inference settings.** `recycle_strategy` controls the number and distribution of recurrent model evaluations during generation. The available schedules combine a computational budget (`low`, `medium`, or `high`) with a distribution (`flat`, `midpeak`, or `front_loaded`). The `midpeak` schedules use 120, 150, or 180 trunk evaluations, while the `flat` and `front_loaded` schedules use 120, 180, or 300. The `thinking_low`, `thinking_medium`, and `thinking_high` aliases correspond to the front-loaded schedules. By default, `thinking_medium` performs 180 evaluations across 60 integration steps. All recycling presets require `nsteps=60`, and the implementation validates this combination before execution. Set `recycle_strategy=None` to disable the preset schedule and specify a different number of integration steps.

* **Choosing an inference budget.** The released recycling presets are the recommended settings for design generation. Shorter runs without recycling can be useful for verifying that an input is valid and that the execution environment works, but they should not be assumed to produce comparable design quality. In local testing, a run with `recycle_strategy=None` and `nsteps=20` produced a degenerate poly-alanine sequence. This observation does not establish that every shortened run will fail, but it provides a reason to avoid treating minimal test configurations as production settings. For less expensive generation using the supported schedules, start with a `low` preset.

* **Partial diffusion.** Partial diffusion generates a modified design by beginning from an existing structure partway through the generative process. The implementation exposes two alternative controls. `partial_trajectory_fraction_steps` specifies the fraction of the trajectory to execute, while `partial_t_backbone` and `partial_t_latent` specify the starting levels of corruption for the corresponding modalities. The direction of these controls differs: a smaller trajectory fraction preserves more of the input, whereas larger values of the `partial_t_*` controls correspond to lower corruption. The two interfaces cannot be used together. When refining an earlier RFD4 design, `input_as_annotated_cif=True` preserves its existing conditioning information.

* **Sequence probabilities.** `sequence_probabilities` allows individual residue identities to be encouraged, constrained, or excluded. For example, setting the probability of `CYS` to `0.0` explicitly excludes cysteine at the selected positions. Amino acid identities without specified probabilities remain unconstrained and share the remaining probability mass. The probabilities assigned to a residue cannot sum to more than 1.

### RFD4-Proteina Inverse Folding (`rfd4-inverse-folding`)

Generates amino acid sequences and sidechain conformations for a specified protein backbone. The backbone is held fixed during design, while the model samples compatible sequence identities and sidechain geometries. Each replicate provides a candidate sequence together with its corresponding all-atom structure.

#### API Reference

[ Source](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/rfd4_design.py#L617)

> [accordion] Input: RFD4Input
>
> **design\_specs** `List[RFD4DesignSpec]`
>
> Independent design tasks, each with its own input structure and constraints. Processed in a single run.
>
> **RFD4DesignSpec**
>
> **input\_structure** `Structure` *required*
>
> Starting structure. RFD4 requires one even for unconditional generation, and consumes bonds and formal charges, so the implementation always hands it a CIF (PDB input is converted automatically).
>
> **input\_as\_annotated\_cif** `boolean` (default: False)
>
> When `True`, load `input_structure` as-is and preserve condition annotations it already carries (e.g. a prior RFD4 output, for refinement or partial diffusion). When `False` (default), treat it as a raw structure: add heavy atoms, convert MSE to MET, and ignore any existing conditioning.
>
> **contig** `string`
>
> Design topology as one comma-separated token string, e.g. `"50-120, /0, A17-131"` (a de novo 50-120 residue binder chain, then the whole target). Tokens: `/0` chainbreak; `A42-48` preserved input segment; `A52` a single preserved residue; `20-30` an unnamed expandable segment; `E1:2-20` a named expandable segment (the name becomes its `res_name` so conditions can select it). An expandable segment may carry a trailing `P`/`R`/`D` chain type, so `10R` is a ten-residue RNA segment rather than ten repeats; it defaults to the run's anchor chain type and is rejected when it disagrees with it. Omit to keep the whole input. A contig must contain at least one preserved segment, since there is no `length` field. The token forms match RFdiffusion3's, but the semantics do not: residue ids resolve against `label_seq_id` and a preserved segment is mandatory. RFdiffusion1's slash-separated contigs are an unrelated grammar.
>
> **residue\_numbering** `enum` (default: auth)
>
> How residue ids in `contig` and selections are read. `'auth'` (default) is the author numbering shown in PDB files and used elsewhere in proto-tools; the implementation translates it to the mmCIF `label_seq_id` RFD4 resolves against. `'label'` passes ids through untouched, for annotated-CIF inputs already in label numbering.
>
> Available options: `auth`, `label`
>
> **fixed\_coordinates** `array`
>
> Selections whose real coordinates are given to the model (indexed motif scaffolding). Pair with `is_protein_backbone` to fix a backbone without revealing its sequence.
>
> **free\_coordinates** `array`
>
> Selections whose coordinate conditioning is cleared. Needed before moving atoms into a `rigid_groups` entry.
>
> **known\_sequence** `array`
>
> Selections whose residue identity is revealed to the model (folding, or a known target chain).
>
> **free\_sequence** `array`
>
> Selections whose residue identity is designed rather than revealed.
>
> **hotspots** `array`
>
> Target-interface atoms the designed binder should engage. Trained as target atoms within 4.5 Å of any binder atom, so select the specific sidechain atoms to contact.
>
> **rigid\_groups** `Dict[integer, List[string]]`
>
> Internal-coordinate groups keyed by group id (`1`-`32767`). Atoms in one group have known relative geometry but no fixed global pose — the standard way to give a binder target its backbone shape while leaving the dock free. Geometry is unknown across groups.
>
> **unindexed\_groups** `Dict[string, List[string]]`
>
> Unindexed motif groups keyed by a label you choose. Selections sharing a label keep their relative offsets but the model chooses where they sit in the chain — active-site scaffolding.
>
> **burial** `Dict[enum, List[string]]`
>
> Target burial per selection, keyed by `BURIED` / `INTERMEDIATE` / `EXPOSED` / `UNSPECIFIED`.
>
> **hbond** `Dict[enum, List[string]]`
>
> Requested hydrogen-bond role, keyed by `DONOR` / `ACCEPTOR` / `BOTH` / `NONE`. `BOTH` asks for donation and acceptance in different bonds; separate entries do not combine.
>
> **pi\_stacking** `array`
>
> Selections requesting aromatic stacking. Select every atom of the intended ring.
>
> **pi\_cation** `Dict[enum, List[string]]`
>
> Requested π-cation role, keyed by `AROMATIC` / `CATION` / `BOTH` / `NONE`. `AROMATIC` describes the selected atoms, not the desired partner.
>
> **secondary\_structure** `Dict[enum, List[string]]`
>
> Requested secondary structure, keyed by `HELIX` / `SHEET` / `LOOP` / `NONE`.
>
> **fold\_class** `Dict[string, List[string]]`
>
> CATH class/architecture/topology label keyed by a quoted C.A.T string (`"2.60.40"`, `"1.x.x"`; `"x.x.x"` clears it). Labels are checked against the checkpoint's vocabulary at runtime. Select a whole chain or domain.
>
> **chain\_centroid** `Dict[string, List[string]]`
>
> Target chain centre of mass keyed by an `"x,y,z"` string in Ångströms. Per chain and all-or-nothing: each selection must cover an entire chain, and either every chain gets a centroid or none does.
>
> **sequence\_probabilities** `array`
>
> Per-identity sequence probability constraints, e.g. `probability=0.0` on `CYS` to request a cysteine-free design. Values specified on one residue may not sum above 1.
>
> **raw\_conditions** `Dict[string, any]`
>
> Escape hatch merged last into the compiled `conditions` mapping, for conditions without a typed field above (e.g. `C_SALT`, `C_HPHOB`, `C_MCOORD`, `C_NTR`). Uses the upstream shape `{alias: {value: [{"select": query}]}}`. Residue ids in raw conditions are **not** translated — write them in label numbering.
>
> **raw\_json** `string`
>
> Raw upstream condition-spec JSON for callers who need conditions without a typed field. When set, `design_specs` is ignored and the JSON is forwarded as-is, so `input` paths must already point at CIF files and residue ids must already be in label numbering.

[ Source](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/rfd4_inverse_folding.py#L34)

> [accordion] Config: RFD4InverseFoldingConfig
>
> **verbose** `integer` (default: 0)
>
> Verbosity level (0=quiet, 1=info, 2=debug, 3=raw subprocess stderr). `True` is coerced to `1` and `False` to `0`.
>
> **device** `string` (default: cuda)
>
> Execution device. `rfd4-generate` builds its Lightning trainer with `accelerator="gpu"` unconditionally, so a GPU is required.
>
> **timeout** `integer` (default: 3600)
>
> Maximum execution time in seconds. `None` waits indefinitely.
>
> **seed** `integer`
>
> Random seed. When set, tools run reproducibly up to small GPU float noise (see `BaseToolOutput.approx_equal`), and the seed participates in cache keys. When None, cacheable seed-sensitive tools skip cache until seeded.
>
> **num\_replicates** `integer` (default: 1)
>
> Designs generated per input spec.
>
> **batch\_size** `integer` (default: 1)
>
> Designs denoised in parallel on the GPU. Confirm the longest input fits at `1` before raising it.
>
> **nsteps** `integer` (default: 60)
>
> Integration steps per design (upstream default 60). A `recycle_strategy` preset expands to exactly 60 steps and upstream requires the two to agree, so changing this requires `recycle_strategy=None`.
>
> **recycle\_strategy** `string` (default: thinking\_medium)
>
> Trunk recycling schedule as `<low|medium|high>/<flat|midpeak|front_loaded>`, trading compute for quality. `midpeak` totals 120/150/180 trunk passes; `flat` and `front_loaded` total 120/180/300. The `thinking_*` aliases are the front-loaded schedules. Setting any preset pins `nsteps` to 60. `None` disables the schedule and runs a fixed recycle depth of 0, which is the only way to use a custom `nsteps`.
>
> **backbone\_sampling** `RFD4SamplerTuning`
>
> Temperature for the backbone modality.
>
> **RFD4SamplerTuning**
>
> **tsr\_k** `number`
>
> Temporal score-rescaling sharpness; higher `k` is a lower temperature. Upstream defaults are `16.0` for the backbone and `4.0` for the latent modality.
>
> **tsr\_sigma** `number`
>
> How quickly sharpening takes effect; higher is faster. Upstream defaults are `3.0` for the backbone and `12.0` for the latents.
>
> **noise\_scale** `number`
>
> Injected-noise variance multiplier (upstream default `1.0`). Note that `0.0` removes noise but retains stochastic drift, so it is not equivalent to deterministic sampling.
>
> **sequence\_sampling** `RFD4SamplerTuning`
>
> Temperature for the sidechain/sequence latent modality. Lowering `tsr_k` raises sequence diversity.
>
> **RFD4SamplerTuning**
>
> **tsr\_k** `number`
>
> Temporal score-rescaling sharpness; higher `k` is a lower temperature. Upstream defaults are `16.0` for the backbone and `4.0` for the latent modality.
>
> **tsr\_sigma** `number`
>
> How quickly sharpening takes effect; higher is faster. Upstream defaults are `3.0` for the backbone and `12.0` for the latents.
>
> **noise\_scale** `number`
>
> Injected-noise variance multiplier (upstream default `1.0`). Note that `0.0` removes noise but retains stochastic drift, so it is not equivalent to deterministic sampling.
>
> **deterministic\_sampling** `boolean` (default: False)
>
> Switch both modalities to ODE integration, with no mid-trajectory noise injection.
>
> **model\_checkpoint** `string` (default: nvidia/RFD4-Proteina)
>
> HuggingFace repo id or a local model-bundle directory. The denoiser and its matching autoencoder always load together.
>
> **model\_revision** `string` (default: a06e2509c7033b010fc43614e9fd840303588502)
>
> HuggingFace commit to pin, for reproducible loads. Ignored when `model_checkpoint` is a local directory.
>
> **adapter\_path** `string`
>
> Local PEFT/LoRA adapter directory, loaded onto the base and autoencoder pair it was fine-tuned against.
>
> **use\_torch\_compile** `boolean` (default: False)
>
> Compile the trunk across the upstream length buckets. Off by default: the first call otherwise pays a long compile across 15 buckets, which only pays off for large runs.
>
> **save\_trajectory\_every** `integer` (default: 0)
>
> Snapshot the trajectory every N steps. `0` disables. Rejected unless `output_dir` is set.
>
> **output\_dir** `string`
>
> Directory for run outputs; `None` uses a tempdir. Each call writes into a fresh `run-<id>` subdirectory of it, so a reused `output_dir` cannot return a previous run's designs, and the trajectory frames for a run land in that run's own subdirectory.

[ Source](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/rfd4_design.py#L1241)

> [accordion] Output: RFD4Output
>
> **designed\_structures** `List[RFD4Designs]`
>
> One bundle per input spec, in input order. Total design count is at most `len(design_specs) * num_replicates`; a spec that produced nothing contributes an empty bundle.
>
> **RFD4Designs**
>
> **spec\_key** `string` *required*
>
> Identifier of the spec that produced these designs. Positional (`"spec-0"`) for typed specs, or the caller's key under `raw_json`.
>
> **designs** `List[RFD4Design]`
>
> The designs generated for this spec, in the order RFD4 emitted them. Length is `num_replicates` for a spec that generated successfully, and `0` for a spec that produced nothing.

#### Applications

Use `rfd4-inverse-folding` to design alternative sequences for an existing protein structure. Inputs may include experimentally determined structures, predicted structures, or backbones generated by tools such as `rfd4-design` and `rfdiffusion3-design`.

The tool can also be used when sidechain packing is important, since it returns sidechain coordinates together with the designed sequence. It offers an alternative to `proteinmpnn-sample`, `ligandmpnn-sample`, and `fampnn-sample`, particularly for applications that benefit from joint modeling of sequence and all-atom geometry. As with other inverse-folding methods, the resulting sequences should be evaluated before making claims about stability, expression, or function.

#### Usage Tips

* **Sequence diversity.** The `sequence_sampling.tsr_k` parameter controls the sharpness of sequence sampling. Larger values produce more concentrated sampling, while smaller values generally allow greater sequence diversity. The upstream default is `4.0`; reducing this toward `2.0` can provide more varied candidates, although their predicted quality may differ. Generate multiple replicates when exploring alternative sequences for the same backbone.

* **Sequence and structural conditions.** Inverse folding supports conditions defined in `RFD4DesignSpec`, including fixed amino acid identities through `known_sequence`, solvent-exposure constraints through `burial`, and residue exclusions through `sequence_probabilities`. Settings intended specifically for unconstrained or partially constrained structural generation, such as `guidance_w` and partial-diffusion controls, are exposed through `rfd4-design` rather than this tool.

* **Input structure completeness.** Use a structure with well-resolved coordinates and appropriate chemical information. Missing atoms or incomplete sidechains may affect how the model interprets its fixed structural context. For example, local testing with a cropped PD-L1 target derived from PDB 5O45, containing 15 unresolved sidechain atoms across six residues, produced a Cα-only poly-alanine output. The same behavior was observed with the upstream command-line implementation. This particular structure is used as a binder-design target and should not be treated as a representative inverse-folding input. Inspect structural completeness and the resulting designs before interpreting their sequences.

## Toolkit Notes

The general Proto guides for tool persistence, device management, parallel execution, and cloud inference apply to both `rfd4-design` and `rfd4-inverse-folding`.

* **Symmetry support.** RFD4-Proteina does not currently support symmetry-conditioned generation. For the design of symmetric protein assemblies, use [`rfdiffusion3-design`](https://bio-pro.mintlify.app/tools/structure-design/rfdiffusion3).

* **Hardware requirements.** This toolkit requires a CUDA-enabled GPU. The upstream `rfd4-generate` implementation initializes its Lightning trainer with GPU acceleration, so selecting `device="cpu"` does not provide a CPU inference path. The environment setup also requires Linux x86\_64, a CUDA-capable system, and an NVIDIA driver with a major version of at least 525.

* **Model weights and checkpoints.** The default checkpoint is available from [`nvidia/RFD4-Proteina`](https://huggingface.co/nvidia/RFD4-Proteina) without an access request. Model files are downloaded automatically when needed. The denoising model and its corresponding autoencoder must be loaded as a compatible pair. `model_revision` can be used to select a specific Hugging Face revision for reproducibility. If `adapter_path` is provided, the adapter must be compatible with the selected base checkpoint and autoencoder.

* **Model persistence.** Generation runs in-process rather than through the `rfd4-generate` command-line entry point, so a persistent worker loads the checkpoint once and reuses it. The first call in a worker pays the load; later calls do not. In local testing on an H200, three sequential designs took 37s, 13s, and 13s. Batch work therefore benefits from running inside `ToolInstance.persist_tool("rfd4-design")`. Changing `model_checkpoint`, `model_revision`, `adapter_path`, or `use_torch_compile` restarts the worker, since each of those is fixed at load time. Each worker is also pinned to its assigned GPU and is restarted rather than moved if the device changes.

* **GPU memory.** Memory requirements depend on input size, sequence length, and `batch_size`. Test the longest intended design at `batch_size=1` before increasing parallelism. If a run exceeds available GPU memory, reducing the batch size is generally the first adjustment to make.

* **Model compilation.** `use_torch_compile` is disabled by default. When enabled, the implementation compiles the model for multiple sequence-length buckets, introducing substantial initial compilation overhead. Compilation may be worthwhile for repeated or large-scale inference, but offers less benefit for short runs.

* **Evaluating designs.** RFD4 outputs do not include a calibrated confidence score indicating whether a design will fold or function as intended. Independent structure prediction, for example with [`boltz2-prediction`](https://bio-pro.mintlify.app/tools/structure-prediction/boltz2) or [`esmfold-prediction`](https://bio-pro.mintlify.app/tools/structure-prediction/esmfold), can help assess consistency between the designed sequence and generated structure. Each `RFD4Design` includes a `complex` object suitable for downstream analysis. Use `chain_sequence_map()` or `chain_sequences` to access sequences across molecular entities. `extract_protein_chains()` returns only protein chains and therefore omits DNA and RNA chains.

* **Output organization.** Results are grouped by input specification. `designed_structures` contains one `RFD4Designs` collection per specification, in the original input order. Each collection contains up to `num_replicates` designs. If a specification produces no designs, its collection remains empty rather than changing the position of subsequent results.

* **Reproducibility.** Generation is stochastic, and `seed` can be used to control random sampling. Repeated inverse-folding runs with the same seed produced identical sequences and structures in local tests. Exact reproducibility is not guaranteed across different hardware or software environments. `deterministic_sampling=True` changes both modalities to ODE integration, avoiding additional noise injection during the trajectory, but does not guarantee bitwise reproducibility in every environment. For most design applications, evaluating several independent candidates is preferable to relying on a single output.

* **Features not exposed by this toolkit.** The current implementation does not expose upstream reward-guided beam search, `rfd4-evaluate`, antibody or VHH-specific workflows, or the Diffusers interface. Reward-guided search requires additional configuration and, for some scoring functions, external structure-prediction runtimes. The toolkit also does not expose a separate folding mode. In the upstream implementation, sequence-conditioned structure generation can be expressed through sequence conditioning, which is available through `known_sequence`.

* **Metrics and output filtering.** The implementation disables tagged upstream metrics through `metrics_tags=[]`, preventing the configured AlphaFold2, AlphaFold3, and OpenFold3 refolding oracles from running. Untagged metrics, including the upstream `unknown_residue_filter`, may still be evaluated and recorded in output metadata. The implementation also sets `delete_failing_pre_oracle=False` so designs are not silently removed by that preliminary filter. These metadata should not be interpreted as independent structural validation.

* **Third-party licensing.** The upstream RFD4-Proteina distribution includes optional integrations and container environments for external structure-prediction systems. These components may be subject to licenses and usage conditions that differ from those of RFD4-Proteina itself, including restrictions on particular model weights. The Proto toolkit described here does not invoke these external refolding oracles. Users who enable them independently should review the applicable licenses and distribution terms.

> [!TIP]
>
> **Example notebook:** See the [full working example](https://github.com/evo-design/proto-tools/blob/3de19a7c2f6903a23d803d1dfffbb8d1727daf5e/proto_tools/tools/structure_design/rfd4/examples/example.ipynb) for a copy-paste-ready walkthrough.

## Infrastructure Guides

The following guides cover how to run tools efficiently and at scale.

> [card] [Tool Persistence](https://proto.evodesign.org/docs/tools/guides/tool-persistence.md)
>
> Keep a tool's model warm across calls instead of reloading it every invocation.

> [card] [Device Management](https://proto.evodesign.org/docs/tools/guides/device-management.md)
>
> How GPUs are allocated to tools and how to target specific devices.

> [card] [Parallel Execution](https://proto.evodesign.org/docs/tools/guides/parallel-execution.md)
>
> Fan a batch of inputs out across multiple GPUs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.