Local inference

Documentation to run models on-premises

The Ersilia Model Hub is conveniently offered as a python package through PyPi and CondaForge, and each model is individually packaged as a Docker container.

Installation in Linux/MacOS

Ersilia is only maintained for Linux and Mac Operating Systems. If you work in Windows please use a Windows Subsystem Linuxarrow-up-right.

Prerequisites

  • Python: we maintain Ersilia for Python 3.8 and above. Please make sure you have a compatible Python version installed on your computer. Visit the official Python sitearrow-up-right to learn more.

  • Conda: ensure either Anacondaarrow-up-right or Minicondaarrow-up-right are available in your system. This is the command to install it in Ubuntu (the command may be different if you do not use Ubuntu):

mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh
  • Docker: Docker containers are an excellent way to share applications and simplify the management of system requirements and configurations. Please install Dockerarrow-up-right to ensure that all our AI/ML assets will work smoothly in your local device.

Install from PyPi

# install ersilia from PyPi in an independent conda environment
conda create -n ersilia python=3.12
conda activate ersilia
pip install ersilia

Install from CondaForge

Once the Ersilia Model Hub is installed, test that it works by running the --help command:

Input and output

The Ersilia Model Hub takes chemical structures as input, which should be specified as SMILES strings. To obtain the SMILES string of your compounds, you can use resources like PubChemarrow-up-right.

Ersilia only accepts an input file in csv format, with one column and a header. Predictions are returned in tabular format as .csv.

Understanding Model Outputs

Because the Ersilia Model Hub hosts a wide variety of models the outputs you receive will look different depending on the specific model you run.

When you run a prediction (either locally via the CLI or through the online inference app), the resulting CSV file will always contain at least two standard columns:

  • key: A 32-character unique identifier created by Ersilia for the molecule.

  • input: The input itself (SMILES string).

The remaining columns contain the actual predictions generated by the model. To find out exactly what each prediction column means, what type of data it contains (float, integer, string), and how to interpret the direction of the value, you should refer to the model's specific documentation.

You can find the exact definitions for a model's output columns in two places:

  1. The Model's GitHub Repository: You can read the description directly in the README file of the specific model's repository (e.g., https://github.com/ersilia-os/eos...).

  2. The run_columns.csv File: Inside every Ersilia model repository, there is a dedicated file that strictly defines the outputs. You can find this file located at:

    model/framework/columns/run_columns.csv

Model Usage

Using the Ersilia CLI

1

Fetch

Download a model, along with its specific environment and dependencies, from the Ersilia Model Hub to your local machine.

circle-exclamation
circle-info

You can access the list of available models in our ersilia catalogarrow-up-right

2

Serve

Initialize the downloaded model by spinning up a local container or API, preparing it to accept inputs and generate predictions.

circle-exclamation
3

Run

Run: Pass your input data (like SMILES strings) through the active model to generate and retrieve predictions.

4

Close

Shut down the active model and terminate its local container or API to free up system resources.

As a Python package

Models can be fetched from the Ersilia Model Hub, served, and run as a Python package. The commands mirror the Command Line Interface for simplicity:

Last updated

Was this helpful?