{"id":13405584,"url":"https://github.com/ml-tooling/opyrator","last_synced_at":"2025-04-27T04:22:31.842Z","repository":{"id":37213548,"uuid":"355109043","full_name":"ml-tooling/opyrator","owner":"ml-tooling","description":"🪄 Turns your machine learning code into microservices with web API, interactive GUI, and more.","archived":false,"fork":false,"pushed_at":"2025-04-24T16:11:42.000Z","size":2459,"stargazers_count":3115,"open_issues_count":3,"forks_count":158,"subscribers_count":45,"default_branch":"main","last_synced_at":"2025-04-26T11:17:40.815Z","etag":null,"topics":["deployment","faas","fastapi","functions","machine-learning","microservices","pydantic","python","python-functions","serverless","streamlit","type-hints"],"latest_commit_sha":null,"homepage":"https://opyrator-playground.mltooling.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ml-tooling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-06T08:09:06.000Z","updated_at":"2025-04-18T08:20:24.000Z","dependencies_parsed_at":"2024-01-06T18:12:39.671Z","dependency_job_id":"f1c64e3d-4f6f-4a3b-960a-1bfa35296acc","html_url":"https://github.com/ml-tooling/opyrator","commit_stats":{"total_commits":109,"total_committers":6,"mean_commits":"18.166666666666668","dds":"0.15596330275229353","last_synced_commit":"3f443f05b6b21f00685c2b9bba16cf080edf2385"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-tooling%2Fopyrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-tooling%2Fopyrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-tooling%2Fopyrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ml-tooling%2Fopyrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ml-tooling","download_url":"https://codeload.github.com/ml-tooling/opyrator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251086183,"owners_count":21534005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","faas","fastapi","functions","machine-learning","microservices","pydantic","python","python-functions","serverless","streamlit","type-hints"],"created_at":"2024-07-30T19:02:05.965Z","updated_at":"2025-04-27T04:22:31.815Z","avatar_url":"https://github.com/ml-tooling.png","language":"Python","readme":"\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003ch1 align=\"center\"\u003e\n    Opyrator\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003eTurns your Python functions into microservices with web API, interactive GUI, and more.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://pypi.org/project/opyrator/\" title=\"PyPi Version\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/opyrator?color=green\u0026style=flat\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/opyrator/\" title=\"Python Version\"\u003e\u003cimg src=\"https://img.shields.io/badge/Python-3.6%2B-blue\u0026style=flat\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/ml-tooling/opyrator/blob/main/LICENSE\" title=\"Project License\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/ml-tooling/opyrator/actions?query=workflow%3Abuild-pipeline\" title=\"Build status\"\u003e\u003cimg src=\"https://img.shields.io/github/workflow/status/ml-tooling/opyrator/build-pipeline?style=flat\"\u003e\u003c/a\u003e\n    \u003ca href=\"ttps://mltooling.substack.com/subscribe\" title=\"Subscribe to newsletter\"\u003e\u003cimg src=\"http://bit.ly/2Md9rxM\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/mltooling\" title=\"Follow on Twitter\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/mltooling.svg?style=social\u0026label=Follow\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e •\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e •\n  \u003ca href=\"#support--feedback\"\u003eSupport\u003c/a\u003e •\n  \u003ca href=\"https://github.com/ml-tooling/opyrator/issues/new?labels=bug\u0026template=01_bug-report.md\"\u003eReport a Bug\u003c/a\u003e •\n  \u003ca href=\"#contribution\"\u003eContribution\u003c/a\u003e •\n  \u003ca href=\"https://github.com/ml-tooling/opyrator/releases\"\u003eChangelog\u003c/a\u003e\n\u003c/p\u003e\n\nInstantly 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.\n\n\u003csup\u003eAlpha Version: Only suggested for experimental usage.\u003c/sup\u003e\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/opyrator-header.png\"/\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n     Try out and explore various examples in our playground \u003ca href=\"https://opyrator-playground.mltooling.org\"\u003ehere\u003c/a\u003e.\n\u003c/p\u003e\n\n---\n\n## Highlights\n\n- 🪄\u0026nbsp; Turn functions into production-ready services within seconds.\n- 🔌\u0026nbsp; Auto-generated HTTP API based on FastAPI.\n- 🌅\u0026nbsp; Auto-generated Web UI based on Streamlit.\n- 📦\u0026nbsp; Save and share as self-contained executable file or Docker image.\n- 🧩\u0026nbsp; Reuse pre-defined components \u0026 combine with existing Opyrators.\n- 📈\u0026nbsp; Instantly deploy and scale for production usage.\n\n## Getting Started\n\n### Installation\n\n\u003e _Requirements: Python 3.6+._\n\n```bash\npip install opyrator\n```\n\n### Usage\n\n1. A simple Opyrator-compatible function could look like this:\n\n    ```python\n    from pydantic import BaseModel\n\n    class Input(BaseModel):\n        message: str\n\n    class Output(BaseModel):\n        message: str\n\n    def hello_world(input: Input) -\u003e Output:\n        \"\"\"Returns the `message` of the input data.\"\"\"\n        return Output(message=input.message)\n    ```\n\n    _💡 An Opyrator-compatible function is required to have an `input` parameter and return value based on [Pydantic models](https://pydantic-docs.helpmanual.io/). The input and output models are specified via [type hints](https://docs.python.org/3/library/typing.html)._\n\n2. Copy this code to a file, e.g. `my_opyrator.py`\n3. Run the UI server from command-line:\n\n    ```bash\n    opyrator launch-ui my_opyrator:hello_world\n    ```\n\n    _In the output, there's a line that shows where your web app is being served, on your local machine._\n\n    \u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/opyrator-hello-world-ui.png\"/\u003e\n\n4. Run the HTTP API server from command-line:\n\n    ```bash\n    opyrator launch-api my_opyrator:hello_world\n    ```\n    _In the output, there's a line that shows where your web service is being served, on your local machine._\n\n    \u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/opyrator-hello-world-api.png\"/\u003e\n\n5. Find out more usage information in the [Features](#features) section or get inspired by our [examples](#examples).\n\n## Examples\n\n---\n\n\u003cp align=\"center\"\u003e\n     👉\u0026nbsp; Try out and explore these examples in our playground \u003ca href=\"https://opyrator-playground.mltooling.org\"\u003ehere\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nThe 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:\n\n```bash\ndocker run -p 8080:8080 mltooling/opyrator-playground:latest\n```\n\n### Text Generation\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/text-generation-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/generate_text/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/generate_text_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/generate-text-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/generate_text/\npip install -r requirements.txt\nopyrator launch-ui app:generate_text --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n### Question Answering\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/question-answering-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/question_answering/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/question_answering_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/question-answering-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/question_answering/\npip install -r requirements.txt\nopyrator launch-ui app:question_answering --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n### Image Super Resolution\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/image-super-resolution-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/image_super_resolution/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/image_super_resolution_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/image-super-resolution-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/image_super_resolution/\npip install -r requirements.txt\nopyrator launch-ui app:image_super_resolution --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n### Text Preprocessing\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/text-preprocessing-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/preprocess_text/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/preprocess_text_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/preprocess-text-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/preprocess_text/\npip install -r requirements.txt\nopyrator launch-ui app:preprocess_text --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n### Language Detection\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/language-detection-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/detect_language/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/detect_language_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/detect-language-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/detect_language/\npip install -r requirements.txt\nopyrator launch-ui app:detect_language --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n### Audio Separation\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/audio-separation-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/separate_audio/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/seperate_audio_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/separate-audio-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/separate_audio/\npip install -r requirements.txt\nopyrator launch-ui app:separate_audio --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n### Word Vectors Training\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/train-word-vectors-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/train_word_vectors/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/train_word_vectors_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/train-word-vectors-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/train_word_vectors/\npip install -r requirements.txt\nopyrator launch-ui app:train_word_vectors --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n### Named Entity Recognition\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/named-entity-recognition-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/named_entity_recognition/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/named_entity_recognition_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/named-entity-recognition-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/named_entity_recognition/\npip install -r requirements.txt\nopyrator launch-ui app:named_entity_recognition --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n### Components Showcase\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/components-showcase-demo.png\"/\u003e\n\n- 📄\u0026nbsp; [Source Code](https://github.com/ml-tooling/opyrator/blob/main/examples/showcase_components/app.py)\n- 🌅\u0026nbsp; [UI Demo](https://play.mltooling.com/opyrator/demos/showcase_components_ui/)\n- 🔌\u0026nbsp; [OpenAPI Spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/openapi-demo-specs/showcase-components-openapi-spec.json)\n\n\u003cdetails\u003e\n\u003csummary\u003eRun this demo on your machine (click to expand...)\u003c/summary\u003e\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https://github.com/ml-tooling/opyrator\ncd ./opyrator/examples/showcase_components/\npip install -r requirements.txt\nopyrator launch-ui app:showcase_components --port 8051\n```\n\nVisit 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.\n\n\u003c/details\u003e\n\n## Support \u0026 Feedback\n\nThis project is maintained by [Benjamin Räthlein](https://twitter.com/raethlein), [Lukas Masuch](https://twitter.com/LukasMasuch), and [Jan Kalkan](https://www.linkedin.com/in/jan-kalkan-b5390284/). Please understand that we won't be able to provide individual support via email. We also believe that help is much more valuable if it's shared publicly so that more people can benefit from it.\n\n| Type                     | Channel                                              |\n| ------------------------ | ------------------------------------------------------ |\n| 🚨\u0026nbsp; **Bug Reports**       | \u003ca href=\"https://github.com/ml-tooling/opyrator/issues?utf8=%E2%9C%93\u0026q=is%3Aopen+is%3Aissue+label%3Abug+sort%3Areactions-%2B1-desc+\" title=\"Open Bug Report\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/ml-tooling/opyrator/bug.svg?label=bug\"\u003e\u003c/a\u003e                                 |\n| 🎁\u0026nbsp; **Feature Requests**  | \u003ca href=\"https://github.com/ml-tooling/opyrator/issues?q=is%3Aopen+is%3Aissue+label%3Afeature+sort%3Areactions-%2B1-desc\" title=\"Open Feature Request\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/ml-tooling/opyrator/feature.svg?label=feature%20request\"\u003e\u003c/a\u003e                                 |\n| 👩‍💻\u0026nbsp; **Usage Questions**   |  \u003ca href=\"https://github.com/ml-tooling/opyrator/issues?q=is%3Aopen+is%3Aissue+label%3Asupport+sort%3Areactions-%2B1-desc\" title=\"Open Support Request\"\u003e \u003cimg src=\"https://img.shields.io/github/issues/ml-tooling/opyrator/support.svg?label=support%20request\"\u003e\u003c/a\u003e \u003ca href=\"https://gitter.im/ml-tooling/community\" title=\"Chat on Gitter\"\u003e\u003cimg src=\"https://badges.gitter.im/ml-tooling/community.svg\"\u003e\u003c/a\u003e |\n| 📢\u0026nbsp; **Announcements** | \u003ca href=\"https://gitter.im/ml-tooling/community\" title=\"Chat on Gitter\"\u003e\u003cimg src=\"https://badges.gitter.im/mml-tooling/community.svg\"\u003e\u003c/a\u003e  \u003ca href=\"https://mltooling.substack.com/subscribe\" title=\"Subscribe for updates\"\u003e\u003cimg src=\"http://bit.ly/2Md9rxM\"\u003e\u003c/a\u003e \u003ca href=\"https://twitter.com/mltooling\" title=\"ML Tooling on Twitter\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/mltooling.svg?style=social\u0026label=Follow\"\u003e |\n| ❓\u0026nbsp; **Other Requests** | \u003ca href=\"mailto:team@ml-tooling.org\" title=\"Email ML Tooling Team\"\u003e\u003cimg src=\"https://img.shields.io/badge/email-ML Tooling-green?logo=mail.ru\u0026logoColor=white\"\u003e\u003c/a\u003e |\n\n## Features\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#http-api\"\u003eHTTP API\u003c/a\u003e •\n  \u003ca href=\"#graphical-ui\"\u003eGraphical UI\u003c/a\u003e •\n  \u003ca href=\"#command-line-interface\"\u003eCLI\u003c/a\u003e •\n  \u003ca href=\"#zip-export\"\u003eZip Export\u003c/a\u003e •\n  \u003ca href=\"#docker-export\"\u003eDocker Export\u003c/a\u003e •\n  \u003ca href=\"#pre-defined-components\"\u003ePre-defined Components\u003c/a\u003e •\n  \u003ca href=\"#production-deployment\"\u003eProduction Deployment\u003c/a\u003e\n\u003c/p\u003e\n\n### HTTP API\n\nWith Opyrator, you can instantly launch a local HTTP (REST) API server for any [compatible function](#compatible-functions):\n\n```bash\nopyrator launch-api my_opyrator:hello_world\n```\n\nThis will launch a [FastAPI](https://fastapi.tiangolo.com/) server based on the [OpenAPI standard](https://swagger.io/specification) and with an automatic interactive documentation.\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/opyrator-hello-world-api.png\"/\u003e\n\n_💡 Make sure that all requirements of your script are installed in the active Python enviornment._\n\nThe port used by the API server can be provided via CLI arguments:\n\n```bash\nopyrator launch-api my_opyrator:hello_world --port 8080\n```\n\nThe API server can also be started via the exported zip-file format (see [zip export section](#zip-export) below).\n\n```bash\nopyrator launch-api my-opyrator.zip\n```\n\n### Graphical UI\n\nYou can launch a graphical user interface - powered by  [Streamlit](https://streamlit.io/) - for your [compatible function](#compatible-functions). The UI is auto-generated from the input- and output-schema of the given function.\n\n```bash\nopyrator launch-ui my_opyrator:hello_world\n```\n\n\u003cimg style=\"width: 100%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/opyrator-hello-world-ui.png\"/\u003e\n\n_💡 Make sure that all requirements of your script are installed in the active Python environment._\n\nYou can influence most aspects of the UI just by changing and improving the input- and output-schema of your function. Furthermore, it is also possible to define custom UIs for the function's input and output. For more details, refer to the [input- and output-schema](#TODO) section.\n\nThe port used by the UI server can be provided via CLI arguments:\n\n```bash\nopyrator launch-ui my_opyrator:hello_world --port 8080\n```\n\nThe UI server can also be started via the exported zip-file format (see [zip export section](#zip-export) below).\n\n```bash\nopyrator launch-ui my-opyrator.zip\n```\n\nIn addition, the UI server can be started by using an already running Opyrator API endpoint:\n\n```bash\nopyrator launch-ui http://my-opyrator:8080 \n```\n\nThereby, all Opyrator calls from the UI will be executed via the configured HTTP endpoint instead of the Python function running inside the UI server.\n\n### Command-line Interface\n\nAn Opyrator can also be executed via command-line:\n\n```bash\nopyrator call my_opyrator:hello_world '{\"message\": \"hello\"}'\n```\n\n\u003cimg style=\"width: 80%\" src=\"https://raw.githubusercontent.com/ml-tooling/opyrator/main/docs/images/opyrator-cli.png\"/\u003e\n\nThe CLI interface also works using the [zip export format](#zip-export):\n\n```bash\nopyrator call my-opyrator.zip '{\"message\": \"hello\"}'\n```\n\nOr, by using an already running Opyrator API endpoint:\n\n```bash\nopyrator call http://my-opyrator:8080 '{\"message\": \"hello\"}'\n```\n\nThereby, the function call is executed by the Opyrator API server, instead of locally using the Python function.\n\n### Zip Export\n\nOpyrator allows you to package and export a [compatible function](#compatible-functions) into a self-contained zip-file:\n\n```bash\nopyrator export my_opyrator:hello_world my-opyrator.zip\n```\n\nThis exported zip-file packages relevant source code and data artifacts into a single file which can be shared, stored, and used for launching the API or UI as shown above.\n\nExternal requirements are automatically discovered from the working directory based on the following files: `Pipfile` (Pipenv environment), `environment.yml` (Conda environment), `pyproject.toml` (Poetry dependencies), `requirements.txt` (pip-requirements), `setup.py` (Python project requirements), `packages.txt` (apt-get packages), or discovered via [pipreqs](https://github.com/bndr/pipreqs) as fallback. However, external requirements are only included as instructions and are not packaged into the zip-file. If you want to export your Opyrator fully self-contained including all requirements or even the Python interpreter itself, please refer to the [Docker](#docker-export) or [pex](#pex-export) export options.\n\nAs a side note, Opyrators exported as zip-files are (mini) Python libraries that can be pip-installed, imported, and used from other Python code:\n\n```bash\npip install my-opyrator.zip\n```\n\n_WIP: This feature is not finalized yet. You can track the progress and vote for the feature [here](https://github.com/ml-tooling/opyrator/issues/3)_\n\n### Docker Export\n\nIn addition to the ZIP export, Opyrator also provides the capability to export to a Docker image:\n\n```bash\nopyrator export my_opyrator:hello_world --format=docker my-opyrator-image:latest\n```\n\n_💡 The Docker export requires that Docker is installed on your machine._\n\nAfter the successful export, the Docker image can be run as shown below:\n\n```bash\ndocker run -p 8080:8080 my-opyrator-image:latest\n```\n\nRunning your Opyrator within this Docker image has the advantage that only a single port is required to be exposed. The separation between UI and API is done via URL paths: `http://localhost:8080/api` (API); `http://localhost:8080/ui` (UI). The UI is automatically configured to use the API for all function calls.\n\n_WIP: This feature is not finalized yet. You can track the progress and vote for the feature [here](https://github.com/ml-tooling/opyrator/issues/4)._\n\n### Pex Export\n\nOpyrator also provides the capability to export to a pex-file. [Pex](https://github.com/pantsbuild/pex) is a tool to create self-contained executable Python environments that contain all relevant python dependencies.\n\n```bash\nopyrator export my_opyrator:hello_world --format=pex my-opyrator.pex\n```\n\n_WIP: This feature is not finalized yet. You can track the progress and vote for the feature [here](https://github.com/ml-tooling/opyrator/issues/5)._\n\n### Python Client\n\nEvery deployed Opyrator provides a Python client library via an endpoint method which can be installed with pip:\n\n```bash\npip install http://my-opyrator:8080/client\n```\n\nAnd used in your code, as shown below:\n\n```python\nfrom my_opyrator import Client, Input\nopyrator_client = Client(\"http://my-opyrator:8080\")\nresult = opyrator_client.call(Input(text=\"hello\", wait=1))\n```\n\n_WIP: This feature is not finalized yet. You can track the progress and vote for the feature [here](https://github.com/ml-tooling/opyrator/issues/8)._\n\n### Pre-defined Components\n\nOpyrator provides a growing collection of pre-defined components (input- and output models) for common tasks. Some of these components also provide more advanced UIs and Visualizations. You can reuse these components to speed up your development and, thereby, keep your Opyrators compatible with other functionality improvements or other Opyrators.\n\nYou can find some of the available interfaces in the [examples](#examples) section or in this [source code package](#TODO).\n\n_WIP: This feature is not finalized yet. You can track the progress and vote for the feature [here](https://github.com/ml-tooling/opyrator/issues/9)._\n\n### Production Deployment\n\nRolling out your Opyrators for production usage might require additional features such as SSL, authentication, API tokens, unlimited scalability, load balancing, and monitoring. Therefore, we provide capabilities to easily  deploy your Opyrators directly on scalable and secure cloud platforms without any major overhead:\n\n```bash\nopyrator deploy my_opyrator:hello_world \u003cdeployment-provider\u003e \u003cdeployment-provider-options\u003e\n```\n\n_WIP: This feature is not finalized yet. You can track the progress and vote for the feature [here](https://github.com/ml-tooling/opyrator/issues/6)._\n\n## Documentation\n\n### Compatible Functions\n\nA function is compatible with Opyrator if it fulfills the following requirements:\n\n- A single parameter called `input` which MUST be a subclass of the [Pydantic BaseModel](https://pydantic-docs.helpmanual.io/usage/models/).\n- A single return value that MUST be a subclass of the [Pydantic BaseModel](https://pydantic-docs.helpmanual.io/usage/models/).\n- The `input` parameter and return value MUST be annotated with Python typing hints.\n\n### Input- and Output-Schema\n\n_WIP_\n\n### Command-line Interface\n\n_WIP_\n\n\n## Contribution\n\n- Pull requests are encouraged and always welcome. Read our [contribution guidelines](https://github.com/ml-tooling/opyrator/tree/main/CONTRIBUTING.md) and check out [help-wanted](https://github.com/ml-tooling/opyrator/issues?utf8=%E2%9C%93\u0026q=is%3Aopen+is%3Aissue+label%3A\"help+wanted\"+sort%3Areactions-%2B1-desc+) issues.\n- Submit Github issues for any [feature request and enhancement](https://github.com/ml-tooling/opyrator/issues/new?assignees=\u0026labels=feature\u0026template=02_feature-request.md\u0026title=), [bugs](https://github.com/ml-tooling/opyrator/issues/new?assignees=\u0026labels=bug\u0026template=01_bug-report.md\u0026title=), or [documentation](https://github.com/ml-tooling/opyrator/issues/new?assignees=\u0026labels=documentation\u0026template=03_documentation.md\u0026title=) problems.\n- By participating in this project, you agree to abide by its [Code of Conduct](https://github.com/ml-tooling/opyrator/blob/main/.github/CODE_OF_CONDUCT.md).\n- The [development section](#development) below contains information on how to build and test the project after you have implemented some changes.\n\n## Development\n\nRefer to our [contribution guides](https://github.com/ml-tooling/opyrator/blob/main/CONTRIBUTING.md#development-instructions) for information on our build scripts and development process.\n\n---\n\nLicensed **MIT**. Created and maintained with ❤️\u0026nbsp; by developers from Berlin.\n","funding_links":[],"categories":["Python","Model Serving","Machine Learning"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fml-tooling%2Fopyrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fml-tooling%2Fopyrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fml-tooling%2Fopyrator/lists"}