Text Generation
Transformers
Safetensors
qwen3
retrosynthesis
chemistry
agent
planning
tool-use
conversational
text-generation-inference
Instructions to use sxkdz/RetroAgent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sxkdz/RetroAgent with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sxkdz/RetroAgent") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sxkdz/RetroAgent") model = AutoModelForCausalLM.from_pretrained("sxkdz/RetroAgent", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sxkdz/RetroAgent with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sxkdz/RetroAgent" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sxkdz/RetroAgent", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sxkdz/RetroAgent
- SGLang
How to use sxkdz/RetroAgent with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sxkdz/RetroAgent" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sxkdz/RetroAgent", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sxkdz/RetroAgent" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sxkdz/RetroAgent", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sxkdz/RetroAgent with Docker Model Runner:
docker model run hf.co/sxkdz/RetroAgent
docs: trim tags, remove table bold and bib url
Browse files
README.md
CHANGED
|
@@ -8,9 +8,6 @@ tags:
|
|
| 8 |
- retrosynthesis
|
| 9 |
- chemistry
|
| 10 |
- agent
|
| 11 |
-
- tool-use
|
| 12 |
-
- reinforcement-learning
|
| 13 |
-
- gspo
|
| 14 |
---
|
| 15 |
|
| 16 |
# RetroAgent
|
|
@@ -30,14 +27,14 @@ Pass@1 and success rate (%) at different search budgets `N` on USPTO-190 and ChE
|
|
| 30 |
| Method | pass@1 | N=50 | N=100 | N=200 | N=300 | N=400 | N=500 |
|
| 31 |
|---|---|---|---|---|---|---|---|
|
| 32 |
| Retro-R1 (V1, 7B) | 50.00 | 64.63 | 71.32 | 78.11 | 80.89 | 82.95 | 84.32 |
|
| 33 |
-
|
|
| 34 |
|
| 35 |
### ChEMBL-1000
|
| 36 |
|
| 37 |
| Method | pass@1 | N=50 | N=100 | N=200 | N=300 | N=400 | N=500 |
|
| 38 |
|---|---|---|---|---|---|---|---|
|
| 39 |
| Retro-R1 (V1, 7B) | 68.52 | 73.92 | 78.00 | 80.36 | 81.36 | 81.98 | 82.42 |
|
| 40 |
-
|
|
| 41 |
|
| 42 |
With a 4B model and no reranking by model probabilities, RetroAgent outperforms the 7B Retro-R1 on both benchmarks. The advantage is largest on the out-of-distribution ChEMBL-1000 set (+5.30 pass@1, +1.98 at N=500), indicating that the structured-memory interface yields transferable planning strategies rather than dataset-specific memorization.
|
| 43 |
|
|
@@ -67,8 +64,7 @@ tokenizer = AutoTokenizer.from_pretrained("SXKDZ/RetroAgent")
|
|
| 67 |
title = {RetroAgent: Harnessing {LLMs} to Search Over Structured Memory for Agentic Retrosynthesis Planning},
|
| 68 |
author = {Zhu, Yanqiao and Gan, Jingru and Sun, Xiaoqi and Sun, Fang and Shi, Yidan and Islam, Md Mofijul and Shang, Chao and Gao, Wenhao and Coley, Connor W. and Sun, Yizhou and Wang, Wei},
|
| 69 |
booktitle = {Conference on Language Modeling (COLM)},
|
| 70 |
-
year = {2026}
|
| 71 |
-
url = {https://github.com/SXKDZ/RetroAgent}
|
| 72 |
}
|
| 73 |
```
|
| 74 |
|
|
|
|
| 8 |
- retrosynthesis
|
| 9 |
- chemistry
|
| 10 |
- agent
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
# RetroAgent
|
|
|
|
| 27 |
| Method | pass@1 | N=50 | N=100 | N=200 | N=300 | N=400 | N=500 |
|
| 28 |
|---|---|---|---|---|---|---|---|
|
| 29 |
| Retro-R1 (V1, 7B) | 50.00 | 64.63 | 71.32 | 78.11 | 80.89 | 82.95 | 84.32 |
|
| 30 |
+
| RetroAgent (4B) | 53.26 | 58.42 | 70.53 | 78.63 | 81.58 | 83.68 | 85.05 |
|
| 31 |
|
| 32 |
### ChEMBL-1000
|
| 33 |
|
| 34 |
| Method | pass@1 | N=50 | N=100 | N=200 | N=300 | N=400 | N=500 |
|
| 35 |
|---|---|---|---|---|---|---|---|
|
| 36 |
| Retro-R1 (V1, 7B) | 68.52 | 73.92 | 78.00 | 80.36 | 81.36 | 81.98 | 82.42 |
|
| 37 |
+
| RetroAgent (4B) | 73.82 | 76.36 | 79.62 | 81.96 | 83.22 | 83.94 | 84.40 |
|
| 38 |
|
| 39 |
With a 4B model and no reranking by model probabilities, RetroAgent outperforms the 7B Retro-R1 on both benchmarks. The advantage is largest on the out-of-distribution ChEMBL-1000 set (+5.30 pass@1, +1.98 at N=500), indicating that the structured-memory interface yields transferable planning strategies rather than dataset-specific memorization.
|
| 40 |
|
|
|
|
| 64 |
title = {RetroAgent: Harnessing {LLMs} to Search Over Structured Memory for Agentic Retrosynthesis Planning},
|
| 65 |
author = {Zhu, Yanqiao and Gan, Jingru and Sun, Xiaoqi and Sun, Fang and Shi, Yidan and Islam, Md Mofijul and Shang, Chao and Gao, Wenhao and Coley, Connor W. and Sun, Yizhou and Wang, Wei},
|
| 66 |
booktitle = {Conference on Language Modeling (COLM)},
|
| 67 |
+
year = {2026}
|
|
|
|
| 68 |
}
|
| 69 |
```
|
| 70 |
|