Day 1 - This article is the first of a series of posts we will do during the Redis Venture hackathon. The goal is to keep a journal of our work.
What is MLOps?
MLOps is a term to describe general software engineering principles applied to the problems of serving machine learning models in production.
Code Best Practices
Building Python
Using GitHub Actions, we checked our code against the main
branch of the repo, ensuring not only style but also variables linking remain safe during development.
We used flake8
for basic linting and black
for code formatting.
Static analysis is essential in Python because the language uses duck typing and this can cause issues during runtime, problems that a compiler would have caught.
Improving readability, ensuring formatting and style, is essential to the team of developers.
Model Deployment
Ways to deploy a model
In a Python Machine Learning project, prototypes usually are written using Jupyter notebooks, such as the ones in the redis-arXiv-search/data
repository.
The first step to make it more professional, is to turn it to a pipeline. Pipelines usually are decomposed in steps which are responsible for handling one input file and another file as output.
The first step is to write a Python module component that enables us to produce a model, under certain conditions, and to be able to rerun it in a flexible way.
In Python, there are open source tools which help you in that process. For example, mlflow/mlflow
to deal with the lifecycle of training your models, measuring their performance and archiving models. In other situations, you might also want to run advanced pipelines with apache/airflow
which can take care of different steps such as data fetching, pre-processing and handling executions in different context with DAGs.
After scheduling the execution of this training component and storing the models, we usually need to serve the models to the end user.
Serving a model means performing predictions or getting the results of large numerical computations. Today, models are usually served through web servers and communicate with other applications through HTTP requests.
In Python, you would serve a REST API with the tiangolo/fastapi
framework, use a database such as redis/redis
to store your predictions. This is usually the case in systems like search engines or recommendation systems.
REST APIs allows clients to ask for a service in real time and get an answer quickly. Most website modern websites are designed this way. You can think of transportation information systems where the information has to be updated every minute.
We will see later how to leverage these concepts in the Redis Hackathon.
The Redis Hackathon
The Vector Search Engineering Lab hackathon is happening from October 24 to November 4, we have decided to participate with 4 engineers from Artefact. It is a hackathon centered of Vector Search using Redis technologies and the arXiv papers dataset.
The goal is to demonstrate through a small project how easy and powerful the following techniques are applicable to a modern web application problem:
- vector similarity search
- Natural Language Processing
- Text Mining
- Knowledge Graphs
- Document Retrieval
- Topic Identification
- Question & Answering
- Recommendation Systems
- Data Visualization
Using the right MLOps tools and technologies, we will build interesting experiences for all the users who want to search for scientific papers!