How to use from
SGLang
Install from pip and serve model
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
    --model-path "c-bone/CrystaLLM-pi_mp_20_base" \
    --host 0.0.0.0 \
    --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "c-bone/CrystaLLM-pi_mp_20_base",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Use Docker images
docker run --gpus all \
    --shm-size 32g \
    -p 30000:30000 \
    -v ~/.cache/huggingface:/root/.cache/huggingface \
    --env "HF_TOKEN=<secret>" \
    --ipc=host \
    lmsysorg/sglang:latest \
    python3 -m sglang.launch_server \
        --model-path "c-bone/CrystaLLM-pi_mp_20_base" \
        --host 0.0.0.0 \
        --port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "c-bone/CrystaLLM-pi_mp_20_base",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

Model Card for CrystaLLM-pi_mp_20_base

Model Details

Model Description

CrystaLLM-pi_mp_20_base is an unconditional generative model for crystal structures. It is a GPT-2 decoder-only model that generates Crystallographic Information Files (CIFs) from the patterns learned during training, with no property or diffraction conditioning attached.

The model was trained from scratch on MP-20 CIF text as an unconditional baseline for LeMat-Bench. For fine-tuning, use c-bone/CrystaLLM-pi_ft_alex_mp_20-text, which was initialised from the LeMat-Bulk pretrained model. Training used only the CIF text from c-bone/mp_20_pxrd, without the XRD conditioning vectors.

  • Developed by: Bone et al. (University College London)
  • Model type: Autoregressive Transformer, unconditional (~25.9M parameters)
  • Language(s): CIF (Crystallographic Information File) syntax
  • License: MIT
  • Finetuned from model: None, trained from scratch

Model Sources

Uses

Direct Use

Unconditional or prompt-steered generation of inorganic crystal structures, and evaluation as the MP-20 baseline in LeMat-Bench.

Out-of-Scope Use

  • Property targeting: the model has no conditioning channel. Use a conditional model to request a property value.
  • Disordered Systems: No native handling of partial occupancies or significant disorder.
  • Organic/MOFs: Training data is inorganic, so organic frameworks are out of distribution.
  • Extremely Large Unit Cells: the context window is 1024 tokens, so large cells will not fit.

Bias, Risks, and Limitations

  • Distribution matching: output closely reflects the MP-20 distribution, so novelty is limited by design. Raise the generation temperature to move away from it.
  • Validity is not stability: generated CIFs passing structural checks are not necessarily thermodynamically stable. Screen with an energy model before drawing conclusions.
  • Computed data: training structures are relaxed DFT results rather than experimentally determined ones.

Getting started

For generation, use T2_load_and_generate.ipynb in CrystaLLM-pi. The training config is mp-20-text.jsonc.

Citation

@misc{bone2025discoveryrecoverycrystallinematerials,
      title={Discovery and recovery of crystalline materials with property-conditioned transformers},
      author={Cyprien Bone and Matthew Walker and Bradley A. A. Martin and Kuangdai Leng and Luis M. Antunes and Ricardo Grau-Crespo and Amil Aligayev and Javier Dominguez and Keith T. Butler},
      year={2025},
      eprint={2511.21299},
      archivePrefix={arXiv},
      primaryClass={cond-mat.mtrl-sci},
      url={https://arxiv.org/abs/2511.21299},
}
Downloads last month
530
Safetensors
Model size
25.9M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train c-bone/CrystaLLM-pi_mp_20_base

Collection including c-bone/CrystaLLM-pi_mp_20_base

Paper for c-bone/CrystaLLM-pi_mp_20_base