Instructions to use c-bone/CrystaLLM-cXRD_chili100k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use c-bone/CrystaLLM-cXRD_chili100k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="c-bone/CrystaLLM-cXRD_chili100k")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, PrefixXRDGPT tokenizer = AutoTokenizer.from_pretrained("c-bone/CrystaLLM-cXRD_chili100k") model = PrefixXRDGPT.from_pretrained("c-bone/CrystaLLM-cXRD_chili100k", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use c-bone/CrystaLLM-cXRD_chili100k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "c-bone/CrystaLLM-cXRD_chili100k" # 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-cXRD_chili100k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/c-bone/CrystaLLM-cXRD_chili100k
- SGLang
How to use c-bone/CrystaLLM-cXRD_chili100k 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-cXRD_chili100k" \ --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-cXRD_chili100k", "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-cXRD_chili100k" \ --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-cXRD_chili100k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use c-bone/CrystaLLM-cXRD_chili100k with Docker Model Runner:
docker model run hf.co/c-bone/CrystaLLM-cXRD_chili100k
Model Card for CrystaLLM-cXRD_chili100k
Model Details
Model Description
CrystaLLM-cXRD_chili100k is a conditional generative model for the recovery of crystal structures from powder X-ray Diffraction (XRD) data. It is a GPT-2 decoder-only model that conditions the generation of Crystallographic Information Files (CIFs) on a continuous diffraction profile rather than a peak list, using a Perceiver Resampler prefix (PrefixXRD) that compresses the pattern into learned key-value tokens injected at every transformer layer.
Unlike the earlier top-20 peak models, this model consumes the whole pattern:
- Scattering vector (Q) on a fixed 1000-point grid,
arange(0, 10, 0.01)Å⁻¹ - Intensity (I), max-normalised to $[0, 1]$
This removes the peak-picking step from the workflow: a raw diffractometer scan is converted to the (1000, 2) [Q, I] profile automatically at generation time. Because Q is wavelength-independent, patterns from any anode can be used as long as the wavelength is supplied. It features an extended context window of 1536 tokens (plus 8 prefix tokens), enabling generation of larger unit cells.
- Developed by: Bone et al. (University College London)
- Model type: Autoregressive Transformer with Perceiver prefix conditioning (~36.7M parameters)
- Language(s): CIF (Crystallographic Information File) syntax
- License: MIT
- Finetuned from model:
c-bone/CrystaLLM-cXRD_alex-mp-20
Model Sources
- Repository: GitHub: CrystaLLM-pi (generation), GitHub: CrystaLLM-cXRD (training and benchmarks)
- Paper: To add
- Dataset: HuggingFace: c-bone/cxrd_alex-mp-20 (Stage 1), HuggingFace: c-bone/cxrd_chili100k (Stage 2)
Uses
Direct Use
Structure solution and recovery from experimental powder XRD. Pass a raw two-column scan and a target composition; the model proposes candidate structures consistent with the diffraction signature. Trained on CHILI-100K, it is aimed at inorganic nanomaterials and experimentally determined structures.
Out-of-Scope Use
- Disordered Systems: No native handling of partial occupancies or significant disorder.
- Organic/MOFs: Training data was filtered to inorganic nanomaterials per the CHILI-100K methodology.
- Unconditional generation: The model requires a diffraction profile at every forward pass and has no missing-conditioning fallback.
- Non-CuKα data without a declared wavelength: CuKα1 is assumed when none is given, which silently misplaces every peak in Q.
Bias, Risks, and Limitations
- Preprocessing sensitivity: Recovery depends on the background subtraction and wavelength used to build the profile. Inspect the conversion (
--save_plot) before trusting a result. - Measured range: Regions of the Q grid outside the measured scan are zero-filled; short scans give the model less to work with.
- Polymorphs: For structurally similar candidates the model may favour the polymorph most prevalent in the CHILI-100K distribution.
- Amorphous or heavily broadened patterns: Nanocrystalline broadening is represented in training, but patterns without resolvable features carry little structural signal.
Getting started
For generation from a scan, use T4_XRD_continuous.ipynb in CrystaLLM-pi. For measured alloys and the virtualiser, see B3_alloy_virtualiser.ipynb. For the benchmark, see B2_chili100k_benchmark.ipynb.
Citation
Papers to Cite:
@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},
}
and
To add
CHILI Dataset:
@inproceedings{10.1145/3637528.3671538,
author = {Friis-Jensen, Ulrik and Johansen, Frederik L. and Anker, Andy S. and Dam, Erik B. and Jensen, Kirsten M. \O{}. and Selvan, Raghavendra},
title = {CHILI: Chemically-Informed Large-scale Inorganic Nanomaterials Dataset for Advancing Graph Machine Learning},
year = {2024},
isbn = {9798400704901},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3637528.3671538},
doi = {10.1145/3637528.3671538},
pages = {4962--4973},
numpages = {12},
keywords = {atomic structure, chemistry, datasets, deep learning, graph neural network, graphs, machine learning, nanomaterials, neutron, scattering, x-ray},
location = {Barcelona, Spain},
series = {KDD '24}
}
- Downloads last month
- -