ChatMOL: PyMOL ChatGPT Plugin with Free chatlite version

Summary

ChatMol is a ChatGPT plugin that offers a Free chatlite version that does not require an API key.

ChatMol

ChatMol is a PyMOL plugin based on  large language models, that provide a conversational interface (CUI) for molecular operation and computation. Current supported models include models from OpenAI (ChatGPT versions), Anthropic (Claude versions), DeepSeek, and ollama, the latter for user able to run ollama locally.

ChatMOL code is found at https://github.com/ChatMol/ChatMol

Once installed the user can use the command chatlite  or the command chat to issue commands to PyMOL.

The chatlite  command is the most readily command to use and will immediately act on the request. See more below.

As of this writing chat gives a 404 error.

Installation

The current version of PyMOL is at 3.1.1 but in fact there are 2 options to running PyMOL: the “open source” (free version) and the “incentive” license-based version (that still runs without the incentive options without the license.)

Installing ChatMOL is different depending on which version is used.

Incentive version

The University of Wisconsin-Madison participates in the Incentive PyMOL licensing and UW-Madison user can download the software and the license  from the UW-Madison software library at software.wisc.edu (requires NetID login.)

Open source version

The open source version is available as source code on github (pymol-open-source) but can be installed in various (perhaps easier) other ways:

1) conda / miniconda

Specific, exact instructions are located at pymol.org/conda/

Personal note:  Using conda can be “easy” but for me most of the time it is a lengthy and annoying proposition as conda tests all python packages against all currently installed packages and it can take hours before anything happens!
For this installation I killed the process after about 2hrs of endless testing, deleted the existing “Anaconda” installation, and decided on the simplest version called miniconda3(I tried mamba or micromamba unsuccessfully for installing as well.)

The installation command I used was:

conda install -c conda-forge pymol-open-source

But the suggested command on the PyMOL site is:

conda install -c conda-forge -c schrodinger pymol-bundle

This method should work on all platforms: Mac/Windows/Linux.

The PyMOL program will then be located within the Users directory e.g. `~/miniforge3/bin/pymol and typically launched from a text terminal.

The important thing to remember is that the python program is installed at the same time.

2) homebrew / brew

This is only for Mac and Linux (and potentially Windows WSL2 Linux users. IF they have X11 installed as well.)

IF this is installed the command is:

brew install brewsci/bio/pymol

and the software is located in ~/homebrew/bin/pymol also typically opened via command line.

Note on open-source versions: the current version downloaded by these methods is 3.0.0 and has an interface identical to that of version 2.x. while the new incentive version has a new, updated interface.

Installing chatMOL

Installing ChatMOL requires an understanding of where and which python installation is used and in turn this depends on which version of PyMOL is used.

There are at least 3 possible options:

– Incentive PyMOL
– open-source installed as a conda package
– open-source installed with brew
– (Other possible options (e.g. installing from source) may exist but no details are provided here.)

Once understood or resolved using chatlite requires a single command:

load https://raw.githubusercontent.com/ChatMol/ChatMol/main/chatmol.py

Using chatlite does not require any “API KEY” and is the easiest method to first test the possibilities.

Below are details in the order that makes it easiest.

Incentive PyMOL

This version is called PyMOL.app and on a Mac would be found within the standard location of /Applications/.

The incentive version contains its own, internal (built-in) Python and does not rely on an “external” Python installation. As such it is rather independent. On my Mac I can simply open it with a double click, copy/paste the “load” command above and chatlite works.

Open-source pymol installed as a conda package

This version will depend on the Python version that conda or miniconda has installed. In this case the PyMOL program is not an “App” but a “binary” command which is generally called from command line. On my Mac installation I can check where it is located with:

which pymol

/Users/jsgro/miniforge3/bin/pymol

If theconda installation was done correctly, this will be on the PATH (check it out with echo $PATH) and the software can then be opened from a text Terminal with:

pymol &

(The & will place the software in the “background and will let you keep the hand on the Terminal for more commands if needed.)

Then, load the ChatMOL command and issue the first test:

load https://raw.githubusercontent.com/ChatMol/ChatMol/main/chatmol.py

chatlite fetch a protein

The fetched protein is always PDB ID 1lw9.

If all went well your window will look like this:

PyMOL interface with T4 lysozyme PDB 1LW9

Open-source installed with brew

This version also depends on an external Python installation, namely one installed by. brew which is automatically installed or updated when the installation command brew install brewsci/bio/pymol is given. In my case this updated Python version 3.12 but in addition also installed Python 3.13.1.

This Python installation is managed differently and attempting to install other Python modules with pip will give the warning that “This environment is externally managed” explaining that packages have to be added within a “virtual environment.”

I first wrote the information below as an “issue” to the authors of ChatMOL (issue 41) with help from MS Copilot and from How do I use brew installed Python as the default Python?.

Here are the steps:

a) TO BE ADDED SOON (see issue 41 for immediate info)