Giter Club home page Giter Club logo

foxcross's Introduction

Foxcross

Code style: black License Build Status Build status PyPI codecov

AsyncIO serving for data science models built on Starlette

Requirements: Python 3.6.1+

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 [email protected]

foxcross's People

Contributors

laactech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.