Instructions to use AI4Chem/ChemLLM-7B-Chat-1_5-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI4Chem/ChemLLM-7B-Chat-1_5-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AI4Chem/ChemLLM-7B-Chat-1_5-DPO", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AI4Chem/ChemLLM-7B-Chat-1_5-DPO", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AI4Chem/ChemLLM-7B-Chat-1_5-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI4Chem/ChemLLM-7B-Chat-1_5-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI4Chem/ChemLLM-7B-Chat-1_5-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AI4Chem/ChemLLM-7B-Chat-1_5-DPO
- SGLang
How to use AI4Chem/ChemLLM-7B-Chat-1_5-DPO 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 "AI4Chem/ChemLLM-7B-Chat-1_5-DPO" \ --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": "AI4Chem/ChemLLM-7B-Chat-1_5-DPO", "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 "AI4Chem/ChemLLM-7B-Chat-1_5-DPO" \ --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": "AI4Chem/ChemLLM-7B-Chat-1_5-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AI4Chem/ChemLLM-7B-Chat-1_5-DPO with Docker Model Runner:
docker model run hf.co/AI4Chem/ChemLLM-7B-Chat-1_5-DPO
ChemLLM-7B-Chat-1.5-DPO: LLM for Chemistry and Molecule Science
ChemLLM-7B-Chat-1.5-DPO, The First Open-source Large Language Model for Chemistry and Molecule Science, Build based on InternLM-2 with ❤

News
- ChemLLM-1.5 updated! Have a try on Demo Site or API Reference.[2024-3-23]
- ChemLLM has been featured by HuggingFace on “Daily Papers” page.[2024-2-13]
- ChemLLM arXiv preprint released.ChemLLM: A Chemical Large Language Model[2024-2-10]
- News report from Shanghai AI Lab[2024-1-26]
- ChemLLM-7B-Chat ver 1.0 released. https://chemllm.org/ [2024-1-18]
- ChemLLM-7B-Chat ver 1.0 open-sourced.[2024-1-17]
- Chepybara ver 0.2 online Demo released. https://chemllm.org/ [2023-12-9]
Usage
Try online demo instantly, or Deploy it locally.
Cite this work
@misc{zhang2024chemllm,
title={ChemLLM: A Chemical Large Language Model},
author={Di Zhang and Wei Liu and Qian Tan and Jingdan Chen and Hang Yan and Yuliang Yan and Jiatong Li and Weiran Huang and Xiangyu Yue and Dongzhan Zhou and Shufei Zhang and Mao Su and Hansen Zhong and Yuqiang Li and Wanli Ouyang},
year={2024},
eprint={2402.06852},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
Disclaimer
LLM may generate incorrect answers, Please pay attention to proofreading at your own risk.
Open Source License
The code is licensed under Apache-2.0, while model weights are fully open for academic research and also allow free commercial usage. To apply for a commercial license, or other questions and collaborations, please contact support@chemllm.org.
Demo
Contact
(AI4Physics Sciecne, Shanghai AI Lab)[support@chemllm.org]
- Downloads last month
- 133
