Skip to main content

AsyncIO serving for data science models

Project description

Foxcross

Code style: black License Build Status Build status PyPI codecov

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.

Security

If you believe you've found a bug with security implications, please do not disclose this issue in a public forum.

Email us at support@laac.dev

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foxcross-0.9.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

foxcross-0.9.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file foxcross-0.9.0.tar.gz.

File metadata

  • Download URL: foxcross-0.9.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.7.3 Linux/5.0.0-37-generic

File hashes

Hashes for foxcross-0.9.0.tar.gz
Algorithm Hash digest
SHA256 6ecd8edf862115d3775fd72f5486422574cacb916d71029c252535f38172cf61
MD5 9c36c7436cecb96ae1e6272ffd1ec47e
BLAKE2b-256 2de68eae39f7b56cfa6fb067d007b1b0147e9023fd1dc9b58f3c7e0d90e18326

See more details on using hashes here.

File details

Details for the file foxcross-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: foxcross-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.7.3 Linux/5.0.0-37-generic

File hashes

Hashes for foxcross-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4445045b93d60ceece977836c96761a2a3f2625b63b3e7bb25cfadec03f7b3fe
MD5 fcf5dea4b010a5dc163860d8e651a3bd
BLAKE2b-256 ba3a4890546148c69f255387a9682f2b69e7ca3ac8b485214b84e4c0606ae7c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page