Serving ML Model using GraphQL Subscription

alpha2phi
3 min readMay 9, 2021

Serve machine learning model using GraphQL subscription.

Photo by h heyerlein on Unsplash

Overview

In previous articles, I have used FastAPI + WebSocket + React to serve machine learning models. As machine learning models getting more complicated, the time to come out with predictions also takes longer. Using WebSocket provides an asynchronous method for the server to update the client with the prediction when the evaluation is completed.

GraphQL Subscription is a feature that allows a server to send data to its clients when a specific event happens and is usually implemented with WebSocket.

In this article, let’s explore using GraphQL to serve machine learning models. I am going to use

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.