Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Template source code and instructions for serving ML models with FastAPI, Flask, BentoML, Streamlit, MLflow, and as an Android app.
Serving Machine Learning Models is a boilerplate GitHub repository by Nneji123 that bundles template source code, instructions, and examples for deploying trained machine learning models as REST APIs, web apps, and an Android application using Python.
Serving Machine Learning Models is a multi-framework template repository that takes a trained car price prediction model (saved as a .pkl file with joblib) and produces runnable serving applications in FastAPI, Flask, BentoML, MLflow, Streamlit, and KivyMD. It runs on Python 3.8.10, which a provided setup.sh script installs via pyenv, and each framework folder contains its own requirements.txt. The repository is maintained by Nneji123 and is licensed under MIT.
Data scientists who want to turn a trained model into a production REST API. ML engineers who need working Docker and cloud deployment setups for model serving. DevOps engineers looking to automate model redeployment with GitHub Actions. Students and tutorial-followers who want to compare FastAPI, Flask, BentoML, MLflow, and Streamlit on the same model.
The workflow is: clone the repository, run ./setup.sh to install pyenv and Python 3.8.10, then cd into the framework folder of your choice (for example fastapi), pip install -r requirements.txt, and launch the app — uvicorn app:app --reload for FastAPI, python app.py for Flask, streamlit run streamlit_app.py for Streamlit. Each app uses the same saved model files in its models/ directory.
The repository includes FastAPI, Flask, BentoML, MLflow, Streamlit, and KivyMD folders, each with a runnable car price prediction app and its own requirements.txt file.
The example model predicts car prices using cars.csv, a dataset from Kaggle. A Data Dictionary file explaining the columns is included in both the Data/ and bentoml/ folders.
Yes, the androidapp folder uses KivyMD and buildozer. The README mentions that prebuilt APK files are available in the bin folder of the data branch of the repository.
The repository is licensed under the MIT license, as stated in the LICENSE.md file.
The README provides commands to install the Heroku CLI, log in, create an app, set the stack to container, and git push. GitHub Actions also handles continuous deployment to Heroku for the Flask and FastAPI apps.
