An open API service indexing awesome lists of open source software.

https://github.com/pythonhealthdatascience/llm_simpy_models

The SimPy models and apps generated by LLMs, deployed as a single app.
https://github.com/pythonhealthdatascience/llm_simpy_models

Last synced: 3 months ago
JSON representation

The SimPy models and apps generated by LLMs, deployed as a single app.

Awesome Lists containing this project

README

        

[![Licence: MIT](https://img.shields.io/badge/Licence-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/-Python_≥_3.10-306998?logo=python&logoColor=white)](https://www.python.org/downloads/release/python-360+/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15082494.svg)](https://doi.org/10.5281/zenodo.15082494)

# Complementary repository: Final discrete-event simulation models and streamlit applications from Large Language Models

This repository is complementary to:

> Thomas Monks, Alison Harper, and Amy Heather. **Research Compendium: Replicating Simulations in Python using Generative AI**. https://github.com/pythonhealthdatascience/llm_simpy.

It contains the final formatted code from each of the SimPy discrete-event simulation models that were generated by Perplexity as part of that project.

The web applications are deployed as a single app on GitHub pages using `stlite`. This allows the app to run directly in a user's web browser without requiring any manual installations. It achieves this by using WebAssembly technology to run a serverless version of `streamlit` (i.e. `stlite`). The entire app, along with all its dependencies, are downloaded and installed within the browser at runtime using `pyodide` and `micropip`. There will be a short wait while the app is setup. Once the setup is complete, the app runs locally in the browser, meaning that no user data leaves the local machine. **Please note that `stlite` does not currently work in Mozilla Firefox**.

**Link to the deployed app:** https://pythonhealthdatascience.github.io/llm_simpy_models/

**Code:** The final formatted code from each stage are stored in 📁`pages\`:

* `CCU_Stage_1.py`
* `CCU_Stage_2.py`
* `Stroke_Stage_1.py`
* `Stroke_Stage_2.py`

The stroke `.py` files combine the seperate model and app .py files from the [llm_simpy](https://github.com/pythonhealthdatascience/llm_simpy) repository.

For a full record of the generation of these models, please refer to: https://github.com/pythonhealthdatascience/llm_simpy.


## 👥 Authors

* Thomas Monks    [![ORCID: Monks](https://img.shields.io/badge/ORCID-0000--0003--2631--4481-brightgreen)](https://orcid.org/0000-0003-2631-4481)

* Alison Harper    [![ORCID: Harper](https://img.shields.io/badge/ORCID-0000--0001--5274--5037-brightgreen)](https://orcid.org/0000-0001-5274-5037)

* Amy Heather    [![ORCID: Heather](https://img.shields.io/badge/ORCID-0000--0002--6596--3479-brightgreen)](https://orcid.org/0000-0002-6596-3479)


## 🌐 Creating the environment

The project uses `conda` to manage dependencies. Navigate your terminal to the directory containing the code and run:

```
conda env create -f binder/environment.yml
```

This will create a conda environment called `gen_simpy_apps`. To activate:

```
conda activate gen_simpy_apps
```

This environment is a simplified version of that from the [llm_simpy](https://github.com/pythonhealthdatascience/llm_simpy) repository, containing only the dependencies required for running the apps.


## 🖥️ Viewing the apps locally

For deployment, we have brought the LLM-generated apps together into a single app, which can be deployed by running:

```
streamlit run Home.py
```

However, you can also run the individual original apps generated by the LLMs by calling on a specific file - for example:

```
streamlit run pages/CCU_Stage_1.py
```

To test the stlite app locally, run the following command, and then open on your web browser:

```
python3 -m http.server
```


## 📝 Citation

Please cite the archived repository:

> Thomas Monks, Alison Harper, and Amy Heather. **Complementary repository: Final discrete-event simulation models and streamlit applications from Large Language Models**. .

You can also cite this GitHub repository as:

> Thomas Monks, Alison Harper, and Amy Heather. **Complementary repository: Final discrete-event simulation models and streamlit applications from Large Language Models**. .

A `CITATION.cff` file is also provided.


## 💰 Funding

This project was developed as part of the project STARS: Sharing Tools and Artefacts for Reproducible Simulations. It is supported by the Medical Research Council [grant number [MR/Z503915/1](https://gtr.ukri.org/projects?ref=MR%2FZ503915%2F1)].