Loading repository dataβ¦
Loading repository dataβ¦
ml-tooling / repository
πͺ Turns your machine learning code into microservices with web API, interactive GUI, and more.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Instantly turn your Python functions into production-ready microservices. Deploy and access your services via HTTP API or interactive UI. Seamlessly export your services into portable, shareable, and executable files or Docker images. Opyrator builds on open standards - OpenAPI, JSON Schema, and Python type hints - and is powered by FastAPI, Streamlit, and Pydantic. It cuts out all the pain for productizing and sharing your Python code - or anything you can wrap into a single Python function.
Alpha Version: Only suggested for experimental usage.
Requirements: Python 3.6+.
pip install opyrator
A simple Opyrator-compatible function could look like this:
from pydantic import BaseModel
class Input(BaseModel):
message: str
class Output(BaseModel):
message: str
def hello_world(input: Input) -> Output:
"""Returns the `message` of the input data."""
return Output(message=input.message)
π‘ An Opyrator-compatible function is required to have an input parameter and return value based on Pydantic models. The input and output models are specified via type hints.
Copy this code to a file, e.g. my_opyrator.py
Run the UI server from command-line:
opyrator launch-ui my_opyrator:hello_world
In the output, there's a line that shows where your web app is being served, on your local machine.
Run the HTTP API server from command-line:
opyrator launch-api my_opyrator:hello_world
In the output, there's a line that shows where your web service is being served, on your local machine.
Find out more usage information in the Features section or get inspired by our examples.
The following collection of examples demonstrate how Opyrator can support a variety of different tasks and use-cases. All these examples are bundled into a demo playground which you can also deploy on your own machine via Docker:
docker run -p 8080:8080 mltooling/opyrator-playground:latest
To run the demo on your local machine just execute the following commands:
git clone https://github.com/ml-tooling/opyrator
cd ./opyrator/examples/generate_text/
pip install -r requirements.txt
opyrator launch-ui app:generate_text --port 8051
Visit http://localhost:8051 in your browser to access the UI of the demo. Use launch-api instead of launch-ui to launch the HTTP API server.
To run the demo on your local machine just execute the following commands:
git clone https://github.com/ml-tooling/opyrator
cd ./opyrator/examples/question_answering/
pip install -r requirements.txt
opyrator launch-ui app:question_answering --port 8051
Visit http://localhost:8051 in your browser to access the UI of the demo. Use launch-api instead of launch-ui to launch the HTTP API server.
To run the demo on your local machine just execute the following commands:
git clone https://github.com/ml-tooling/opyrator
cd ./opyrator/examples/image_super_resolution/
pip install -r requirements.txt
opyrator launch-ui app:image_super_resolution --port 8051
Visit http://localhost:8051 in your browser to access the UI of the demo. Use launch-api instead of launch-ui to launch the HTTP API server.
To run the demo on your local machine just execute the following commands:
git clone https://github.com/ml-tooling/opyrator
cd ./opyrator/examples/preprocess_text/
pip install -r requirements.txt
opyrator launch-ui app:preprocess_text --port 8051
Visit http://localhost:8051 in your browser to access the UI of the demo. Use launch-api instead of launch-ui to launch the HTTP API server.
To run the demo on your local machine just execute the following commands:
git clone https://github.com/ml-tooling/opyrator
cd ./opyrator/examples/detect_language/
pip install -r requirements.txt
opyrator launch-ui app:detect_language --port 8051
Visit http://localhost:8051 in your browser to access the UI of the demo. Use launch-api instead of launch-ui to launch the HTTP API server.
To run the demo on your local machine just execute the following commands:
git clone https://github.com/ml-tooling/opyrator
cd ./opyrator/examples/separate_audio/
pip install -r requirements.txt
opyrator launch-ui app:separate_audio --port 8051
Visit http://localhost:8051 in your browser to access the UI of the demo. Use launch-api instead of launch-ui to launch the HTTP API server.
To run the demo on your local machine just execute the following commands:
git clone https://github.com/ml-tooling/opyrator
cd ./opyrator/examples/train_word_vectors/
pip instal