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

# IgLM Antibody Span Re-design

> IgLM antibody language model for re-designing one span (e.g. a CDR) of an existing chain

![IgLM Antibody Span Re-design](https://proto-bio.github.io/proto-assets/images/generator/iglm-infill/hero.png)

> [!NOTE]
>
> **License:** IgLM is licensed under Custom (JHU Academic Software License Agreement) and has restrictions around commercial use and may require explicit attribution when utilized. Please refer to [the license](https://github.com/Graylab/IgLM/blob/main/LICENSE.md) 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/iglm/social.png)

&#x20;Go to Tool Page

[Open](https://proto.evodesign.org/docs/tools/causal-models/iglm.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/iglm_generator.py#L278)

@articleshuai2023iglm

```bibtex theme={null}
@article{shuai2023iglm,
  title={IgLM: Infilling language modeling for antibody sequence design},
  author={Shuai, Richard W and Ruffolo, Jeffrey A and Gray, Jeffrey J},
  journal={Cell Systems},
  volume={14},
  number={11},
  pages={979--989.e4},
  year={2023},
  publisher={Elsevier},
  doi={10.1016/j.cels.2023.10.001}
}
```

&#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)
Antibody span re-design generator using IgLM infilling.

Replaces the configured span of every proposal with residues IgLM writes conditioned
on the rest of the chain and the chain and species tokens. IgLM picks the new span's
length, so proposals can grow or shrink. The span is given in the coordinates of the
segment's starting sequence and is tracked across calls: everything after the span is
preserved, so its current end is `len(proposal) - (segment_length - span.end)`. That
holds as long as the starting sequences have the segment's length and no other
generator on the segment changes their length. Nothing bounds the span's length across
calls, so a long run can grow a proposal past what `max_length` holds, and the call
then fails with IgLM's "yielded only N of M" error; raise `max_length` (at most 512)
or add a length constraint.

Per-proposal diagnostics go to `proposal._generator_metadata["iglm-infill"]`:
`infilled_residues` (what IgLM wrote) and `span` (`(start, end)`, 1-indexed and
inclusive, where it now sits).

## API Reference

ConfigIgLMInfillGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/generator/iglm_generator.py#L156)

Configuration object for IgLMInfillGenerator.

**span** `IgLMSpan` *required*

Residues to re-design (1-indexed, inclusive) in the segment's starting sequence

**model\_checkpoint** `enum` (default: IgLM)

IgLM weights variant; 'IgLM' is 13M parameters, 'IgLM-S' is 1.4M

Options: `IgLM`, `IgLM-S`

**chain** `enum` (default: heavy)

Chain-type conditioning token for IgLM.

Options: `heavy`, `light`

**species** `enum` (default: human)

Species-of-origin conditioning token for IgLM.

Options: `human`, `mouse`, `rat`, `rabbit`, `rhesus`, `camel`

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

Sharpness of sampling. Below 1 favors high-probability residues; above 1 adds diversity.

**top\_p** `number` (default: 1.0)

Nucleus sampling cumulative probability cutoff. 1.0 disables nucleus sampling.

**max\_length** `integer` (default: 150)

IgLM token budget per generation, including conditioning and format tokens.

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

Candidate sequences IgLM draws per GPU forward pass

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

GPU device to run IgLM on (e.g. 'cuda' or 'cuda:0').

## Usage

```python python icon="python" theme={null}
>>> from proto_language.core import Segment
>>> from proto_language.generator import IgLMInfillGenerator, IgLMInfillGeneratorConfig
>>> heavy = (  # 1JPT heavy chain; residues 99-106 are its CDR H3 (DTAAYFDY)
...     "EVQLVESGGGLVQPGGSLRLSCAASGFNIKEYYMHWVRQAPGKGLEWVGLIDPEQGNTIYDPKFQDRATIS"
...     "ADNSKNTAYLQMNSLRAEDTAVYYCARDTAAYFDYWGQGTLVTVS"
... )
>>> gen = IgLMInfillGenerator(IgLMInfillGeneratorConfig(span={"start": 99, "end": 106}))
>>> gen.assign(Segment(sequence=heavy, sequence_type="protein"))
>>> gen.sample()  # CDR H3 re-designed in every proposal; framework kept
```

## Metadata

| Property | Value |
| - | - |
| Key | `iglm-infill` |
| Class | `IgLMInfillGenerator` |
| Category | `mutation` |
| Input Type | `starting_sequence` |
| 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.