Skip to content
Official

Retrosynthesis Starter Stack

Install an isolated AiZynthFinder environment, download its public policy/template/stock files, and run a bounded, traceable retrosynthesis search.

Level: Intermediate Cost: Free Privacy: Local ~60 min
Start Setup

You'll be able to

  • Prepare policy/template/stock data with recorded provenance.
  • Run a bounded search and inspect route statistics.

What you'll build

Scope

Use AiZynthFinder 4.4.1 with its own Python 3.11 environment. Its declared Python range is >=3.10,<3.13; dependencies include a different RDKit range from the other recipes, so do not merge their virtual environments. The reference workflow uses local ONNX policies and a public stock snapshot, not a hosted inference endpoint. Model/template/stock downloads require network access and substantial disk space; review their licenses and preserve file hashes.

Result meaning

The search proposes model-based routes under a specific policy, stock and budget. A solved route means its leaves satisfy the configured stock criterion, not that a synthesis was experimentally demonstrated or materials are currently purchasable. Zero routes is a valid observed result and must not be filled with model-generated chemistry. Search time limits do not include all startup/download overhead, and numerical results may vary with versions and search state.

Local retrosynthesis search engine

AiZynthFinder

Stack Components

AiZynthFinder

Local retrosynthesis search engine · ==4.4.1

Separate Python 3.11 environment; public models/templates/stock are additional required data downloads.

See upstream licenses and client/service account terms.

View Resource

Compatibility

ClientOSArchitectureVersion requirements
Python macOSAny>= 3.10 <= 3.12
Python WindowsAny>= 3.10 <= 3.12
Python LinuxAny>= 3.10 <= 3.12

Setup & Test

1. Prepare Python, disk space and model licenses

All platforms

Install Python 3.11 in a new environment. Prepare writable space for model and stock files, and review upstream public-data references before downloading. Use a new data directory.

Official source

Expected result

The environment matches Python >=3.10,<3.13.

2. Install isolated Python dependencies

macOS

Run in a new working directory. This shell variant applies to macOS/Linux; use the separate Windows step on Windows.

python3.11 -m venv .venv
.venv/bin/python -m pip install aizynthfinder==4.4.1
.venv/bin/python -m pip freeze
Official source

Expected result

Packages install; record the resolved versions.

3. Install isolated Python dependencies

Linux

Run in a new working directory. This shell variant applies to macOS/Linux; use the separate Windows step on Windows.

python3.11 -m venv .venv
.venv/bin/python -m pip install aizynthfinder==4.4.1
.venv/bin/python -m pip freeze
Official source

Expected result

Packages install; record the resolved versions.

4. Install Python dependencies on Windows

Windows

Use PowerShell and the virtual-environment interpreter directly.

py -3.11 -m venv .venv
.\.venv\Scripts\python.exe -m pip install aizynthfinder==4.4.1
.\.venv\Scripts\python.exe -m pip freeze
Official source

Expected result

Packages install; record the resolved versions.

5. Download public data on macOS/Linux

macOS

Use a new public-data directory. The upstream downloader writes models, templates, stock and config.yml there. Do not point it at existing data.

mkdir public-data
.venv/bin/download_public_data public-data
Official source

Expected result

All referenced files and generated config.yml exist; record file sizes and hashes.

6. Download public data on Linux

Linux

Use the same downloader in a new directory.

mkdir public-data
.venv/bin/download_public_data public-data
Official source

Expected result

Referenced data files are present.

7. Download public data on Windows

Windows

Run in PowerShell in the new working directory.

mkdir public-data
.\.venv\Scripts\download_public_data.exe public-data
Official source

Expected result

Referenced data files are present.

8. Save a bounded search configuration

All platforms

Save as config_local.yml, replace all paths with the downloaded files, and preserve the original generated config.yml. On Windows use quoted forward-slash paths such as C:/work/public-data/... . The selected uspto policy must match the downloaded model/templates.

search:
  max_transforms: 4
  iteration_limit: 50
  time_limit: 30
  exclude_target_from_stock: true
expansion:
  uspto:
    - /ABSOLUTE/PATH/public-data/uspto_model.onnx
    - /ABSOLUTE/PATH/public-data/uspto_templates.csv.gz
filter:
  uspto: /ABSOLUTE/PATH/public-data/uspto_filter_model.onnx
stock:
  zinc: /ABSOLUTE/PATH/public-data/zinc_stock.hdf5
Official source

Expected result

All configured files exist and search limits are explicit.

9. Run the aspirin search

All platforms

Use ..venv\Scripts\aizynthcli.exe on Windows. Choose a new output path and keep the CLI log for review.

.venv/bin/aizynthcli --config config_local.yml --smiles "CC(=O)Oc1ccccc1C(=O)O" --policy uspto --stocks zinc --output aspirin-routes.json
Official source

Expected result

CLI loads the configured policy/stock and writes an actual output file. Record the target, search statistics, number_of_routes and is_solved from real output. Do not require a particular route or claim solved implies laboratory feasibility.

10. Review the actual route evidence

All platforms

Use this prompt as a human checklist, or supply the actual output to an optional assistant. Uploading output to a cloud assistant changes the local-only privacy assumption.

Review the supplied AiZynthFinder output for aspirin. Report the actual route count, solved status, policy, stock and search budget. Separate model proposals from experimental evidence; if there are no routes, state that without generating replacements.
Official source

Expected result

The review matches the actual saved output and its limits.

Troubleshooting

  • Python rejected: use 3.10–3.12; this recipe selects 3.11.
  • Dependency conflicts: use a fresh environment rather than upgrading another RDKit recipe.
  • Download incomplete: check each referenced file and retry to a new data directory; config.yml alone is not enough.
  • Model/template mismatch: use pairs from the same downloader dataset.
  • Stock missing: inspect the absolute HDF5 path and its configured key.
  • Zero routes: record the result, policy, stock and budget; investigate assumptions rather than inventing a synthesis.
  • ONNX runtime unavailable on an architecture: consult official supported platforms and record the environment as unverified.
Still not working

Alternatives

Use the upstream notebook/UI with the same model and stock files for inspection. A literature-based human route review is a separate workflow and does not validate model output automatically.