CrystaLLM-π¶
CrystaLLM-π generates crystal structures as CIF files, with optional targets such as bandgap, density, photovoltaic efficiency or XRD peaks. You can use a released model or fine-tune one on your own data.

This repo includes the package, tutorials, documentation and a containerised API, with pretrained models available on Hugging Face. The API also powers the CrystaLLM-π web application. Most models fit on a 16 GB GPU for training and need 1–2 GB for generation. Generation also runs on CPU.
Key Features¶
- Structure generation: generate CIFs from scratch or from a formula, with optional Z and space-group inputs.
- Property targets: guide generation with one or more numerical properties.
- Fine-tuning: train Prefix or Residual models on your own data. Residual models also support missing property values.
- Evaluation: check validity, uniqueness, novelty and stability.
- Released models: download pretrained models from Hugging Face and run them yourself.
Where to start¶
| If you want to | Page | Notebook |
|---|---|---|
| Install the package | Installation | |
| Generate with a released model | Quickstart | T2 |
| Understand the conditional families | Models | |
| Finetune on your own property | Train, generate & evaluate | T1 |
| Recover a structure from XRD peaks | Quickstart | |
| Run it as an HTTP service | API service | T3 |
| Screen for a target property | Train, generate & evaluate | T4 |
| Look up a function | API reference |
Reproducing the paper¶
The notebooks and configs for "Discovery and recovery of crystalline materials with property-conditioned transformers" are in the repository made to reproduce our paper: CrystaLLM-pi-paper.
Use this repo for up to date training, generation, and access to models from our other CrystaLLM-π projects as they come out!
In the reproduce paper code, the
Residualmodel goes buySlider, and thePrefixmodel goes byPKV. This is legacy naming and has been updated across this codebase.