Quickstart Guide
Get up and running with DeepRetro in 5 minutes.
Installation
Option 1: Docker Installation (Recommended)
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:
1git clone <repository-url>
2cd DeepRetro
3conda env create -f environment.yml
4conda activate deepretro
2. Configure API keys:
Create .env file:
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:
1mkdir -p aizynthfinder/models
2download_public_data aizynthfinder/models/
Quick Start
1. Start the backend:
1python src/api.py
2. Start the 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:
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 |
|
Claude 3.7 Sonnet |
|
Claude 4 Sonnet |
|
DeepSeek-R1 |
|
AiZynthFinder Models:
Model |
Access |
Description |
---|---|---|
|
Free |
Standard USPTO database (default, downloaded automatically in Docker) |
|
Licensed |
25% Pistachio database coverage |
|
Licensed |
50% Pistachio database coverage |
|
Licensed |
100% Pistachio database coverage |
|
Licensed |
Enhanced coverage with optimizations |
Basic Usage
API Request
Simple analysis:
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:
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:
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:
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 |
---|---|---|---|---|
|
string |
✓ |
— |
Target molecule SMILES string |
|
string |
|
LLM model: |
|
|
boolean |
|
Enhanced prompting for better results |
|
|
string |
|
AiZynthFinder model version |
|
|
boolean |
|
Enable molecular stability checks |
|
|
boolean |
|
Enable hallucination detection |
Next Steps
Tip
Ready to explore more?
User Guide - Complete API documentation
API Reference - Detailed API reference
Development Guide - Development setup and contribution guide
Common Use Cases:
Drug Discovery - Analyze pharmaceutical intermediates
Chemical Synthesis - Plan multi-step organic syntheses
Process Development - Optimize synthetic routes
Research - Explore novel synthetic pathways
Education - Learn retrosynthetic analysis
Getting Help:
Check the User Guide for troubleshooting
Open an issue for bugs or feature requests