---
title: AiZynthFinder configuration
description: 'Stock and policy choice decides what AiZynthFinder calls purchasable — set stocks, expansion and filter policies, search algorithm and processes.'
---

This page configures how [AiZynthFinder](/docs/aizynthfinder) searches for routes — target input, stock repositories, expansion and filter policies, search algorithm, and processing limits. Your stock and policy choices most affect the result: routes are only marked purchasable when all starting materials exist in the stocks you select, so start with `uspto_50k` and the stocks that reflect your actual procurement options.

## Webapp input methods

The .bloom* webapp provides a streamlined interface for AiZynthFinder retrosynthesis analysis.

## Target source selection

| Source | Description |
|--------|-------------|
| **Manual Entry** | Enter target SMILES directly |
| **From Previous Job** | Import compounds from previous chemistry jobs |

### From previous job

- **Job Output Selector**: Browse completed jobs with compound outputs
- **Compatible tools**: REINVENT, ZINC, PubChem, other chemistry tools
- **SMILES extraction**: Automatic extraction from job outputs
- **Search and pagination**: Browse large result sets

## Target SMILES input

- **Required field**: Target molecule in SMILES format
- **Placeholder**: "Enter target molecule SMILES string"
- **Helper text**: "SMILES representation of the target molecule for retrosynthesis"
- **Validation**: Form requires non-empty SMILES to submit

## Basic options

## Clustering toggle
- **Enable clustering**: Checkbox to group similar routes
- **Purpose**: Reduce redundancy in results
- **Default**: Disabled

## Logging toggle
- **Enable detailed logging**: Checkbox for verbose output
- **Purpose**: Debug and analysis
- **Default**: Disabled

## Advanced configuration (optional)

Toggle **"Show advanced settings"** to access additional parameters:

## Configuration file
- **Configuration File**: Path to YAML configuration file
- **Placeholder**: `config_local.yml`
- **Purpose**: Override default search parameters

## Processing options

| Parameter | Description | Range |
|-----------|-------------|-------|
| **Number of Processes** | Parallel processes for analysis | 1-16 |
| **Output Path** | Results file path | e.g., `results/synthesis_routes.json` |
| **Pre-processing Module** | Module to apply before search | e.g., `standardization` |
| **Checkpoint File** | Resume interrupted searches | e.g., `checkpoint.pkl` |

## Policy and filter configuration

| Parameter | Description | Examples |
|-----------|-------------|----------|
| **Expansion Policies** | Comma-separated policy names | `uspto, ringbreaker` |
| **Filters** | Comma-separated filter names | `feasibility, quick_filter` |
| **Stock Repositories** | Comma-separated stock sources | `zinc, chembl` |
| **Post-processing Modules** | Comma-separated modules | `clustering, route_distances` |

## Input molecule

## SMILES input
- **Required parameter**: `smiles` - Target molecule in SMILES format
- **Format**: Single SMILES string or path to file containing SMILES
- **Example**: `"CCc1ccc(cc1)C(C)C(=O)O"` (ibuprofen)
- **Validation**: Must be valid, canonical SMILES string

## Configuration file (optional)
- **Parameter**: `config` - Path to YAML configuration file
- **Default**: Uses `config_local.yml` if not specified
- **Purpose**: Override default search parameters with custom settings

## Stocks and availability

## Stock sources
- **Parameter**: `stocks` - Array of stock repository names
- **Available options**:
  - `"zinc"` - ZINC database (millions of compounds)
  - `"emolecules"` - eMolecules catalog
  - `"custom"` - User-uploaded building block libraries
  - `"pubchem"` - PubChem compounds
- **Required**: At least one stock source must be specified
- **Impact**: Routes are only marked "purchasable" if all starting materials exist in specified stocks

## Stock selection strategy
- **Start small**: Begin with 1-2 relevant stock sources to keep search focused
- **Match procurement**: Choose stocks that reflect your actual purchasing options
- **Combine sources**: Use multiple stocks for broader coverage
- **Update frequency**: Refresh stock snapshots regularly as catalogs change

## Policies and templates

## Expansion policies
- **Parameter**: `policy` - Array of expansion policy names
- **Available policies**:
  - `"uspto"` - Default USPTO-trained policy
  - `"uspto_50k"` - Policy trained on 50k USPTO reactions (balanced speed/quality)
  - `"uspto_500k"` - Policy trained on 500k USPTO reactions (higher quality, slower)
- **Default**: Uses USPTO policy if not specified
- **Recommendation**: Start with `uspto_50k` for most use cases

## Policy characteristics
- **uspto**: Fastest, good for initial screening
- **uspto_50k**: Better route quality, moderate speed
- **uspto_500k**: Highest quality routes, slowest search

