Instructions to use c-bone/CrystaLLM-pi_mp_20_base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use c-bone/CrystaLLM-pi_mp_20_base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="c-bone/CrystaLLM-pi_mp_20_base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("c-bone/CrystaLLM-pi_mp_20_base") model = AutoModelForCausalLM.from_pretrained("c-bone/CrystaLLM-pi_mp_20_base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use c-bone/CrystaLLM-pi_mp_20_base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "c-bone/CrystaLLM-pi_mp_20_base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/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
docker model run hf.co/c-bone/CrystaLLM-pi_mp_20_base
- SGLang
How to use c-bone/CrystaLLM-pi_mp_20_base with 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 }' - Docker Model Runner
How to use c-bone/CrystaLLM-pi_mp_20_base with Docker Model Runner:
docker model run hf.co/c-bone/CrystaLLM-pi_mp_20_base
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
}'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
- Repository: GitHub: CrystaLLM-pi (generation)
- Dataset: HuggingFace: c-bone/mp_20_pxrd
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
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 }'