Skip to content

ninglab/LARC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LARC

A Language Agentic framework for Retrosynthesis planning under Constraints

Installation and Setup

Manual Installation

  1. Clone this repository
git clone https://github.com/ninglab/LARC
  1. 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/MEEA so 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
  1. Install with pip
pip install -e .
cd planners/MEEA && pip install -e rdchiral && cd ../..
pip install streamlit # optional; only required for the UI

Docker Installation

Instead 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.

Running LARC-UI

  1. 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.

  2. Launch the User Interface

With Docker:

docker run -p 8501:8501 -d frazierbaker/larc

Without Docker:

cd ./planners/MEEA && streamlit run app.py
  1. Navigate to http://localhost:8501/

  2. Add your API tokens to the UI, specify your target molecule and constraint in the form, and run LARC.

Running LARC-CLI

  1. 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.

  2. Set environment variables:

export ANTHROPIC_API_KEY=HF_...
export HF_TOKEN=sk-ant-...
  1. Run meea_constrained.py for LARC with Claude as a Base LLM or meea_constrained_mistral.py for 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published