Skip to content

Deploying a stock prediction model as a RESTful API using FastAPI to AWS EC2

License

Notifications You must be signed in to change notification settings

mazon1/Stock-Predictor

Repository files navigation

Deployment of Stock Prediction Model as a RESTful API using FastAPI and AWS EC2

This project aims to deploy a Stock Prediction Model as a RESTful API using FastAPI, a modern, fast (high-performance) web framework for building APIs with Python. The API will be deployed on an AWS EC2 instance.

Requirements

Python 3.7 or higher FastAPI Uvicorn Requests AWS EC2 Instance

Installation

Clone the repository Install the required packages using pip install -r requirements.txt Run the API using uvicorn main:app --host 0.0.0.0 --port 8000

API Endpoints

/ - Returns the API status and usage instructions /predict - Accepts a POST request with a JSON payload containing the stock data to be used for the prediction. Returns a JSON response containing the predicted stock price. Deployment

Launch an AWS EC2 instance.

Install the necessary packages on the EC2 instance. Copy the project files to the EC2 instance. Start the API using uvicorn main:app --host 0.0.0.0 --port 8000 on the EC2 instance. Test the API using a client such as curl or Postman.

Credits

This project was developed by Uchenna Mgbaja and is licensed under the MIT License.

About

Deploying a stock prediction model as a RESTful API using FastAPI to AWS EC2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages