$ show microsoft/syntheseus
Syntheseus is a Python package for retrosynthetic planning that provides a unified framework for integrating various single-step reaction models with search algorithms to find synthetic routes from target molecules to available starting materials. The package features a plugin architecture that allows users to plug in different reaction models (such as Chemformer, GLN, LocalRetro, etc.) and search algorithms (like MCTS, Retro*, Breadth-First, etc.) through well-defined abstract base classes. It includes command-line interfaces for running end-to-end searches and evaluating single-step model performance, along with tools for route analysis and visualization. The architecture emphasizes separation of concerns: the interface module defines core abstractions (molecule, reaction, bag, and models), the reaction_prediction module handles model loading and inference, and the search module implements the search algorithms and graph representations. This design enables easy extension and experimentation with new models and algorithms. The package is actively used in academic research and has been applied in recent publications for benchmarking retrosynthesis approaches.
The LLM identified 5 files worth highlighting for reuse:
Defines the SingleStepModel abstract base class that standardizes the interface for all reaction models, enabling plug-and-play integration of different models without modifying search algorithms.
Uses OmegaConf to manage model configurations and checkpoint information, allowing easy switching between different reaction models and their hyperparameters via configuration files.
Provides a base SearchAlgorithm class that outlines the search process, with mixins available to add common functionalities (like depth tracking, solution status) promoting code reuse and easy extension of new algorithms.
Implements utilities for parallel execution of model inference using multiprocessing or threading, significantly speeding up the search process by leveraging multiple CPU cores.
Implements the AND/OR graph data structure specific to retrosynthetic search, encapsulating node expansion, validity checks, and graph manipulation logic in a reusable component.