Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ur-whitelab/chemcrow-public
Chemcrow
https://github.com/ur-whitelab/chemcrow-public
Last synced: 6 days ago
JSON representation
Chemcrow
- Host: GitHub
- URL: https://github.com/ur-whitelab/chemcrow-public
- Owner: ur-whitelab
- License: mit
- Created: 2023-06-04T15:59:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-19T17:47:04.000Z (15 days ago)
- Last Synced: 2024-12-21T23:04:20.590Z (13 days ago)
- Language: Python
- Homepage:
- Size: 5.78 MB
- Stars: 656
- Watchers: 18
- Forks: 99
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ai-agents - GitHub
- best-of-atomistic-machine-learning - GitHub - 36% open ยท โฑ๏ธ 27.03.2024): (Language Models)
README
[![tests](https://github.com/ur-whitelab/chemcrow-public/actions/workflows/tests.yml/badge.svg)](https://github.com/ur-whitelab/chemcrow-public)
[![PyPI](https://img.shields.io/pypi/v/chemcrow)](https://img.shields.io/pypi/v/chemcrow)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/chemcrow)](https://img.shields.io/pypi/pyversions/chemcrow)
[![DOI:10.1101/2020.07.15.204701](https://zenodo.org/badge/DOI/10.48550/arXiv.2304.05376.svg)](https://doi.org/10.48550/arXiv.2304.05376)
[![DOI](https://zenodo.org/badge/649361700.svg)](https://zenodo.org/doi/10.5281/zenodo.10884638)
ChemCrow is an open source package for the accurate solution of reasoning-intensive chemical tasks.
Built with Langchain, it uses a collection of chemical tools including RDKit, paper-qa, as well as some relevant databases in chemistry, like Pubchem and chem-space.
## ๐ค Try it out in [HuggingFace](https://huggingface.co/spaces/doncamilom/ChemCrow)!
[![ChemCrow Demo](assets/hf-demo.png)](https://huggingface.co/spaces/doncamilom/ChemCrow)
## โ ๏ธ Note
This package does not contain all the tools described in the [ChemCrow paper](https://arxiv.org/abs/2304.05376) because
of API usage restrictions. This repo will not give the same results as that paper.All the experiments have been released under [ChemCrow runs](https://github.com/ur-whitelab/chemcrow-runs).
## ๐ฉโ๐ป Installation
```
pip install chemcrow
```## ๐ฅ Usage
First set up your API keys in your environment.
```
export OPENAI_API_KEY=your-openai-api-key
```You can optionally use Serp API:
```
export SERP_API_KEY=your-serpapi-api-key
```In a Python session:
```python
from chemcrow.agents import ChemCrowchem_model = ChemCrow(model="gpt-4-0613", temp=0.1, streaming=False)
chem_model.run("What is the molecular weight of tylenol?")
```## ๐ ๏ธ Self-hosting of some tools.
By default, ChemCrow relies on the RXN4Chem API for retrosynthetic planning and reaction product prediction. This can however be slow and depends on you having an API key.
Optionally, you can also self host these tools by running some pre-made docker images.
Run
```
docker run --gpus all -d -p 8051:5000 doncamilom/rxnpred:latest
docker run --gpus all -d -p 8052:5000 doncamilom/retrosynthesis:latest
```Now ChemCrow can be used like this:
```python
from chemcrow.agents import ChemCrowchem_model = ChemCrow(model="gpt-4-0613", temp=0.1, streaming=False, local_rxn=True)
chem_model.run("What is the product of the reaction between styrene and dibromine?")
```## โ Citation
Bran, Andres M., et al. "ChemCrow: Augmenting large-language models with chemistry tools." arXiv preprint arXiv:2304.05376 (2023).```bibtex
@article{bran2023chemcrow,
title={ChemCrow: Augmenting large-language models with chemistry tools},
author={Andres M Bran and Sam Cox and Oliver Schilter and Carlo Baldassari and Andrew D White and Philippe Schwaller},
year={2023},
eprint={2304.05376},
archivePrefix={arXiv},
primaryClass={physics.chem-ph},
publisher={arXiv}
}
```