PrexSyn
PrexSyn is an efficient, accurate, and programmable framework for exploring synthesizable chemical space.
PrexSyn is based on a decoder-only transformer architecture that autoregressively generates postfix notations of synthesis (a molecular representation based on chemical reactions and purchasable building blocks) conditioned on molecular descriptors.
PrexSyn is trained on a billion-scale datastream of postfix notations paired with molecular descriptors using only two GPUs and 32 CPU cores in two days. This is made possible by PrexSyn Engine, a real-time, high-throughput C++-based data generation pipeline.
Note: features described in the original paper (e.g. property-based queries) are not supported in the current version (v1) of PrexSyn for now. If you need these features, please switch to the v0 branch.
[Documentation] [Paper] [PrexSyn Engine] [Data and Model Weights]
Capabilities
| Capability | Input | Output | Performance |
|---|---|---|---|
| Chemical space projection | |||
| Fingerprint/descriptor based generation | |||
| Molecular sampling |
Usage
Documentation
Please refer to the documentation for detailed usage instructions on installation, data setup, reproducibility, and customization.
Quick example
To run a quick example, make sure uv is installed, then clone this repository. The command below is all you need to get started. No need to manually configure or download anything! On the first run, the preprocessed chemical space and model checkpoints will be downloaded automatically.
uv run python scripts/examples/projection.py \
--smiles "COc1ccc(-c2ccnc(Nc3ccccc3)n2)cc1" \
--draw-output-dir ./draw
The diagrams of the synthesis pathways will be saved in the ./draw directory.
If you need to customize the environment (e.g., specific PyTorch/CUDA versions), please refer to the installation instructions for guidance.
Use PrexSyn in your own project
PrexSyn is designed to be modular and easy to integrate into your own projects. To get started, install PrexSyn directly from this repository (a PyPI release is planned), which will automatically install all required dependencies:
pip install git+https://github.com/luost26/prexsyn.git
The example below demonstrates how to use PrexSyn to generate synthesis pathways for a target SMILES string:
from prexsyn.shortcuts import AllInOneLoader, MoleculeProjector
config_path = "./data/trained_models/enamine2310_rxn115_202511.yml"
loader = AllInOneLoader(config_path)
projector = MoleculeProjector(
model=loader.model().to("cuda").eval(),
detokenizer=loader.detokenizer(),
descriptor="ecfp4",
num_samples=16,
)
result = projector.one("COc1ccc(-c2ccnc(Nc3ccccc3)n2)cc1")
for i, item in enumerate(result.items):
print(item.get_tree()) # print the synthesis tree in python dict format
img = item.get_image()
img.save(f"output_{i}.png") # save the synthesis tree diagram as a PNG image
img.close()
More examples can be found in the scripts/examples directory.
Upgrade to PrexSyn v1
We have substantially refactored both the PrexSyn codebase and the PrexSyn Engine to improve usability, performance, and extensibility. Key updates include:
- ✅ Improved usability: PrexSyn Engine is now available via PyPI.
- ✅ Higher performance and stability: Data generation is now approximately 2× faster than reported in the paper, with improved robustness thanks to a more reliable compilation pipeline.
- ✅ Greater flexibility: Chemical space definitions and training workflows are now easier to customize for new use cases.
- ✅ Cleaner interfaces: Simplified and more consistent APIs for projection, fingerprint/descriptor-based generation, and sampling.
- ⚠️ Some features described in the original paper (mostly property-based queries) are no longer supported in the current version of PrexSyn. If you need these features, please use the v0 branch.
Citation
@article{luo2025prexsyn,
title = {Efficient and Programmable Exploration of Synthesizable Chemical Space},
author = {Shitong Luo and Connor W. Coley},
year = {2025},
journal = {arXiv preprint arXiv: 2512.00384}
}
@inproceedings{luo2024chemprojector,
title={Projecting Molecules into Synthesizable Chemical Spaces},
author={Shitong Luo and Wenhao Gao and Zuofan Wu and Jian Peng and Connor W. Coley and Jianzhu Ma},
booktitle={Forty-first International Conference on Machine Learning},
year={2024}
}
Metadata
Release files for prexsyn 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prexsyn-1.1.3.tar.gz | 32.8 kB | With provenance | Details for prexsyn-1.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prexsyn-1.1.3-py3-none-any.whl | Python 3 | none | any | Details for prexsyn-1.1.3-py3-none-any.whl |
Total release size: 71.7 kB
Release files / prexsyn-1.1.3.tar.gz
| Download URL | prexsyn-1.1.3.tar.gz |
|---|---|
| Size | 32.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4aa7a67d603effc7c4392e996a150ab8bb8a0d4ee8fc7cc25e7badc946addde0
|
|
BLAKE2b-256 checksum How to use checksums |
c0864c07b0c6419dfb97af205ce9cf2170a69d78227689eff5f462772b22d781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logRelease files / prexsyn-1.1.3-py3-none-any.whl
| Download URL | prexsyn-1.1.3-py3-none-any.whl |
|---|---|
| Size | 38.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f566f7907c8753fc81b3358626beb2a062c41fd5517ede39ce45e1970c6bd92
|
|
BLAKE2b-256 checksum How to use checksums |
2d23f9193648a2fcefcf2c71248be159f805d9306e21afe028f54dad0e9a3886
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logSecurity for prexsyn 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for prexsyn-1.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.