AsyncIO serving for data science models
Project description
Foxcross
AsyncIO serving for data science models built on Starlette
Requirements: Python 3.6+
Quick Start
Installation using pip
:
pip install foxcross
Create some test data and a simple model in the same directory to be served:
directory structure
.
+-- data.json
+-- models.py
data.json
[1,2,3,4,5]
models.py
from foxcross.serving import ModelServing, run_model_serving
class AddOneModel(ModelServing):
test_data_path = "data.json"
def predict(self, data):
return [x + 1 for x in data]
if __name__ == "__main__":
run_model_serving()
Run the model locally
python models.py
Navigate to localhost:8000/predict-test/
in your web browser, and you should see the
list incremented by 1. You can visit localhost:8000/
to see all the available
endpoints for your model.
Why does this package exist?
Currently, some of the most popular data science model building frameworks such as PyTorch and Scikit-Learn do not come with a built in serving library similar to TensorFlow Serving.
To fill this gap, people create Flask applications to serve their model. This can be error prone, and the implementation can differ between each model. Additionally, Flask is a WSGI web framework whereas Foxcross is built on Starlette, a more performant ASGI web framework.
Foxcross aims to be the serving library for data science models built with frameworks that do not come with their own serving library. Using Foxcross enables consistent and testable serving of data science models.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file foxcross-0.6.0.tar.gz
.
File metadata
- Download URL: foxcross-0.6.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.16 CPython/3.6.8 Linux/4.15.0-51-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6f7ba9b6a2bf6811c53013902046adc8282365e0a8a2a3427835c1e99dfc244 |
|
MD5 | dc580bcdde5508bf0df9d4bd9b597dd8 |
|
BLAKE2b-256 | 07ac570090faa1b9740b75d09f10923f622db8ecfe970123751d88ccb6c46db9 |
File details
Details for the file foxcross-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: foxcross-0.6.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.16 CPython/3.6.8 Linux/4.15.0-51-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | feb4727a1dced2606f595702ea161cd0f837e3da79da213c2081c29c1c14c9c8 |
|
MD5 | 3c0053e259f165d7955820b7ca94a3e1 |
|
BLAKE2b-256 | 1d60f1844d82011659d236fbb000b16b02aa364b9b5667e66b1dd25f987a3f3a |