Skip to content

Commit

Permalink
updated README, etc for alternative llm providers
Browse files Browse the repository at this point in the history
  • Loading branch information
qcampbel committed Aug 17, 2024
1 parent 5e315bd commit bd9df26
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
# OpenAI API Key
OPENAI_API_KEY=YOUR_OPENAI_API_KEY_GOES_HERE # pragma: allowlist secret

# Serp API key
# Serp API key to use Git Issues tool (optional)
SERP_API_KEY=YOUR_SERP_API_KEY_GOES_HERE # pragma: allowlist secret

# PQA API Key to use LiteratureSearch tool (optional) -- it also requires OpenAI key
PQA_API_KEY=YOUR_PQA_API_KEY_GOES_HERE # pragma: allowlist secret

# Optional: add TogetherAI Fireworks, or Anthropic API key here to use their models
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
MD-Agent is a LLM-agent based toolset for Molecular Dynamics.
MDAgent is a LLM-agent based toolset for Molecular Dynamics.
It's built using Langchain and uses a collection of tools to set up and execute molecular dynamics simulations, particularly in OpenMM.


## Environment Setup
To use the OpenMM features in the agent, please set up a conda environment, following these steps.
- Create conda environment: `conda env create -n mdagent -f environment.yaml`
- Activate your environment: `conda activate mdagent`
```
conda env create -n mdagent -f environment.yaml
conda activate mdagent
```

If you already have a conda environment, you can install dependencies before you activate it with the following step.
- Install the necessary conda dependencies: `conda env update -n <YOUR_CONDA_ENV_HERE> -f environment.yaml`

If you already have a conda environment, you can install dependencies with the following step.
- Install the necessary conda dependencies: `conda install -c conda-forge openmm pdbfixer mdtraj`


## Installation
```
pip install git+https://github.com/ur-whitelab/md-agent.git
```


## Usage
The first step is to set up your API keys in your environment. An OpenAI key is necessary for this project.
The next step is to set up your API keys in your environment. An API key for LLM provider is necessary for this project. Supported LLM providers are OpenAI, TogetherAI, Fireworks, and Anthropic.
Other tools require API keys, such as paper-qa for literature searches. We recommend setting up the keys in a .env file. You can use the provided .env.example file as a template.
1. Copy the `.env.example` file and rename it to `.env`: `cp .env.example .env`
2. Replace the placeholder values in `.env` with your actual keys

<!-- ## Using Streamlit Interface
If you'd like to use MDAgent via the streamlit app, make sure you have completed the steps above. Then, in your terminal, run `streamlit run st_app.py` in the project root directory.
You can ask MDAgent to conduct molecular dynamics tasks using OpenAI's GPT model
```
from mdagent import MDAgent
agent = MDAgent(model="gpt-3.5-turbo")
agent.run("Simulate protein 1ZNI at 300 K for 0.1 ps and calculate the RMSD over time.")
```
Note: to distinguish Together models from the rest, you'll need to add "together\" prefix in model flag, such as `agent = MDAgent(model="together/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo")`

From there you may upload files to use during the run. Note: the app is currently limited to uploading .pdb and .cif files, and the max size is defaulted at 200MB.
- To upload larger files, instead run `streamlit run st_app.py --server.maxUploadSize=some_large_number`
- To add different file types, you can add your desired file type to the list in the [streamlit app file](https://github.com/ur-whitelab/md-agent/blob/main/st_app.py). -->
## LLM Providers
By default, we support LLMs through OpenAI API. However, feel free to use other LLM providers. Make sure to install the necessary package for it. Here's list of packages required for alternative LLM providers we support:
- `pip install langchain_together` to use models from TogetherAI
- `pip install langchain_anthropic` to use models from Anthropic
- `pip install langchain_fireworks` to use models from Fireworks


## Contributing

We welcome contributions to MD-Agent! If you're interested in contributing to the project, please check out our [Contributor's Guide](CONTRIBUTING.md) for detailed instructions on getting started, feature development, and the pull request process.
We welcome contributions to MDAgent! If you're interested in contributing to the project, please check out our [Contributor's Guide](CONTRIBUTING.md) for detailed instructions on getting started, feature development, and the pull request process.

We value and appreciate all contributions to MD-Agent.
We value and appreciate all contributions to MDAgent.
2 changes: 1 addition & 1 deletion mdagent/tools/maketools.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def make_all_tools(
all_tools += [
ModifyBaseSimulationScriptTool(path_registry=path_instance, llm=llm),
]
if "OPENAI_API_KEY" in os.environ:
if "OPENAI_API_KEY" in os.environ and "PQA_API_KEY" in os.environ:
all_tools += [Scholar2ResultLLM(llm=llm, path_registry=path_instance)]
if human:
all_tools += [agents.load_tools(["human"], llm)[0]]
Expand Down

0 comments on commit bd9df26

Please sign in to comment.