This project creates a microservice for generic item recommendations using Vowpal Wabbit and FastAPI. The service exposes two endpoints, one for training and one for prediction. All events are logged and persisted to an SQLite database.
/vw_recommendation /app init.py main.py models.py vw_model.py database.py logger.py /logs Dockerfile requirements.txt
- Clone the repository:
git clone https://github.com/cabjr/recommendation-service
- Navigate to the project directory:
cd recommendation-service
- Install the dependencies:
pip install -r requirements.txt
- Run the server:
uvicorn app.main:app --reload
The application will be accessible at localhost:8000
.
FastAPI automatically generates a Swagger UI documentation for all the endpoints. After running the server, the API documentation is accessible at localhost:8000/docs
.
All the events are logged into a file inside the /logs
directory.
The application uses SQLite for data persistence, and all events (like training and prediction) are stored in the database. SQLAlchemy is used as the ORM for handling database operations.