A Language Agentic framework for Retrosynthesis planning under Constraints
- Clone this repository
git clone https://github.com/ninglab/LARC- Download the files for MEEA* (unconstrained planner) from this link:
https://drive.google.com/file/d/1lXtRKRGETEYz0bTRAsl1LsBYGD20MM9O/view?usp=drive_link, unzip, and copy them into in
planners/MEEAso that the following files are present:
planners/MEEA/prepare_data/origin_dict.csv
planners/MEEA/saved_model/policy_model.ckpt
planners/MEEA/saved_model/value_pc.pt
planners/MEEA/saved_model/template_rules.dat
- Install with
pip
pip install -e .
cd planners/MEEA && pip install -e rdchiral && cd ../..
pip install streamlit # optional; only required for the UIInstead of manually installing, you may opt to use our pre-built container by running
docker pull frazierbaker/larc
In this case, there is no need to follow instructions for the manual installation.
-
Acquire API tokens for huggingface and Claude, respectively. To use Mistral as a base LLM, you will need to request access to the
mistralai/Mistral-Nemo-Instruct-2407. To use Claude as a base LLM, you will need a funded Anthropic API account. -
Launch the User Interface
With Docker:
docker run -p 8501:8501 -d frazierbaker/larc
Without Docker:
cd ./planners/MEEA && streamlit run app.py
-
Navigate to http://localhost:8501/
-
Add your API tokens to the UI, specify your target molecule and constraint in the form, and run LARC.
-
Acquire API tokens for huggingface and Claude, respectively. To use Mistral as a base LLM, you will need to request access to the
mistralai/Mistral-Nemo-Instruct-2407. To use Claude as a base LLM, you will need a funded Anthropic API account. -
Set environment variables:
export ANTHROPIC_API_KEY=HF_...
export HF_TOKEN=sk-ant-...- Run
meea_constrained.pyfor LARC with Claude as a Base LLM ormeea_constrained_mistral.pyfor LARC with Mistral as a Base LLM.
Example:
cd planners/MEEA
python3 meea_constrained.py 'Synthesize `{SMILES}` without using any known or suspected carcinogens.'
python3 meea_constrained_mistral.py 'Synthesize `{SMILES}` without using pyrophoric reagents.'You may run either command with --help to see more information on how to choose hyperparameters.
By default, results will be saved to the ./test directory.