This repository contains a fully-fledged machine learning-based microservice built with the FastAPI framework. The microservice exposes endpoints for seamless integration with machine learning models, making it easy to deploy and scale.
-
FastAPI Framework: Utilizes FastAPI, a modern, fast, and web-based framework for building APIs with Python 3.7+.
-
AWS ECR and ECS Deployment: The microservice is designed to be easily deployed on Amazon Elastic Container Registry (ECR) and Elastic Container Service (ECS), providing a scalable and reliable cloud infrastructure.
-
Clone the repository:
git clone https://github.com/henrii1/fastapi-ml-microservice.git cd fastapi-ml-microservice
-
Set up your Python environment (Python 3.8 or higher recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Run the streamlit app:
streamlit run webapp/app_streamlit.py
-
Run the FastAPI application:
uvicorn main:app --reload
-
Access the API at
http://127.0.0.1:8000
and explore the available endpoints.
For deployment on AWS ECR and ECS, follow the provided deployment scripts and configuration files. Ensure that your AWS credentials are properly configured.
This project is licensed under the MIT License - see the LICENSE file for details.