Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

sdpython/lightmlrestapi

Repository files navigation

Build status

Build Status Windows

image

image

MIT License

image

GitHub Issues

Notebook Coverage

size

lightmlrestapi

It implements a light machine learning REST API based on falcon. If I were to start again this project, I would probably choose FastAPI. You can test a dummy wsgi server by running:

start_mlrestapi --name=dummy

And then query it with:

import requests
import ujson
features = ujson.dumps({'X': [0.1, 0.2]})
r = requests.post('http://127.0.0.1:8081', data=features)
print(r)
print(r.json())

It should return:

{'Y': [[0.4994216179, 0.4514893599, 0.0490890222]]}

The module was first tried with success in a hackathon in 2018. Participants could upload their model and retrieve their predictions through a REST API to check it was producing the same one as they had. A simple way to put a model into production.