Olinda, model distillation for chemistry
Some ML-for-chemistry models are too slow to run on a million compounds. Olinda makes a fast one that behaves like them: score the slow model once over a reference library of ~1.4M molecules, train a compact gradient-boosting student to reproduce it, and ship the result as a single ONNX file.
Installation
Olinda is pip-installable:
pip install olinda # run models from Python: numpy, onnxruntime, wasmtime
pip install "olinda[cli]" # + the `olinda` command: click, rich-click, rich, loguru, tqdm
pip install "olinda[report]" # + `olinda validate` and its figures: pandas, pyarrow, matplotlib, onnx, stylia
pip install "olinda[train]" # + distillation: XGBoost, LightGBM, lazy-qsar, onnxmltools, h5py
Each extra includes the one above it, so olinda[train] installs everything. No install needs RDKit:
Olinda featurizes molecules with RDKit compiled to WebAssembly, which ships inside the package.
Check that the command-line tool is installed (it needs olinda[cli] or above):
olinda --help
Before distilling, download the pre-calculated fingerprints of the reference library (1.4M compounds; 2.8GB):
olinda setup
Running a model at inference time
A distilled model is one self-describing ONNX file. You can load and run the model in Python:
from olinda import OlindaArtifact
model = OlindaArtifact("model.onnx")
model.run(["CCO", "c1ccccc1"]) # one row per molecule, one column per task (model.columns)
Alternatively, you can use the CLI:
olinda predict --model-onnx model.onnx --input my_smiles.csv --output my_output.csv
Or, with nothing installed, in the browser at ersilia-os.github.io/olinda:
upload the model.onnx, paste SMILES, and get the predictions as a table. It all runs locally in the browser;
the model and the molecules never leave your machine.
Distilling a model
Getting your soft labels
Olinda relies on a reference library that is maintained by the Ersilia team.
Use the following command to obtain a 1-column file with the SMILES structures of the reference library:
olinda library -o ersilia_reference_library.csv
Use this file to make predictions with your model of choice. Feel free to explore models from the Ersilia Model Hub, or models trained with ZairaChem. We refer to the result of these predictions as soft labels.
Training a distilled model
Assuming you have your soft labels calculated, you can simply get a distilled (surrogate model) as follows:
olinda fit --soft-labels my_soft_labels.csv --model-onnx my_model.onnx
Optionally, you can provide hard labels (ground truth) if you have them. Hard labels can be binary (1/0) or continuous measurements; olinda detects which per column (--task overrides). A continuous head is capped at a lower blend weight than a binary one (0.25 against 0.4), a provisional figure that has not yet been validated against real measurements.
olinda fit --soft-labels my_soft_labels.csv --hard-labels my_hard_labels.csv --model-onnx my_model.onnx
Evaluating a distilled model
The easiest way to evaluate a distilled model is to pass an additional set of soft-labels (and optionally hard labels):
olinda validate --soft-labels my_validation_soft_labels.csv --model-onnx my_model.onnx --output-dir my_report_folder
Commands
The olinda command comes with olinda[cli]; validate also needs olinda[report], and the distilling
commands need olinda[train].
| Command | What it does |
|---|---|
setup |
Download the reference library's Morgan fingerprints |
library |
Write the reference library's SMILES to a CSV |
fit |
Distil a teacher into a student end-to-end |
predict |
Run a distilled model.onnx on SMILES |
validate |
Score a model against labelled data and write a report |
fit drives the step-by-step pipeline below; run the steps yourself to inspect or redo one of them.
| Command | What it does |
|---|---|
prepare |
Set up a run directory from the soft (and hard) labels |
learn-soft |
Train the surrogate on the teacher's soft labels |
learn-hard |
Train on hard labels and calibrate onto the soft-label scale |
export |
Rebuild model.onnx for a trained run |
clean |
Move the model out of the run and delete the working folder |
About the Ersilia Open Source Initiative
The Ersilia Open Source Initiative is a tech-nonprofit organization fueling sustainable research in the Global South. Ersilia's main asset is the Ersilia Model Hub, an open-source repository of AI/ML models for antimicrobial drug discovery.
Metadata
Release files for olinda 1.4.2
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 |
|---|---|---|---|---|
| olinda-1.4.2.tar.gz | 880.7 kB | With provenance | Details for olinda-1.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| olinda-1.4.2-py3-none-any.whl | Python 3 | none | any | Details for olinda-1.4.2-py3-none-any.whl |
Total release size: 1.8 MB
Release files / olinda-1.4.2.tar.gz
| Download URL | olinda-1.4.2.tar.gz |
|---|---|
| Size | 880.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
877f394c8dc36dd85af16831bc750c4565c26a5bc4c1aed719a8bff4a8d48343
|
|
BLAKE2b-256 checksum How to use checksums |
3381b8643f0eb0bfe48eb595875a7315b102d6e9baa77a535468a295f4f58375
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 4, 2026.
Transparency logRelease files / olinda-1.4.2-py3-none-any.whl
| Download URL | olinda-1.4.2-py3-none-any.whl |
|---|---|
| Size | 891.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60d555a6bc510b2cc3b8286f119bdb333f3e5cb887c1d11e3f4e529acd8461ac
|
|
BLAKE2b-256 checksum How to use checksums |
061fd4522029556919baaed9623b83c3c19ca1ea71e1f586f5212662c18b384f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 4, 2026.
Transparency logSecurity for olinda 1.4.2
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 olinda-1.4.2.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 Nov 4, 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.