## Filters and post-processing

## Route filters
- **Parameter**: `filter` - Array of filter names to apply
- **Available filters**:
  - `"price"` - Filter by reagent cost
  - `"availability"` - Filter by commercial availability
  - `"toxicity"` - Filter out toxic intermediates
  - `"patent"` - Check patent status
- **Purpose**: Remove undesirable routes from results

## Filter policies (v4.0)
- **Parameter**: `filter_policy` - Machine learning-based reaction feasibility filters
- **Purpose**: Reject unlikely or infeasible reactions during search
- **Benefit**: Reduces search space and improves route quality by eliminating chemically implausible steps early
- **Note**: Filter policies were introduced in AiZynthFinder 4.0 (May 2024)

## Bonds-to-freeze constraints (v4.0)
- **Parameter**: `frozen_bonds` - List of bond indices that should not be disconnected
- **Format**: Array of atom index pairs, e.g., `[[0, 1], [5, 6]]`
- **Purpose**: Preserve specific structural motifs during retrosynthesis
- **Use cases**:
  - Protect key pharmacophores from disconnection
  - Maintain stereochemistry at critical centers
  - Guide search toward preferred disconnection strategies
- **Note**: Bonds-to-freeze constraints were introduced in AiZynthFinder 4.0

## Post-processing modules
- **Parameter**: `post_processing` - Array of post-processing module names
- **Options**: `"cluster"`, `"score"`, `"validate"`
- **Default**: Applies clustering and scoring by default

## Pre-processing
- **Parameter**: `pre_processing` - Pre-processing module name
- **Purpose**: Prepare input molecule before search
- **Default**: Standard SMILES normalization

## Search algorithm

## Algorithm selection
- **Parameter**: `search_algorithm` - Search strategy for route exploration
- **Available algorithms**:
  - `"mcts"` - Monte Carlo Tree Search (default, best for most use cases)
  - `"mcts_nested"` - Nested Monte Carlo search (deeper exploration)
  - `"greedy_best_first"` - Greedy Best First Search (faster, less exhaustive)
- **Default**: Uses MCTS if not specified
- **Recommendation**: Start with `mcts` for balanced exploration; use `greedy_best_first` for quick screening of many molecules

## Algorithm characteristics
- **mcts**: Balances exploration and exploitation, robust across molecule types
- **mcts_nested**: Better for complex molecules requiring deeper search trees
- **greedy_best_first**: Fastest option, prioritizes most promising paths immediately

## Search parameters

## Parallel processing
- **Parameter**: `nproc` - Number of processes to use
- **Default**: Uses available CPU cores
- **Impact**: More cores = faster search, higher memory usage

## Clustering
- **Parameter**: `cluster` - Enable automatic route clustering
- **Default**: `false`
- **Purpose**: Group similar routes to reduce redundancy

## Output options
- **Parameter**: `output` - Output file path for results
- **Parameter**: `log_to_file` - Enable detailed logging to file
- **Default**: `false`

## Checkpointing
- **Parameter**: `checkpoint` - Path to checkpoint file
- **Purpose**: Resume interrupted searches
- **Use case**: Long-running searches that might be interrupted

## Search limits and performance

## Time management
- **No explicit timeout parameter**: Search runs until completion or resource limits
- **Typical duration**: 5-30 minutes depending on molecule complexity
- **Scaling factors**: Larger molecules, more stocks, complex policies = longer search

## Result limits
- **Route count**: Limited to top-scoring routes (typically 50-200)
- **Memory constraints**: Large searches may hit memory limits before completion
- **Quality over quantity**: Focus on high-scoring routes rather than exhaustive search

## Reproducibility and versioning

## Configuration tracking
- **Record parameters**: Always document stock sources, policies, and filters used
- **Version control**: Model and policy versions are included in job metadata
- **Consistent comparisons**: Use identical configurations when comparing different targets

## Metadata preservation
- **Job artifacts**: Include complete configuration in JSON metadata
- **Audit trail**: Policy versions and timestamps enable result validation
- **Sharing**: Share complete configuration for reproducible route generation

## Recommended configurations

## Quick screening
```
smiles: "CCc1ccc(cc1)C(C)C(=O)O"
stocks: ["zinc"]
policy: ["uspto_50k"]
nproc: 4
```

## Comprehensive search
```
smiles: "CCc1ccc(cc1)C(C)C(=O)O"
stocks: ["zinc", "emolecules"]
policy: ["uspto_500k"]
filter: ["price", "availability"]
nproc: 8
cluster: true
```

## Custom library search
```
smiles: "CCc1ccc(cc1)C(C)C(=O)O"
stocks: ["custom"]
policy: ["uspto_50k"]
filter: ["availability"]
```
