/amplopt.streamlit.app

AMPL Modeling Tips with Streamlit

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

AMPL Streamlit Apps

Streamlit App

AMPL is the most powerful and intuitive tool for developing and deploying complex optimization solutions in business & scientific applications. AMPL connects to most open-source and commercial solvers and allows you to switch easily between them.

AMPL has APIs for several popular programming languages (e.g., Python, R, etc.) and it allows you to only model once in AMPL and interact with it using an API for a language you are familiar with.

Follow us on Twitter and LinkedIn to get the latest updates from the dev team!

Build your own app with AMPL & Streamlit

AMPL and all Solvers are now available as Python Packages. To use them in streamlit you just need to list the modules in the requirements.txt file as follows:

--index-url https://pypi.ampl.com # AMPL's Python Package Index
--extra-index-url https://pypi.org/simple
ampl_module_base # AMPL
ampl_module_highs # HiGHS solver
ampl_module_gurobi # Gurobi solver
amplpy # Python API for AMPL

and load them in streamlit_app.py:

from amplpy import AMPL
ampl = AMPL()

How to run it locally

$ python -m venv venv
$ source venv/bin/activate
$ python -m install -r requirements.txt --upgrade
$ streamlit run streamlit_app.py

When you are ready deploy to https://streamlit.io/! This app is running there: https://share.streamlit.io/fdabrandao/amplopt.streamlit.app/