[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-ml-tooling--opyrator":3,"tool-ml-tooling--opyrator":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":80,"owner_twitter":81,"owner_website":79,"owner_url":82,"languages":83,"stars":99,"forks":100,"last_commit_at":101,"license":102,"difficulty_score":23,"env_os":103,"env_gpu":104,"env_ram":104,"env_deps":105,"category_tags":112,"github_topics":113,"view_count":123,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":124,"updated_at":125,"faqs":126,"releases":152},427,"ml-tooling\u002Fopyrator","opyrator","🪄 Turns your machine learning code into microservices with web API, interactive GUI, and more.","Opyrator 能让你快速将普通的 Python 函数变成具备 Web API 和交互式网页界面的微服务，无需手动编写后端或前端代码。它特别适合数据科学家、机器学习工程师和 Python 开发者，帮助他们轻松把模型或算法封装成可部署、可共享的服务，省去繁琐的工程化步骤。只需定义好输入输出的数据结构（使用 Pydantic 模型），Opyrator 就会自动生成基于 FastAPI 的 RESTful API 和基于 Streamlit 的可视化界面，并支持一键打包为可执行文件或 Docker 镜像。整个过程基于 OpenAPI、JSON Schema 和 Python 类型提示等开放标准，既规范又易用。目前 Opyrator 仍处于 Alpha 阶段，推荐用于实验性项目或快速原型开发。","\u003C!-- markdownlint-disable MD033 MD041 -->\n\u003Ch1 align=\"center\">\n    Opyrator\n\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n    \u003Cstrong>Turns your Python functions into microservices with web API, interactive GUI, and more.\u003C\u002Fstrong>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fopyrator\u002F\" title=\"PyPi Version\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fopyrator?color=green&style=flat\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fopyrator\u002F\" title=\"Python Version\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.6%2B-blue&style=flat\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002FLICENSE\" title=\"Project License\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Factions?query=workflow%3Abuild-pipeline\" title=\"Build status\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fworkflow\u002Fstatus\u002Fml-tooling\u002Fopyrator\u002Fbuild-pipeline?style=flat\">\u003C\u002Fa>\n    \u003Ca href=\"ttps:\u002F\u002Fmltooling.substack.com\u002Fsubscribe\" title=\"Subscribe to newsletter\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_c2109c0b6cbf.png\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fmltooling\" title=\"Follow on Twitter\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fmltooling.svg?style=social&label=Follow\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#getting-started\">Getting Started\u003C\u002Fa> •\n  \u003Ca href=\"#features\">Features\u003C\u002Fa> •\n  \u003Ca href=\"#examples\">Examples\u003C\u002Fa> •\n  \u003Ca href=\"#support--feedback\">Support\u003C\u002Fa> •\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002Fnew?labels=bug&template=01_bug-report.md\">Report a Bug\u003C\u002Fa> •\n  \u003Ca href=\"#contribution\">Contribution\u003C\u002Fa> •\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Freleases\">Changelog\u003C\u002Fa>\n\u003C\u002Fp>\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>Alpha Version: Only suggested for experimental usage.\u003C\u002Fsup>\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_4c2b0ec4b359.png\"\u002F>\n\n---\n\n\u003Cp align=\"center\">\n     Try out and explore various examples in our playground \u003Ca href=\"https:\u002F\u002Fopyrator-playground.mltooling.org\">here\u003C\u002Fa>.\n\u003C\u002Fp>\n\n---\n\n## Highlights\n\n- 🪄&nbsp; Turn functions into production-ready services within seconds.\n- 🔌&nbsp; Auto-generated HTTP API based on FastAPI.\n- 🌅&nbsp; Auto-generated Web UI based on Streamlit.\n- 📦&nbsp; Save and share as self-contained executable file or Docker image.\n- 🧩&nbsp; Reuse pre-defined components & combine with existing Opyrators.\n- 📈&nbsp; Instantly deploy and scale for production usage.\n\n## Getting Started\n\n### Installation\n\n> _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) -> 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:\u002F\u002Fpydantic-docs.helpmanual.io\u002F). The input and output models are specified via [type hints](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Ftyping.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:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_0e7721588961.png\"\u002F>\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:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_2d560f03b3bc.png\"\u002F>\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\">\n     👉&nbsp; Try out and explore these examples in our playground \u003Ca href=\"https:\u002F\u002Fopyrator-playground.mltooling.org\">here\u003C\u002Fa>\n\u003C\u002Fp>\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\u002Fopyrator-playground:latest\n```\n\n### Text Generation\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_9e4fa63e28c0.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fgenerate_text\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fgenerate_text_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fgenerate-text-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fgenerate_text\u002F\npip install -r requirements.txt\nopyrator launch-ui app:generate_text --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n### Question Answering\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_112b59d6b0ad.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fquestion_answering\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fquestion_answering_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fquestion-answering-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fquestion_answering\u002F\npip install -r requirements.txt\nopyrator launch-ui app:question_answering --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n### Image Super Resolution\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_c6f0757f5e89.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fimage_super_resolution\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fimage_super_resolution_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fimage-super-resolution-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fimage_super_resolution\u002F\npip install -r requirements.txt\nopyrator launch-ui app:image_super_resolution --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n### Text Preprocessing\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_c85fc4d1df20.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fpreprocess_text\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fpreprocess_text_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fpreprocess-text-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fpreprocess_text\u002F\npip install -r requirements.txt\nopyrator launch-ui app:preprocess_text --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n### Language Detection\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_0a58ae7560b2.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fdetect_language\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fdetect_language_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fdetect-language-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fdetect_language\u002F\npip install -r requirements.txt\nopyrator launch-ui app:detect_language --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n### Audio Separation\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_b05534ac9a97.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fseparate_audio\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fseperate_audio_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fseparate-audio-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fseparate_audio\u002F\npip install -r requirements.txt\nopyrator launch-ui app:separate_audio --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n### Word Vectors Training\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_150f277e738f.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Ftrain_word_vectors\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Ftrain_word_vectors_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Ftrain-word-vectors-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Ftrain_word_vectors\u002F\npip install -r requirements.txt\nopyrator launch-ui app:train_word_vectors --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n### Named Entity Recognition\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_9feebd0d77fc.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fnamed_entity_recognition\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fnamed_entity_recognition_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fnamed-entity-recognition-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fnamed_entity_recognition\u002F\npip install -r requirements.txt\nopyrator launch-ui app:named_entity_recognition --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n### Components Showcase\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_4ef98a2dbe04.png\"\u002F>\n\n- 📄&nbsp; [Source Code](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fshowcase_components\u002Fapp.py)\n- 🌅&nbsp; [UI Demo](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fshowcase_components_ui\u002F)\n- 🔌&nbsp; [OpenAPI Spec](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fshowcase-components-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>Run this demo on your machine (click to expand...)\u003C\u002Fsummary>\n\nTo run the demo on your local machine just execute the following commands:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fshowcase_components\u002F\npip install -r requirements.txt\nopyrator launch-ui app:showcase_components --port 8051\n```\n\nVisit http:\u002F\u002Flocalhost: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\u002Fdetails>\n\n## Support & Feedback\n\nThis project is maintained by [Benjamin Räthlein](https:\u002F\u002Ftwitter.com\u002Fraethlein), [Lukas Masuch](https:\u002F\u002Ftwitter.com\u002FLukasMasuch), and [Jan Kalkan](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fjan-kalkan-b5390284\u002F). 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| 🚨&nbsp; **Bug Reports**       | \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Abug+sort%3Areactions-%2B1-desc+\" title=\"Open Bug Report\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fml-tooling\u002Fopyrator\u002Fbug.svg?label=bug\">\u003C\u002Fa>                                 |\n| 🎁&nbsp; **Feature Requests**  | \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues?q=is%3Aopen+is%3Aissue+label%3Afeature+sort%3Areactions-%2B1-desc\" title=\"Open Feature Request\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fml-tooling\u002Fopyrator\u002Ffeature.svg?label=feature%20request\">\u003C\u002Fa>                                 |\n| 👩‍💻&nbsp; **Usage Questions**   |  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues?q=is%3Aopen+is%3Aissue+label%3Asupport+sort%3Areactions-%2B1-desc\" title=\"Open Support Request\"> \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fml-tooling\u002Fopyrator\u002Fsupport.svg?label=support%20request\">\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fgitter.im\u002Fml-tooling\u002Fcommunity\" title=\"Chat on Gitter\">\u003Cimg src=\"https:\u002F\u002Fbadges.gitter.im\u002Fml-tooling\u002Fcommunity.svg\">\u003C\u002Fa> |\n| 📢&nbsp; **Announcements** | \u003Ca href=\"https:\u002F\u002Fgitter.im\u002Fml-tooling\u002Fcommunity\" title=\"Chat on Gitter\">\u003Cimg src=\"https:\u002F\u002Fbadges.gitter.im\u002Fmml-tooling\u002Fcommunity.svg\">\u003C\u002Fa>  \u003Ca href=\"https:\u002F\u002Fmltooling.substack.com\u002Fsubscribe\" title=\"Subscribe for updates\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_c2109c0b6cbf.png\">\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fmltooling\" title=\"ML Tooling on Twitter\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fmltooling.svg?style=social&label=Follow\"> |\n| ❓&nbsp; **Other Requests** | \u003Ca href=\"mailto:team@ml-tooling.org\" title=\"Email ML Tooling Team\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Femail-ML Tooling-green?logo=mail.ru&logoColor=white\">\u003C\u002Fa> |\n\n## Features\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#http-api\">HTTP API\u003C\u002Fa> •\n  \u003Ca href=\"#graphical-ui\">Graphical UI\u003C\u002Fa> •\n  \u003Ca href=\"#command-line-interface\">CLI\u003C\u002Fa> •\n  \u003Ca href=\"#zip-export\">Zip Export\u003C\u002Fa> •\n  \u003Ca href=\"#docker-export\">Docker Export\u003C\u002Fa> •\n  \u003Ca href=\"#pre-defined-components\">Pre-defined Components\u003C\u002Fa> •\n  \u003Ca href=\"#production-deployment\">Production Deployment\u003C\u002Fa>\n\u003C\u002Fp>\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:\u002F\u002Ffastapi.tiangolo.com\u002F) server based on the [OpenAPI standard](https:\u002F\u002Fswagger.io\u002Fspecification) and with an automatic interactive documentation.\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_2d560f03b3bc.png\"\u002F>\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:\u002F\u002Fstreamlit.io\u002F) - 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:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_0e7721588961.png\"\u002F>\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:\u002F\u002Fmy-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:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_901952b89fc8.png\"\u002F>\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:\u002F\u002Fmy-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:\u002F\u002Fgithub.com\u002Fbndr\u002Fpipreqs) 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:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F3)_\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:\u002F\u002Flocalhost:8080\u002Fapi` (API); `http:\u002F\u002Flocalhost:8080\u002Fui` (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:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F4)._\n\n### Pex Export\n\nOpyrator also provides the capability to export to a pex-file. [Pex](https:\u002F\u002Fgithub.com\u002Fpantsbuild\u002Fpex) 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:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F5)._\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:\u002F\u002Fmy-opyrator:8080\u002Fclient\n```\n\nAnd used in your code, as shown below:\n\n```python\nfrom my_opyrator import Client, Input\nopyrator_client = Client(\"http:\u002F\u002Fmy-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:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F8)._\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:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F9)._\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> \u003Cdeployment-provider-options>\n```\n\n_WIP: This feature is not finalized yet. You can track the progress and vote for the feature [here](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F6)._\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:\u002F\u002Fpydantic-docs.helpmanual.io\u002Fusage\u002Fmodels\u002F).\n- A single return value that MUST be a subclass of the [Pydantic BaseModel](https:\u002F\u002Fpydantic-docs.helpmanual.io\u002Fusage\u002Fmodels\u002F).\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:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Ftree\u002Fmain\u002FCONTRIBUTING.md) and check out [help-wanted](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3A\"help+wanted\"+sort%3Areactions-%2B1-desc+) issues.\n- Submit Github issues for any [feature request and enhancement](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002Fnew?assignees=&labels=feature&template=02_feature-request.md&title=), [bugs](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002Fnew?assignees=&labels=bug&template=01_bug-report.md&title=), or [documentation](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002Fnew?assignees=&labels=documentation&template=03_documentation.md&title=) problems.\n- By participating in this project, you agree to abide by its [Code of Conduct](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002F.github\u002FCODE_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:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002FCONTRIBUTING.md#development-instructions) for information on our build scripts and development process.\n\n---\n\nLicensed **MIT**. Created and maintained with ❤️&nbsp; by developers from Berlin.\n","\u003C!-- markdownlint-disable MD033 MD041 -->\n\u003Ch1 align=\"center\">\n    Opyrator\n\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n    \u003Cstrong>将你的 Python 函数快速转换为具备 Web API、交互式 GUI 等功能的微服务。\u003C\u002Fstrong>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fopyrator\u002F\" title=\"PyPi Version\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fopyrator?color=green&style=flat\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fopyrator\u002F\" title=\"Python Version\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.6%2B-blue&style=flat\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002FLICENSE\" title=\"Project License\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Factions?query=workflow%3Abuild-pipeline\" title=\"Build status\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fworkflow\u002Fstatus\u002Fml-tooling\u002Fopyrator\u002Fbuild-pipeline?style=flat\">\u003C\u002Fa>\n    \u003Ca href=\"ttps:\u002F\u002Fmltooling.substack.com\u002Fsubscribe\" title=\"Subscribe to newsletter\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_c2109c0b6cbf.png\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fmltooling\" title=\"Follow on Twitter\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fmltooling.svg?style=social&label=Follow\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#getting-started\">入门指南\u003C\u002Fa> •\n  \u003Ca href=\"#features\">功能特性\u003C\u002Fa> •\n  \u003Ca href=\"#examples\">示例\u003C\u002Fa> •\n  \u003Ca href=\"#support--feedback\">支持\u003C\u002Fa> •\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002Fnew?labels=bug&template=01_bug-report.md\">报告 Bug\u003C\u002Fa> •\n  \u003Ca href=\"#contribution\">贡献\u003C\u002Fa> •\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Freleases\">更新日志\u003C\u002Fa>\n\u003C\u002Fp>\n\n将你的 Python 函数瞬间转变为生产就绪（production-ready）的微服务。通过 HTTP API 或交互式 UI 部署并访问你的服务。无缝导出服务为可移植、可共享、可执行的文件或 Docker 镜像。Opyrator 基于开放标准构建——OpenAPI、JSON Schema 和 Python 类型提示（type hints），并由 FastAPI、Streamlit 和 Pydantic 提供支持。它消除了将 Python 代码产品化和共享过程中的所有繁琐工作——只要你能将功能封装成一个 Python 函数即可。\n\n\u003Csup>Alpha 版本：仅建议用于实验性用途。\u003C\u002Fsup>\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_4c2b0ec4b359.png\"\u002F>\n\n---\n\n\u003Cp align=\"center\">\n     在我们的 \u003Ca href=\"https:\u002F\u002Fopyrator-playground.mltooling.org\">在线 playground\u003C\u002Fa> 中尝试并探索各种示例。\n\u003C\u002Fp>\n\n---\n\n## 亮点功能\n\n- 🪄&nbsp; 几秒钟内将函数转变为生产就绪的服务。\n- 🔌&nbsp; 基于 FastAPI 自动生成 HTTP API。\n- 🌅&nbsp; 基于 Streamlit 自动生成 Web UI。\n- 📦&nbsp; 保存并分享为自包含的可执行文件或 Docker 镜像。\n- 🧩&nbsp; 复用预定义组件，并与现有 Opyrator 组合使用。\n- 📈&nbsp; 即刻部署并扩展以用于生产环境。\n\n## 入门指南\n\n### 安装\n\n> _要求：Python 3.6+._\n\n```bash\npip install opyrator\n```\n\n### 使用方法\n\n1. 一个简单的 Opyrator 兼容函数可能如下所示：\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) -> Output:\n        \"\"\"返回输入数据中的 `message` 字段。\"\"\"\n        return Output(message=input.message)\n    ```\n\n    _💡 Opyrator 兼容函数必须具有一个 `input` 参数，并且其返回值需基于 [Pydantic 模型](https:\u002F\u002Fpydantic-docs.helpmanual.io\u002F)。输入和输出模型通过 [类型提示（type hints）](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Ftyping.html) 指定。_\n\n2. 将此代码复制到一个文件中，例如 `my_opyrator.py`\n3. 从命令行启动 UI 服务器：\n\n    ```bash\n    opyrator launch-ui my_opyrator:hello_world\n    ```\n\n    _输出中会有一行显示你的 Web 应用在本地机器上的服务地址。_\n\n    \u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_0e7721588961.png\"\u002F>\n\n4. 从命令行启动 HTTP API 服务器：\n\n    ```bash\n    opyrator launch-api my_opyrator:hello_world\n    ```\n    _输出中会有一行显示你的 Web 服务在本地机器上的服务地址。_\n\n    \u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_2d560f03b3bc.png\"\u002F>\n\n5. 更多用法信息请参阅 [功能特性](#features) 部分，或从我们的 [示例](#examples) 中获取灵感。\n\n## 示例\n\n---\n\n\u003Cp align=\"center\">\n     👉&nbsp; 在我们的 \u003Ca href=\"https:\u002F\u002Fopyrator-playground.mltooling.org\">在线 playground\u003C\u002Fa> 中尝试并探索这些示例\n\u003C\u002Fp>\n\n---\n\n以下示例集合展示了 Opyrator 如何支持各种不同的任务和使用场景。所有这些示例都打包在一个演示 playground 中，你也可以通过 Docker 在自己的机器上部署：\n\n```bash\ndocker run -p 8080:8080 mltooling\u002Fopyrator-playground:latest\n```\n\n### 文本生成\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_9e4fa63e28c0.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fgenerate_text\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fgenerate_text_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fgenerate-text-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，只需执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fgenerate_text\u002F\npip install -r requirements.txt\nopyrator launch-ui app:generate_text --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可使用该演示的 UI。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n### 问答系统（Question Answering）\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_112b59d6b0ad.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fquestion_answering\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fquestion_answering_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fquestion-answering-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，请执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fquestion_answering\u002F\npip install -r requirements.txt\nopyrator launch-ui app:question_answering --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可打开演示的 UI 界面。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n### 图像超分辨率（Image Super Resolution）\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_c6f0757f5e89.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fimage_super_resolution\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fimage_super_resolution_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fimage-super-resolution-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，请执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fimage_super_resolution\u002F\npip install -r requirements.txt\nopyrator launch-ui app:image_super_resolution --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可打开演示的 UI 界面。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n### 文本预处理（Text Preprocessing）\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_c85fc4d1df20.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fpreprocess_text\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fpreprocess_text_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fpreprocess-text-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，请执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fpreprocess_text\u002F\npip install -r requirements.txt\nopyrator launch-ui app:preprocess_text --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可打开演示的 UI 界面。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n### 语言检测（Language Detection）\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_0a58ae7560b2.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fdetect_language\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fdetect_language_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fdetect-language-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，请执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fdetect_language\u002F\npip install -r requirements.txt\nopyrator launch-ui app:detect_language --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可打开演示的 UI 界面。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n### 音频分离（Audio Separation）\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_b05534ac9a97.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fseparate_audio\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fseperate_audio_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fseparate-audio-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，请执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fseparate_audio\u002F\npip install -r requirements.txt\nopyrator launch-ui app:separate_audio --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可打开演示的 UI 界面。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n### 词向量训练（Word Vectors Training）\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_150f277e738f.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Ftrain_word_vectors\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Ftrain_word_vectors_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Ftrain-word-vectors-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，请执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Ftrain_word_vectors\u002F\npip install -r requirements.txt\nopyrator launch-ui app:train_word_vectors --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可打开演示的 UI 界面。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n### 命名实体识别（Named Entity Recognition）\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_9feebd0d77fc.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fnamed_entity_recognition\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fnamed_entity_recognition_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fnamed-entity-recognition-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，请执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fnamed_entity_recognition\u002F\npip install -r requirements.txt\nopyrator launch-ui app:named_entity_recognition --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可打开演示的 UI。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n### 组件展示（Components Showcase）\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_4ef98a2dbe04.png\"\u002F>\n\n- 📄&nbsp; [源代码](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002Fexamples\u002Fshowcase_components\u002Fapp.py)\n- 🌅&nbsp; [UI 演示](https:\u002F\u002Fplay.mltooling.com\u002Fopyrator\u002Fdemos\u002Fshowcase_components_ui\u002F)\n- 🔌&nbsp; [OpenAPI 规范](https:\u002F\u002Feditor.swagger.io\u002F?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fml-tooling\u002Fopyrator\u002Fmain\u002Fdocs\u002Fopenapi-demo-specs\u002Fshowcase-components-openapi-spec.json)\n\n\u003Cdetails>\n\u003Csummary>在本地运行此演示（点击展开...）\u003C\u002Fsummary>\n\n要在本地机器上运行该演示，请执行以下命令：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\ncd .\u002Fopyrator\u002Fexamples\u002Fshowcase_components\u002F\npip install -r requirements.txt\nopyrator launch-ui app:showcase_components --port 8051\n```\n\n在浏览器中访问 http:\u002F\u002Flocalhost:8051 即可打开演示的 UI。若要启动 HTTP API 服务器，请将 `launch-ui` 替换为 `launch-api`。\n\n\u003C\u002Fdetails>\n\n## 支持与反馈\n\n本项目由 [Benjamin Räthlein](https:\u002F\u002Ftwitter.com\u002Fraethlein)、[Lukas Masuch](https:\u002F\u002Ftwitter.com\u002FLukasMasuch) 和 [Jan Kalkan](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fjan-kalkan-b5390284\u002F) 维护。请注意，我们无法通过电子邮件提供一对一支持。我们也认为，如果帮助能公开分享，将使更多人受益。\n\n| 类型                     | 渠道                                              |\n| ------------------------ | ------------------------------------------------------ |\n| 🚨&nbsp; **Bug 报告**       | \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Abug+sort%3Areactions-%2B1-desc+\" title=\"提交 Bug 报告\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fml-tooling\u002Fopyrator\u002Fbug.svg?label=bug\">\u003C\u002Fa>                                 |\n| 🎁&nbsp; **功能请求**  | \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues?q=is%3Aopen+is%3Aissue+label%3Afeature+sort%3Areactions-%2B1-desc\" title=\"提交功能请求\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fml-tooling\u002Fopyrator\u002Ffeature.svg?label=feature%20request\">\u003C\u002Fa>                                 |\n| 👩‍💻&nbsp; **使用问题**   |  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues?q=is%3Aopen+is%3Aissue+label%3Asupport+sort%3Areactions-%2B1-desc\" title=\"提交支持请求\"> \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fml-tooling\u002Fopyrator\u002Fsupport.svg?label=support%20request\">\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Fgitter.im\u002Fml-tooling\u002Fcommunity\" title=\"在 Gitter 上聊天\">\u003Cimg src=\"https:\u002F\u002Fbadges.gitter.im\u002Fml-tooling\u002Fcommunity.svg\">\u003C\u002Fa> |\n| 📢&nbsp; **公告** | \u003Ca href=\"https:\u002F\u002Fgitter.im\u002Fml-tooling\u002Fcommunity\" title=\"在 Gitter 上聊天\">\u003Cimg src=\"https:\u002F\u002Fbadges.gitter.im\u002Fmml-tooling\u002Fcommunity.svg\">\u003C\u002Fa>  \u003Ca href=\"https:\u002F\u002Fmltooling.substack.com\u002Fsubscribe\" title=\"订阅更新\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_c2109c0b6cbf.png\">\u003C\u002Fa> \u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fmltooling\" title=\"关注 ML Tooling 的 Twitter\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fmltooling.svg?style=social&label=Follow\"> |\n| ❓&nbsp; **其他请求** | \u003Ca href=\"mailto:team@ml-tooling.org\" title=\"发送邮件给 ML Tooling 团队\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Femail-ML Tooling-green?logo=mail.ru&logoColor=white\">\u003C\u002Fa> |\n\n## 功能特性\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#http-api\">HTTP API\u003C\u002Fa> •\n  \u003Ca href=\"#graphical-ui\">图形化 UI\u003C\u002Fa> •\n  \u003Ca href=\"#command-line-interface\">命令行接口（CLI）\u003C\u002Fa> •\n  \u003Ca href=\"#zip-export\">Zip 导出\u003C\u002Fa> •\n  \u003Ca href=\"#docker-export\">Docker 导出\u003C\u002Fa> •\n  \u003Ca href=\"#pre-defined-components\">预定义组件\u003C\u002Fa> •\n  \u003Ca href=\"#production-deployment\">生产环境部署\u003C\u002Fa>\n\u003C\u002Fp>\n\n### HTTP API\n\n使用 Opyrator，你可以为任意[兼容函数](#compatible-functions)立即启动一个本地 HTTP（REST）API 服务器：\n\n```bash\nopyrator launch-api my_opyrator:hello_world\n```\n\n这将基于 [OpenAPI 标准](https:\u002F\u002Fswagger.io\u002Fspecification) 启动一个 [FastAPI](https:\u002F\u002Ffastapi.tiangolo.com\u002F) 服务器，并自动生成交互式文档。\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_2d560f03b3bc.png\"\u002F>\n\n_💡 请确保你的脚本所需的所有依赖项都已在当前 Python 环境中安装。_\n\n可通过命令行参数指定 API 服务器使用的端口：\n\n```bash\nopyrator launch-api my_opyrator:hello_world --port 8080\n```\n\n也可以通过导出的 zip 文件格式来启动 API 服务器（参见下方的 [zip 导出](#zip-export) 部分）：\n\n```bash\nopyrator launch-api my-opyrator.zip\n```\n\n### 图形用户界面（Graphical UI）\n\n你可以为你的[兼容函数](#compatible-functions)启动一个由 [Streamlit](https:\u002F\u002Fstreamlit.io\u002F) 驱动的图形用户界面（GUI）。该界面会根据给定函数的输入和输出 Schema 自动生成。\n\n```bash\nopyrator launch-ui my_opyrator:hello_world\n```\n\n\u003Cimg style=\"width: 100%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_0e7721588961.png\"\u002F>\n\n_💡 请确保你的脚本所需的所有依赖项都已安装在当前激活的 Python 环境中。_\n\n你只需通过修改和完善函数的输入和输出 Schema，即可影响 UI 的大部分表现形式。此外，也可以为函数的输入和输出定义自定义 UI。更多细节请参阅 [输入与输出 Schema](#TODO) 章节。\n\nUI 服务器使用的端口可以通过命令行参数指定：\n\n```bash\nopyrator launch-ui my_opyrator:hello_world --port 8080\n```\n\nUI 服务器也可以通过导出的 zip 文件格式启动（参见下方的 [zip 导出](#zip-export) 章节）：\n\n```bash\nopyrator launch-ui my-opyrator.zip\n```\n\n此外，还可以通过已运行的 Opyrator API 端点来启动 UI 服务器：\n\n```bash\nopyrator launch-ui http:\u002F\u002Fmy-opyrator:8080 \n```\n\n这样，UI 中所有的 Opyrator 调用都会通过配置的 HTTP 端点执行，而不是在 UI 服务器内部直接运行 Python 函数。\n\n### 命令行接口（Command-line Interface）\n\nOpyrator 也可以通过命令行执行：\n\n```bash\nopyrator call my_opyrator:hello_world '{\"message\": \"hello\"}'\n```\n\n\u003Cimg style=\"width: 80%\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_readme_901952b89fc8.png\"\u002F>\n\nCLI 接口同样支持使用 [zip 导出格式](#zip-export)：\n\n```bash\nopyrator call my-opyrator.zip '{\"message\": \"hello\"}'\n```\n\n或者通过已运行的 Opyrator API 端点调用：\n\n```bash\nopyrator call http:\u002F\u002Fmy-opyrator:8080 '{\"message\": \"hello\"}'\n```\n\n此时，函数调用将由 Opyrator API 服务器执行，而不是在本地直接调用 Python 函数。\n\n### Zip 导出（Zip Export）\n\nOpyrator 允许你将一个[兼容函数](#compatible-functions)打包并导出为一个自包含的 zip 文件：\n\n```bash\nopyrator export my_opyrator:hello_world my-opyrator.zip\n```\n\n该 zip 文件将相关的源代码和数据制品打包成单个文件，便于共享、存储，并可用于如上所述启动 API 或 UI。\n\n外部依赖项会根据工作目录中的以下文件自动识别：`Pipfile`（Pipenv 环境）、`environment.yml`（Conda 环境）、`pyproject.toml`（Poetry 依赖）、`requirements.txt`（pip 依赖）、`setup.py`（Python 项目依赖）、`packages.txt`（apt-get 包），或作为后备方案通过 [pipreqs](https:\u002F\u002Fgithub.com\u002Fbndr\u002Fpipreqs) 自动发现。但请注意，外部依赖项仅以说明形式包含在 zip 文件中，并不会实际打包进去。如果你希望导出完全自包含的 Opyrator（包括所有依赖项甚至 Python 解释器本身），请参考 [Docker 导出](#docker-export) 或 [pex 导出](#pex-export) 选项。\n\n顺便一提，以 zip 格式导出的 Opyrator 实际上是（微型）Python 库，可以通过 pip 安装、导入并在其他 Python 代码中使用：\n\n```bash\npip install my-opyrator.zip\n```\n\n_WIP：此功能尚未完成。你可以在此处[跟踪进展并投票支持该功能](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F3)。_\n\n### Docker 导出（Docker Export）\n\n除了 ZIP 导出外，Opyrator 还支持导出为 Docker 镜像：\n\n```bash\nopyrator export my_opyrator:hello_world --format=docker my-opyrator-image:latest\n```\n\n_💡 Docker 导出要求你的机器上已安装 Docker。_\n\n导出成功后，可按如下方式运行该 Docker 镜像：\n\n```bash\ndocker run -p 8080:8080 my-opyrator-image:latest\n```\n\n在此 Docker 镜像中运行 Opyrator 的优势在于只需暴露一个端口。UI 与 API 通过 URL 路径进行区分：`http:\u002F\u002Flocalhost:8080\u002Fapi`（API）；`http:\u002F\u002Flocalhost:8080\u002Fui`（UI）。UI 会自动配置为通过该 API 执行所有函数调用。\n\n_WIP：此功能尚未完成。你可以在此处[跟踪进展并投票支持该功能](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F4)。_\n\n### Pex 导出（Pex Export）\n\nOpyrator 还支持导出为 pex 文件。[Pex](https:\u002F\u002Fgithub.com\u002Fpantsbuild\u002Fpex) 是一个用于创建自包含可执行 Python 环境的工具，其中包含所有相关的 Python 依赖项。\n\n```bash\nopyrator export my_opyrator:hello_world --format=pex my-opyrator.pex\n```\n\n_WIP：此功能尚未完成。你可以在此处[跟踪进展并投票支持该功能](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F5)。_\n\n### Python 客户端（Python Client）\n\n每个已部署的 Opyrator 都通过一个端点方法提供 Python 客户端库，可通过 pip 安装：\n\n```bash\npip install http:\u002F\u002Fmy-opyrator:8080\u002Fclient\n```\n\n并在你的代码中使用，如下所示：\n\n```python\nfrom my_opyrator import Client, Input\nopyrator_client = Client(\"http:\u002F\u002Fmy-opyrator:8080\")\nresult = opyrator_client.call(Input(text=\"hello\", wait=1))\n```\n\n_WIP：此功能尚未完成。你可以在此处[跟踪进展并投票支持该功能](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F8)。_\n\n### 预定义组件（Pre-defined Components）\n\nOpyrator 提供了越来越多的预定义组件（输入和输出模型），适用于常见任务。其中一些组件还提供了更高级的 UI 和可视化功能。你可以复用这些组件来加速开发，并确保你的 Opyrator 与其他功能改进或其他 Opyrator 保持兼容。\n\n你可以在 [示例](#examples) 章节或此 [源代码包](#TODO) 中找到部分可用的接口。\n\n_WIP：此功能尚未完成。你可以在此处[跟踪进展并投票支持该功能](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F9)。_\n\n### 生产环境部署（Production Deployment）\n\n将你的 Opyrator 投入生产环境可能需要额外的功能，例如 SSL、身份验证、API Token、无限扩展性、负载均衡和监控。因此，我们提供了直接在可扩展且安全的云平台上轻松部署 Opyrator 的能力，而无需大量额外开销：\n\n```bash\nopyrator deploy my_opyrator:hello_world \u003Cdeployment-provider> \u003Cdeployment-provider-options>\n```\n\n_WIP：此功能尚未完成。你可以在此处[跟踪进展并投票支持该功能](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F6)。_\n\n## 文档（Documentation）\n\n### 兼容函数\n\n一个函数若满足以下要求，则与 Opyrator 兼容：\n\n- 必须包含一个名为 `input` 的单一参数，且该参数必须是 [Pydantic BaseModel](https:\u002F\u002Fpydantic-docs.helpmanual.io\u002Fusage\u002Fmodels\u002F) 的子类。\n- 必须返回一个单一值，且该返回值必须是 [Pydantic BaseModel](https:\u002F\u002Fpydantic-docs.helpmanual.io\u002Fusage\u002Fmodels\u002F) 的子类。\n- `input` 参数和返回值必须使用 Python 类型提示（typing hints）进行标注。\n\n### 输入与输出 Schema\n\n_WIP_\n\n### 命令行界面\n\n_WIP_\n\n\n## 贡献\n\n- 我们欢迎并鼓励提交 Pull Request。请阅读我们的[贡献指南](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Ftree\u002Fmain\u002FCONTRIBUTING.md)，并查看标记为 [help-wanted](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3A\"help+wanted\"+sort%3Areactions-%2B1-desc+) 的议题。\n- 针对任何[功能请求与改进](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002Fnew?assignees=&labels=feature&template=02_feature-request.md&title=)、[Bug 报告](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002Fnew?assignees=&labels=bug&template=01_bug-report.md&title=)或[文档问题](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002Fnew?assignees=&labels=documentation&template=03_documentation.md&title=)，请提交 GitHub Issue。\n- 参与本项目即表示您同意遵守项目的[行为准则](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002F.github\u002FCODE_OF_CONDUCT.md)。\n- 下方的[开发章节](#development)提供了在您完成某些修改后如何构建和测试项目的信息。\n\n## 开发\n\n有关我们的构建脚本和开发流程的信息，请参阅[贡献指南](https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fblob\u002Fmain\u002FCONTRIBUTING.md#development-instructions)。\n\n---\n\n本项目采用 **MIT** 许可证。由来自柏林的开发者们怀着 ❤️ 创建并维护。","# Opyrator 快速上手指南\n\nOpyrator 可将你的 Python 函数一键转换为具备 Web API 和交互式 UI 的微服务，基于 FastAPI、Streamlit 和 Pydantic 构建。\n\n> ⚠️ 注意：当前为 Alpha 版本，仅建议用于实验性用途。\n\n---\n\n## 环境准备\n\n- **操作系统**：支持主流 Linux、macOS 和 Windows\n- **Python 版本**：3.6 或更高版本\n- **网络建议**：国内用户可配置 pip 镜像源（如清华源）加速安装\n\n```bash\n# 可选：临时使用清华源加速安装\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple opyrator\n```\n\n## 安装步骤\n\n在终端中执行以下命令安装 Opyrator：\n\n```bash\npip install opyrator\n```\n\n## 基本使用\n\n### 1. 编写一个兼容的函数\n\n创建文件 `my_opyrator.py`，内容如下：\n\n```python\nfrom pydantic import BaseModel\n\nclass Input(BaseModel):\n    message: str\n\nclass Output(BaseModel):\n    message: str\n\ndef hello_world(input: Input) -> Output:\n    \"\"\"返回输入的 message 字段\"\"\"\n    return Output(message=input.message)\n```\n\n> 💡 要求：函数必须使用 Pydantic 模型作为输入参数和返回值，并通过类型注解声明。\n\n### 2. 启动交互式 Web UI\n\n```bash\nopyrator launch-ui my_opyrator:hello_world\n```\n\n启动后，访问终端输出的本地地址（通常是 `http:\u002F\u002Flocalhost:8501`）即可使用图形界面。\n\n### 3. 启动 HTTP API 服务\n\n```bash\nopyrator launch-api my_opyrator:hello_world\n```\n\n服务启动后，API 默认运行在 `http:\u002F\u002Flocalhost:8080`，可通过 `\u002Fdocs` 查看自动生成的 Swagger 文档。\n\n--- \n\n现在你已成功将一个普通 Python 函数转变为可部署的微服务！更多示例可参考官方 Playground：https:\u002F\u002Fopyrator-playground.mltooling.org","某电商公司的数据科学团队开发了一个商品评论情感分析模型，需要快速将其提供给产品和客服团队试用，并为后续集成到内部系统做准备。\n\n### 没有 opyrator 时\n- 团队需手动编写 FastAPI 应用代码来暴露 HTTP 接口，处理请求解析、错误响应和文档生成，耗时且易出错。\n- 为了让非技术同事试用，还需额外开发一个简易 Web 界面，通常依赖 Flask 或 Streamlit，增加维护成本。\n- 每次模型逻辑更新后，前后端代码都要同步调整，沟通和测试成本高。\n- 部署时需单独配置 Dockerfile 和依赖环境，流程繁琐，难以快速分享给其他团队。\n- 缺乏标准化输入输出结构，容易因参数格式不一致导致调用失败。\n\n### 使用 opyrator 后\n- 只需将原有预测函数按 Pydantic 模型定义输入输出，一行命令即可自动生成带 OpenAPI 文档的 Web API。\n- 通过 `opyrator launch-ui` 自动启动交互式 Web 界面，产品和客服人员可直接在浏览器中输入评论并查看情感结果。\n- 模型逻辑与服务层完全解耦，算法工程师只需专注核心函数，无需关心接口或前端实现。\n- 支持一键导出为可执行文件或 Docker 镜像，方便跨团队分发和部署到测试环境。\n- 基于类型提示和 JSON Schema 自动生成校验逻辑，确保输入输出规范统一，减少集成错误。\n\nopyrator 将原本数天的工程化工作压缩到几分钟，让数据科学家能真正“写完即用、改完即测”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fml-tooling_opyrator_4c2b0ec4.png","ml-tooling","Machine Learning Tooling","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fml-tooling_4577802e.png","",null,"team@mltooling.org","mltooling","https:\u002F\u002Fgithub.com\u002Fml-tooling",[84,88,92,95],{"name":85,"color":86,"percentage":87},"Python","#3572A5",84.6,{"name":89,"color":90,"percentage":91},"Dockerfile","#384d54",9.5,{"name":93,"color":94,"percentage":10},"Shell","#89e051",{"name":96,"color":97,"percentage":98},"HTML","#e34c26",2.9,3137,166,"2026-03-30T05:40:48","MIT","Linux, macOS, Windows","未说明",{"notes":106,"python":107,"dependencies":108},"工具处于 Alpha 版本，仅建议用于实验用途。函数需使用 Pydantic 模型定义输入和输出，并通过类型提示指定。部分示例可能有额外依赖，需安装对应 requirements.txt 中的包。","3.6+",[109,110,111],"fastapi","streamlit","pydantic",[53,13],[109,110,111,114,115,116,117,118,119,120,121,122],"python","microservices","serverless","faas","functions","python-functions","machine-learning","deployment","type-hints",4,"2026-03-27T02:49:30.150509","2026-04-06T08:18:25.607886",[127,132,137,142,147],{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},1627,"如何将 Opyrator 导出为 Docker 镜像并运行？","可以使用命令行导出：`opyrator export my_opyrator:hello_world --format=docker my-opyrator-image:latest`。导出后通过 `docker run -p 8080:8080 my-opyrator-image:latest` 运行。UI 和 API 分别通过 `http:\u002F\u002Flocalhost:8080\u002Fui` 和 `http:\u002F\u002Flocalhost:8080\u002Fapi` 访问，且 UI 会自动配置使用该 API。注意：需提前安装 Docker。","https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F4",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},1628,"如何让 Opyrator 的输出支持下载 Excel 文件（.xlsx）？","应使用正确的 MIME 类型 `application\u002Fvnd.openxmlformats-officedocument.spreadsheetml.sheet` 而非 `application\u002Fexcel`。示例代码：\n```python\nfrom opyrator.components.types import FileContent\nfrom pydantic import BaseModel, Field\n\nclass Output(BaseModel):\n    excel_file: FileContent = Field(\n        ...,\n        mime_type=\"application\u002Fvnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n    )\n\ndef return_file(input: Input) -> Output:\n    with open(\"aa.xlsx\", \"rb\") as f:\n        return Output(excel_file=f.read())\n```","https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F29",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},1629,"运行 `opyrator launch-ui` 或 `launch-api` 时报错：`No module named 'streamlit.report_thread'` 或 `cannot import name 'graphql' from 'starlette'`，如何解决？","这是由于依赖版本不兼容导致的。建议将 Streamlit 降级至 1.3.1，Starlette 降级至 0.13.6。可通过以下命令安装兼容版本：\n```bash\npip install streamlit==1.3.1 starlette==0.13.6\n```","https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F48",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},1630,"启动 Opyrator 时出现错误：`pydantic.errors.PydanticImportError: 'pydantic:parse_raw_as' has been removed in V2`，怎么办？","该错误是因为 Opyrator 当前版本不兼容 Pydantic v2。解决方案是降级 Pydantic 至 v1.x 版本，例如：\n```bash\npip install \"pydantic\u003C2\"\n```\n确保环境中未安装 Pydantic v2，否则核心模块无法导入 `parse_raw_as`。","https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F108",{"id":148,"question_zh":149,"answer_zh":150,"source_url":151},1631,"按照官方“Getting Started”教程运行 hello_world 示例失败，显示 Streamlit 配置警告且页面空白，如何排查？","该问题可能由环境状态异常引起。有用户反馈重启后自行恢复。若持续失败，可尝试：1）确保使用兼容的 Python 版本（如 3.8–3.10）；2）检查是否因 Streamlit 版本过高导致（参考 Issue #48 的降级方案）；3）在干净虚拟环境中重新安装 opyrator 及其依赖。","https:\u002F\u002Fgithub.com\u002Fml-tooling\u002Fopyrator\u002Fissues\u002F27",[153,158],{"id":154,"version":155,"summary_zh":156,"released_at":157},110840,"v0.0.11","## 🚨 Bug Fixes\r\n\r\n- Changed subprocess.run command in launch_ui function (#26) by @JopaXd\r\n\r\n## 📝 Documentation\r\n\r\n- Fix typo: seperate -> separate (#20) by @raethlein\r\n\r\n## 👥 Contributors\r\n\r\nThanks to @JopaXd, @LukasMasuch and @raethlein for the contributions.\r\n","2021-05-01T13:59:02",{"id":159,"version":160,"summary_zh":161,"released_at":162},110841,"v0.0.10","## 🚨 Bug Fixes\r\n\r\n- Make opyrator work on Windows with streamlit-ui (#18) by @raethlein\r\n\r\n## 📝 Documentation\r\n\r\n- Fix typo in README.md (#21) by @adriangb\r\n\r\n## 👥 Contributors\r\n\r\nThanks to @LukasMasuch, @adriangb and @raethlein for the contributions.\r\n","2021-05-01T13:08:40"]