> ## 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.

# ESM-IF1 Inverse Folding

> ESM-IF1 or ProteinDPO structure-conditioned design of one chain in its structural context

![ESM-IF1 Inverse Folding](https://proto-bio.github.io/proto-assets/images/generator/esm-if1/hero.png)

> [!NOTE]
>
> **License:** ESM-IF1 is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/facebookresearch/esm/blob/main/LICENSE) for full terms.

This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.

***

&#x20;Tools Used Tools Used  Source Source  Cite Cite

![](https://proto-bio.github.io/proto-assets/images/tool/esm_if1/social.png)

&#x20;Go to Tool Page

[Open](https://proto.evodesign.org/docs/tools/inverse-folding/esm-if1.md)

![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-language

&#x20;View source

[Open](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/generator/esm_if1_generator.py#L169)

@inproceedingshsu2022learning\@articlewidatalla2024aligning

```bibtex theme={null}
@inproceedings{hsu2022learning,
  title={Learning inverse folding from millions of predicted structures},
  author={Hsu, Chloe and Verkuil, Robert and Liu, Jason and Lin, Zeming and Hie, Brian and Sercu, Tom and Lerer, Adam and Rives, Alexander},
  booktitle={International Conference on Machine Learning},
  pages={8946--8970},
  year={2022},
  organization={PMLR}
}

@article{widatalla2024aligning,
  title={Aligning protein generative models with experimental fitness via Direct Preference Optimization},
  author={Widatalla, Talal and Rafailov, Rafael and Hie, Brian},
  journal={bioRxiv},
  doi={10.1101/2024.05.20.595026},
  year={2024}
}
```

&#x20;Copy citation

Generator contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)
Protein sequence generator using the ESM-IF1 / ProteinDPO inverse folding model.

Designs the single chain named by each structure input. One structure yields every
proposal; `N` structures yield one proposal each (`N` must equal the proposal count).
Each proposal carries the generating structure and, under
`_generator_metadata["esm-if1"]`, the design's log-likelihoods and perplexity.

## API Reference

ConfigESMIF1GeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/generator/esm_if1_generator.py#L39)

Configuration object for ESMIF1Generator.

ESM-IF1 is an autoregressive inverse-folding transformer over a geometric backbone
encoder. It redesigns exactly one chain per structure; other chains condition the design
through their coordinates only.

**weights\_variant** `enum` (default: protein\_dpo)

'protein\_dpo' (stability-aligned, default) or 'esmif' (original ESM-IF1).

Options: `esmif`, `protein_dpo`

**structure\_inputs** `array`

Structure(s) with one chain to redesign and optional fixed\_positions.

**output\_chain\_id** `string`

Chain of each proposal's structure to redesign (structure\_source='proposal\_structure').

**temperature** `number` (default: 1.0)

Sampling temperature; ESM-IF1's reference default is 1.0, lower is greedier.

**batch\_size** `integer` (default: 1)

Sequences per worker dispatch when sampling many designs from one structure.

**device** `string` (default: cuda)

GPU device for inference (e.g. 'cuda' or 'cuda:0').

**verbose** `boolean` (default: False)

Whether to print status messages during execution.

**structure\_source** `enum` (default: configured\_structure\_inputs)

Design on configured structure\_inputs or on each proposal's attached structure.

Options: `configured_structure_inputs`, `proposal_structure`

**proposal\_fixed\_positions** `array`

Segment positions (1-indexed) whose residue in the proposal's structure is kept.

## Usage

```python python icon="python" theme={null}
>>> gen = ESMIF1Generator(ESMIF1GeneratorConfig(structure_inputs="/path/to/backbone.pdb"))
>>> gen.assign(Segment(length=100, sequence_type="protein"))
>>> gen.sample()  # Each proposal is one designed chain, e.g. "MKV..."
```

## Metadata

| Property | Value |
| - | - |
| Key | `esm-if1` |
| Class | `ESMIF1Generator` |
| Category | `inverse_folding` |
| Input Type | `structure` |
| Uses GPU | `True` |
| Supported Sequence Types | `protein` |
| Allows Empty Start | `False` |


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