a2i2 / surround

Surround is a framework for building AI driven microservices in Python, https://surround.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
23 stars 29 forks source link
data-science machine-learning model-serving pipeline-framework python

Surround is a lightweight framework for serving machine learning pipelines in Python. It is designed to be flexible, easy to use and to assist data scientists by focusing them on the problem at hand rather than writing glue code. Surround began as a project at the Applied Artificial Intelligence Institute to address the following problems:

Used in projects by:

Simple usage

A short explanation is provided in the hello-world example's README file.

import logging
from surround import State, Stage, Estimator, Assembler, RunMode

class HelloWorld(Estimator):
    def estimate(self, state, config):
        state.text = "Hello world"

    def fit(self, state, config):
        print("No training implemented")

class InputValidator(Stage):
    def operate(self, state, config):
        if state.text:
            raise ValueError("'text' is not None")

class AssemblerState(State):
    text = None

if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO)
    data = AssemblerState()
    assembler = Assembler("Hello world example").set_stages([InputValidator(), HelloWorld()])
    assembler.run(data, mode=RunMode.PREDICT)
    print("Text is '%s'" % data.text)

Examples

See the examples directory for useful examples on how Surround can be utilized.

Full Documentation

See our website for an in-depth explanation of Surround (in the About page), a Getting Started Guide, and full documentation of the API.

Contributing

For guidance on setting up a development environment and how to make a contribution to Surround, see the contributing guidelines.

License

Surround is released under a BSD-3 license.

Project Status

Surround is currently under heavy development, please submit any issues that occur or suggestions you may have, it is very much appreciated!