Quickstart Guide

Get up and running with DeepRetro in 5 minutes.

Installation

Option 1: Docker Installation (Recommended)

Listing 1 Docker setup
1git clone <repository-url>
2cd recursiveLLM
3cp env.example .env
4# Edit .env with your API keys
5docker-compose up -d

Option 2: Local Development Installation

1. Clone and setup environment:

Listing 2 Environment setup
1git clone <repository-url>
2cd DeepRetro
3conda env create -f environment.yml
4conda activate deepretro

2. Configure API keys:

Create .env file:

Listing 3 Environment configuration
1# Required: Backend API key
2API_KEY=your-backend-key
3
4# LLM API keys (choose based on your model preference)
5ANTHROPIC_API_KEY=your-anthropic-key      # For Claude models
6FIREWORKS_API_KEY=your-fireworks-key      # For DeepSeek models

3. Download models:

Listing 4 Model download
1mkdir -p aizynthfinder/models
2download_public_data aizynthfinder/models/

Quick Start

1. Start the backend:

Listing 5 Start API server
1python src/api.py

2. Start the web interface:

Listing 6 Start web interface
1cd viewer
2python -m http.server 8000

Important

Before using the web interface, edit viewer/config.js to set your backend API endpoint (e.g., http://localhost:5000). This ensures the frontend communicates with your running backend server.

3. Test the API:

Listing 7 Test API endpoint
1curl -H "X-API-KEY: your-api-key" \
2     -H "Content-Type: application/json" \
3     http://localhost:5000/api/health

Available Models

LLM Models:

Model

Identifier

Claude 3 Opus

claude3

Claude 3.7 Sonnet

claude37

Claude 4 Sonnet

claude4

DeepSeek-R1

deepseek

AiZynthFinder Models:

Model

Access

Description

USPTO

Free

Standard USPTO database (default, downloaded automatically in Docker)

Pistachio_25

Licensed

25% Pistachio database coverage

Pistachio_50

Licensed

50% Pistachio database coverage

Pistachio_100

Licensed

100% Pistachio database coverage

Pistachio_100+

Licensed

Enhanced coverage with optimizations

Basic Usage

API Request

Simple analysis:

Listing 8 Basic API request
1curl -X POST http://localhost:5000/api/retrosynthesis \
2  -H "X-API-KEY: your-key" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "smiles": "CC(C)(C)OC(=O)N[C@@H](CC1=CC=CC=C1)C(=O)O",
6    "model_type": "claude37"
7  }'

Advanced analysis:

Listing 9 Advanced features enabled
 1curl -X POST http://localhost:5000/api/retrosynthesis \
 2  -H "X-API-KEY: your-key" \
 3  -H "Content-Type: application/json" \
 4  -d '{
 5    "smiles": "CC(C)(C)OC(=O)N[C@@H](CC1=CC=CC=C1)C(=O)O",
 6    "model_type": "claude37",
 7    "advanced_prompt": true,
 8    "stability_flag": true,
 9    "hallucination_check": true,
10    "model_version": "USPTO"
11  }'

Python Usage

Make API requests using the requests library. See API Reference for complete endpoint documentation.

Web Interface

Open http://localhost:8000 in your browser.

Features:

Feature

Description

SMILES Input

Enter SMILES strings or paste from clipboard

Model Selection

Choose from Claude 3, Claude 3.7, Claude 4, DeepSeek

Interactive Visualization

Tree view of synthesis pathways with confidence scores

Step Editing

Edit and rerun specific pathway steps

File Management

Upload/download JSON pathway files

Export Options

Export as JSON, CSV, or images

Response Format

Success Response:

Listing 10 Successful API response
 1{
 2  "status": "success",
 3  "data": {
 4    "pathway": [
 5      {
 6        "step": 1,
 7        "step_id": "step_1",
 8        "smiles": "CC(C)(C)OC(=O)N[C@@H](CC1=CC=CC=C1)C(=O)O",
 9        "precursors": [
10          {
11            "smiles": "CC(C)(C)OC(=O)Cl",
12            "confidence": 0.85,
13            "reaction_type": "acylation",
14            "availability": "commercial"
15          },
16          {
17            "smiles": "N[C@@H](CC1=CC=CC=C1)C(=O)O",
18            "confidence": 0.92,
19            "reaction_type": "acylation",
20            "availability": "commercial"
21          }
22        ],
23        "reaction_confidence": 0.88,
24        "feasibility_score": 0.75
25      }
26    ],
27    "metadata": {
28      "model_used": "anthropic/claude-3-7-sonnet-20250219",
29      "processing_time": 2.5,
30      "total_steps": 1,
31      "advanced_prompt": true
32    }
33  }
34}

Error Response:

Listing 11 Error response format
1{
2  "status": "error",
3  "error": {
4    "code": "INVALID_SMILES",
5    "message": "The provided SMILES string is invalid",
6    "details": "Could not parse SMILES: 'invalid_string'"
7  }
8}

Common Parameters

Request Parameters:

Parameter

Type

Required

Default

Description

smiles

string

Target molecule SMILES string

model_type

string

claude3

LLM model: claude3, claude37, deepseek, claude4opus

advanced_prompt

boolean

false

Enhanced prompting for better results

model_version

string

USPTO

AiZynthFinder model version

stability_flag

boolean

false

Enable molecular stability checks

hallucination_check

boolean

false

Enable hallucination detection

Next Steps

Tip

Ready to explore more?

Common Use Cases:

  1. Drug Discovery - Analyze pharmaceutical intermediates

  2. Chemical Synthesis - Plan multi-step organic syntheses

  3. Process Development - Optimize synthetic routes

  4. Research - Explore novel synthetic pathways

  5. Education - Learn retrosynthetic analysis

Getting Help:

  • Check the User Guide for troubleshooting

  • Open an issue for bugs or feature requests