ersilia-os / eos-template

Template repository to add new models to the Ersilia Model Hub
GNU General Public License v3.0
1 stars 2 forks source link
template

Ersilia Model Contribution

This README contains the instructions to incorporate a model. Please follow along to bring your model into the Ersilia Model Hub. After successful incorporation of the model, this README will be automatically updated to reflect model specific details.

Folder Structure

Generally, two important pieces make up a model that goes into the hub: the model checkpoints, and the code to load and make predictions with that model. With that in mind, the model folder is organised as follows:

└── model
    ├── checkpoints
    │   └── README.md
    └── framework
        ├── README.md
        ├── code
        │   └── main.py
        ├── examples
        │   ├── run_input.csv
        │   └── run_output.csv
        └── run.sh

Specifying Dependencies

To specify dependencies for this model, use the install.yml file to populate all the necessary dependencies required by the model to successfully run. This dependency configuration file has two top level keys:

The installation parser will raise an exception if dependencies are not specified in the aforementioned format.

Note: Please note that we realise that this form of dependency specification is restrictive. We are working on extending how Ersilia Pack handles dependency specification, for example, to handle VCS and URL based dependencies.

Specifying Model Metadata

Model metadata should be specified within metadata.yml. An explanation of what these metadata fields correspond to can be found here.

Specifying Model APIs

A bash script within the model/framework directory is interepreted by Ersilia as an API for the model. For example, run.sh corresponds to a model run API, and similarly, a fit.sh would correspond to a model fit API. However arbitrary file names for bash script files are not allowed, and the acceptable names are one of the following: [run, fit].

Adding Example Input and Output

It is always helpful to provide an example input and output while contributing a model to ease the verification of the model's working. To ensure all models always have an example, Ersilia checks for example CSV files in the model/framework/examples directory. In particular, Ersilia looks for input.csv, and output.csv files in this folder. These files are used to generate the necessary API end points for building a model server and therefore must always be provided.