[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-gradio-app--gradio":3,"tool-gradio-app--gradio":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":79,"owner_website":81,"owner_url":82,"languages":83,"stars":123,"forks":124,"last_commit_at":125,"license":126,"difficulty_score":127,"env_os":128,"env_gpu":129,"env_ram":129,"env_deps":130,"category_tags":134,"github_topics":135,"view_count":149,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":150,"updated_at":151,"faqs":152,"releases":181},1417,"gradio-app\u002Fgradio","gradio","Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!","Gradio 是一个专为 Python 开发者打造的开源库，旨在让用户无需掌握前端技术，即可快速构建并分享机器学习模型、API 或任意 Python 函数的交互式网页应用。它主要解决了传统 AI 演示开发门槛高的问题：过去展示模型往往需要编写复杂的 HTML、CSS 和 JavaScript 代码，还要配置服务器，而 Gradio 将这些繁琐步骤封装起来，让开发者只需几行 Python 代码就能生成具备美观界面的 Demo。\n\n这款工具非常适合 AI 研究人员、数据科学家以及希望快速验证想法的 Python 开发者使用。无论是需要在论文中展示实验结果，还是想向团队演示新训练模型的成效，Gradio 都能帮助你在几分钟内完成从代码到可交互网页的转化。其独特的技术亮点在于“零前端依赖”的设计理念，内置了丰富的输入输出组件（如文本框、滑块、图像上传等），并支持一键生成公开分享链接，方便他人直接在浏览器中体验。此外，它还自动生成了 API 接口，便于后续集成到其他系统中。凭借简洁的语法和强大的功能，Gradio 已成为连接算法原型与实际应用的高效桥梁，让创意落地变得更加轻松自然。","\u003C!-- DO NOT EDIT THIS FILE DIRECTLY. INSTEAD EDIT THE `readme_template.md` OR `guides\u002F01_getting-started\u002F01_quickstart.md` TEMPLATES AND THEN RUN `render_readme.py` SCRIPT. -->\n\n\u003Cdiv align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fgradio.app\">\n\u003Cimg src=\"readme_files\u002Fgradio.svg\" alt=\"gradio\" width=350>\n\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n\u003Cspan>\n\u003Ca href=\"https:\u002F\u002Fwww.producthunt.com\u002Fposts\u002Fgradio-5-0?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-gradio&#0045;5&#0045;0\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fapi.producthunt.com\u002Fwidgets\u002Fembed-image\u002Fv1\u002Ffeatured.svg?post_id=501906&theme=light\" alt=\"Gradio&#0032;5&#0046;0 - the&#0032;easiest&#0032;way&#0032;to&#0032;build&#0032;AI&#0032;web&#0032;apps | Product Hunt\" style=\"width: 150px; height: 54px;\" width=\"150\" height=\"54\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F2145\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgradio-app_gradio_readme_4a68feb902da.png\" alt=\"gradio-app%2Fgradio | Trendshift\" style=\"width: 150px; height: 55px;\" width=\"150\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fspan>\n\n[![gradio-backend](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Factions\u002Fworkflows\u002Ftest-python.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Factions\u002Fworkflows\u002Ftest-python.yml)\n[![gradio-ui](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Factions\u002Fworkflows\u002Ftests-js.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Factions\u002Fworkflows\u002Ftests-js.yml) \n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fgradio)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fgradio\u002F)\n[![PyPI downloads](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Fgradio)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fgradio\u002F)\n![Python version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.10+-important)\n[![Twitter follow](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fgradio?style=social&label=follow)](https:\u002F\u002Ftwitter.com\u002Fgradio)\n\n[Website](https:\u002F\u002Fgradio.app)\n| [Documentation](https:\u002F\u002Fgradio.app\u002Fdocs\u002F)\n| [Guides](https:\u002F\u002Fgradio.app\u002Fguides\u002F)\n| [Getting Started](https:\u002F\u002Fgradio.app\u002Fgetting_started\u002F)\n| [Examples](demo\u002F)\n\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n\nEnglish | [中文](readme_files\u002Fzh-cn#readme)\n\n\u003C\u002Fdiv>\n\n# Gradio: Build Machine Learning Web Apps — in Python\n\n\n\nGradio is an open-source Python package that allows you to quickly **build** a demo or web application for your machine learning model, API, or any arbitrary Python function. You can then **share** a link to your demo or web application in just a few seconds using Gradio's built-in sharing features. *No JavaScript, CSS, or web hosting experience needed!*\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgradio-app_gradio_readme_6687d231751e.gif\" style=\"padding-bottom: 10px\">\n\nIt just takes a few lines of Python to create your own demo, so let's get started 💫\n\n\n### Installation\n\n**Prerequisite**: Gradio requires [Python 3.10 or higher](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F).\n\n\nWe recommend installing Gradio using `pip`, which is included by default in Python. Run this in your terminal or command prompt:\n\n```bash\npip install --upgrade gradio\n```\n\n\n> [!TIP]\n > It is best to install Gradio in a virtual environment. Detailed installation instructions for all common operating systems \u003Ca href=\"https:\u002F\u002Fwww.gradio.app\u002Fmain\u002Fguides\u002Finstalling-gradio-in-a-virtual-environment\">are provided here\u003C\u002Fa>. \n\n### Building Your First Demo\n\nYou can run Gradio in your favorite code editor, Jupyter notebook, Google Colab, or anywhere else you write Python. Let's write your first Gradio app:\n\n\n```python\nimport gradio as gr\n\ndef greet(name, intensity):\n    return \"Hello, \" + name + \"!\" * int(intensity)\n\ndemo = gr.Interface(\n    fn=greet,\n    inputs=[\"text\", \"slider\"],\n    outputs=[\"text\"],\n    api_name=\"predict\"\n)\n\ndemo.launch()\n```\n\n\n\n> [!TIP]\n > We shorten the imported name from \u003Ccode>gradio\u003C\u002Fcode> to \u003Ccode>gr\u003C\u002Fcode>. This is a widely adopted convention for better readability of code. \n\nNow, run your code. If you've written the Python code in a file named `app.py`, then you would run `python app.py` from the terminal.\n\nThe demo below will open in a browser on [http:\u002F\u002Flocalhost:7860](http:\u002F\u002Flocalhost:7860) if running from a file. If you are running within a notebook, the demo will appear embedded within the notebook.\n\n![`hello_world_4` demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgradio-app_gradio_readme_e28d7b2b6580.gif)\n\nType your name in the textbox on the left, drag the slider, and then press the Submit button. You should see a friendly greeting on the right.\n\n> [!TIP]\n > When developing locally, you can run your Gradio app in \u003Cstrong>hot reload mode\u003C\u002Fstrong>, which automatically reloads the Gradio app whenever you make changes to the file. To do this, simply type in \u003Ccode>gradio\u003C\u002Fcode> before the name of the file instead of \u003Ccode>python\u003C\u002Fcode>. In the example above, you would type: `gradio app.py` in your terminal. You can also enable \u003Cstrong>vibe mode\u003C\u002Fstrong> by using the \u003Ccode>--vibe\u003C\u002Fcode> flag, e.g. \u003Ccode>gradio --vibe app.py\u003C\u002Fcode>, which provides an in-browser chat that can be used to write or edit your Gradio app using natural language. Learn more in the \u003Ca href=\"https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fdeveloping-faster-with-reload-mode\">Hot Reloading Guide\u003C\u002Fa>.\n\n\n**Understanding the `Interface` Class**\n\nYou'll notice that in order to make your first demo, you created an instance of the `gr.Interface` class. The `Interface` class is designed to create demos for machine learning models which accept one or more inputs, and return one or more outputs. \n\nThe `Interface` class has three core arguments:\n\n- `fn`: the function to wrap a user interface (UI) around\n- `inputs`: the Gradio component(s) to use for the input. The number of components should match the number of arguments in your function.\n- `outputs`: the Gradio component(s) to use for the output. The number of components should match the number of return values from your function.\n\nThe `fn` argument is very flexible -- you can pass *any* Python function that you want to wrap with a UI. In the example above, we saw a relatively simple function, but the function could be anything from a music generator to a tax calculator to the prediction function of a pretrained machine learning model.\n\nThe `inputs` and `outputs` arguments take one or more Gradio components. As we'll see, Gradio includes more than [30 built-in components](https:\u002F\u002Fwww.gradio.app\u002Fdocs\u002Fgradio\u002Fintroduction) (such as the `gr.Textbox()`, `gr.Image()`, and `gr.HTML()` components) that are designed for machine learning applications. \n\n> [!TIP]\n > For the `inputs` and `outputs` arguments, you can pass in the name of these components as a string (`\"textbox\"`) or an instance of the class (`gr.Textbox()`).\n\nIf your function accepts more than one argument, as is the case above, pass a list of input components to `inputs`, with each input component corresponding to one of the arguments of the function, in order. The same holds true if your function returns more than one value: simply pass in a list of components to `outputs`. This flexibility makes the `Interface` class a very powerful way to create demos.\n\nWe'll dive deeper into the `gr.Interface` on our series on [building Interfaces](https:\u002F\u002Fwww.gradio.app\u002Fmain\u002Fguides\u002Fthe-interface-class).\n\n### Sharing Your Demo\n\nWhat good is a beautiful demo if you can't share it? Gradio lets you easily share a machine learning demo without having to worry about the hassle of hosting on a web server. Simply set `share=True` in `launch()`, and a publicly accessible URL will be created for your demo. Let's revisit our example demo,  but change the last line as follows:\n\n```python\nimport gradio as gr\n\ndef greet(name):\n    return \"Hello \" + name + \"!\"\n\ndemo = gr.Interface(fn=greet, inputs=\"textbox\", outputs=\"textbox\")\n    \ndemo.launch(share=True)  # Share your demo with just 1 extra parameter 🚀\n```\n\nWhen you run this code, a public URL will be generated for your demo in a matter of seconds, something like:\n\n👉 &nbsp; `https:\u002F\u002Fa23dsf231adb.gradio.live`\n\nNow, anyone around the world can try your Gradio demo from their browser, while the machine learning model and all computation continues to run locally on your computer.\n\nTo learn more about sharing your demo, read our dedicated guide on [sharing your Gradio application](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fsharing-your-app).\n\n\n### An Overview of Gradio\n\nSo far, we've been discussing the `Interface` class, which is a high-level class that lets you build demos quickly with Gradio. But what else does Gradio include?\n\n#### Custom Demos with `gr.Blocks`\n\nGradio offers a low-level approach for designing web apps with more customizable layouts and data flows with the `gr.Blocks` class. Blocks supports things like controlling where components appear on the page, handling multiple data flows and more complex interactions (e.g. outputs can serve as inputs to other functions), and updating properties\u002Fvisibility of components based on user interaction — still all in Python. \n\nYou can build very custom and complex applications using `gr.Blocks()`. For example, the popular image generation [Automatic1111 Web UI](https:\u002F\u002Fgithub.com\u002FAUTOMATIC1111\u002Fstable-diffusion-webui) is built using Gradio Blocks. We dive deeper into the `gr.Blocks` on our series on [building with Blocks](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fblocks-and-event-listeners).\n\n#### Chatbots with `gr.ChatInterface`\n\nGradio includes another high-level class, `gr.ChatInterface`, which is specifically designed to create Chatbot UIs. Similar to `Interface`, you supply a function and Gradio creates a fully working Chatbot UI. If you're interested in creating a chatbot, you can jump straight to [our dedicated guide on `gr.ChatInterface`](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fcreating-a-chatbot-fast).\n\n#### The Gradio Python & JavaScript Ecosystem\n\nThat's the gist of the core `gradio` Python library, but Gradio is actually so much more! It's an entire ecosystem of Python and JavaScript libraries that let you build machine learning applications, or query them programmatically, in Python or JavaScript. Here are other related parts of the Gradio ecosystem:\n\n* [Gradio Python Client](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fgetting-started-with-the-python-client) (`gradio_client`): query any Gradio app programmatically in Python.\n* [Gradio JavaScript Client](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fgetting-started-with-the-js-client) (`@gradio\u002Fclient`): query any Gradio app programmatically in JavaScript.\n* [Hugging Face Spaces](https:\u002F\u002Fhuggingface.co\u002Fspaces): the most popular place to host Gradio applications — for free!\n* [Server mode](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fserver-mode) (`gradio.Server`): build a custom frontend with Gradio's backend — queue, streaming, MCP, ZeroGPU, and Spaces hosting included.\n\n### What's Next?\n\nKeep learning about Gradio sequentially using the Gradio Guides, which include explanations as well as example code and embedded interactive demos. Next up: [let's dive deeper into the Interface class](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fthe-interface-class).\n\nOr, if you already know the basics and are looking for something specific, you can search the more [technical API documentation](https:\u002F\u002Fwww.gradio.app\u002Fdocs\u002F).\n\n\n### AI Coding Skills\n\nGradio provides a \"skill\" that enriches AI coding assistants (like Cursor, Claude Code, Codex, etc.) with Gradio-specific knowledge, so that they can build Gradio apps more effectively. This is especially useful when creating custom Gradio components or styling. Install the Gradio skill for your coding assistant with a single command:\n\n```bash\ngradio skills add --cursor   # or --claude, --codex, --opencode\n```\n\nUse `--global` to install at the user level (applies to all projects). Your skill will be automatically available for the particular coding agent.\n\nYou can also install a skill for a **specific Gradio Space**, which generates API usage docs (Python, JS, cURL) on the fly:\n\n```bash\ngradio skills add abidlabs\u002Fen2fr --cursor\n```\n\n## Questions?\n\nIf you'd like to report a bug or have a feature request, please create an [issue on GitHub](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fissues\u002Fnew\u002Fchoose). For general questions about usage, we are available on [our Discord server](https:\u002F\u002Fdiscord.com\u002Finvite\u002FfeTf9x3ZSB) and happy to help.\n\nIf you like Gradio, please leave us a ⭐ on GitHub!\n\n## Open Source Stack\n\nGradio is built on top of many wonderful open-source libraries!\n\n[\u003Cimg src=\"readme_files\u002Fhuggingface_mini.svg\" alt=\"huggingface\" height=40>](https:\u002F\u002Fhuggingface.co)\n[\u003Cimg src=\"readme_files\u002Fpython.svg\" alt=\"python\" height=40>](https:\u002F\u002Fwww.python.org)\n[\u003Cimg src=\"readme_files\u002Ffastapi.svg\" alt=\"fastapi\" height=40>](https:\u002F\u002Ffastapi.tiangolo.com)\n[\u003Cimg src=\"readme_files\u002Fencode.svg\" alt=\"encode\" height=40>](https:\u002F\u002Fwww.encode.io)\n[\u003Cimg src=\"readme_files\u002Fsvelte.svg\" alt=\"svelte\" height=40>](https:\u002F\u002Fsvelte.dev)\n[\u003Cimg src=\"readme_files\u002Fvite.svg\" alt=\"vite\" height=40>](https:\u002F\u002Fvitejs.dev)\n[\u003Cimg src=\"readme_files\u002Fpnpm.svg\" alt=\"pnpm\" height=40>](https:\u002F\u002Fpnpm.io)\n[\u003Cimg src=\"readme_files\u002Ftailwind.svg\" alt=\"tailwind\" height=40>](https:\u002F\u002Ftailwindcss.com)\n[\u003Cimg src=\"readme_files\u002Fstorybook.svg\" alt=\"storybook\" height=40>](https:\u002F\u002Fstorybook.js.org\u002F)\n[\u003Cimg src=\"readme_files\u002Fchromatic.svg\" alt=\"chromatic\" height=40>](https:\u002F\u002Fwww.chromatic.com\u002F)\n\n## License\n\nGradio is licensed under the Apache License 2.0 found in the [LICENSE](LICENSE) file in the root directory of this repository.\n\n## Citation\n\nAlso check out the paper _[Gradio: Hassle-Free Sharing and Testing of ML Models in the Wild](https:\u002F\u002Farxiv.org\u002Fabs\u002F1906.02569), ICML HILL 2019_, and please cite it if you use Gradio in your work.\n\n```\n@article{abid2019gradio,\n  title = {Gradio: Hassle-Free Sharing and Testing of ML Models in the Wild},\n  author = {Abid, Abubakar and Abdalla, Ali and Abid, Ali and Khan, Dawood and Alfozan, Abdulrahman and Zou, James},\n  journal = {arXiv preprint arXiv:1906.02569},\n  year = {2019},\n}\n```\n","\u003C!-- 请勿直接编辑此文件。请改用编辑 `readme_template.md` 或 `guides\u002F01_getting-started\u002F01_quickstart.md` 模板，然后运行 `render_readme.py` 脚本。 -->\n\n\u003Cdiv align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fgradio.app\">\n\u003Cimg src=\"readme_files\u002Fgradio.svg\" alt=\"gradio\" width=350>\n\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n\u003Cspan>\n\u003Ca href=\"https:\u002F\u002Fwww.producthunt.com\u002Fposts\u002Fgradio-5-0?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-gradio&#0045;5&#0045;0\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fapi.producthunt.com\u002Fwidgets\u002Fembed-image\u002Fv1\u002Ffeatured.svg?post_id=501906&theme=light\" alt=\"Gradio&#0032;5&#0046;0 - the&#0032;easiest&#0032;way&#0032;to&#0032;build&#0032;AI&#0032;web&#0032;apps | Product Hunt\" style=\"width: 150px; height: 54px;\" width=\"150\" height=\"54\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F2145\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgradio-app_gradio_readme_4a68feb902da.png\" alt=\"gradio-app%2Fgradio | Trendshift\" style=\"width: 150px; height: 55px;\" width=\"150\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fspan>\n\n[![gradio-backend](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Factions\u002Fworkflows\u002Ftest-python.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Factions\u002Fworkflows\u002Ftest-python.yml)\n[![gradio-ui](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Factions\u002Fworkflows\u002Ftests-js.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Factions\u002Fworkflows\u002Ftests-js.yml) \n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fgradio)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fgradio\u002F)\n[![PyPI downloads](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Fgradio)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fgradio\u002F)\n![Python 版本](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.10+-important)\n[![Twitter 关注](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fgradio?style=social&label=follow)](https:\u002F\u002Ftwitter.com\u002Fgradio)\n\n[网站](https:\u002F\u002Fgradio.app)\n| [文档](https:\u002F\u002Fgradio.app\u002Fdocs\u002F)\n| [指南](https:\u002F\u002Fgradio.app\u002Fguides\u002F)\n| [入门指南](https:\u002F\u002Fgradio.app\u002Fgetting_started\u002F)\n| [示例](demo\u002F)\n\n\u003C\u002Fdiv>\n\n\u003Cdiv align=\"center\">\n\n英文 | [中文](readme_files\u002Fzh-cn#readme)\n\n\u003C\u002Fdiv>\n\n# Gradio：用 Python 构建机器学习 Web 应用\n\nGradio 是一个开源的 Python 包，可让您快速为自己的机器学习模型、API 或任意 Python 函数 **构建** 一个演示或 Web 应用。您只需几秒钟，即可通过 Gradio 内置的分享功能，将您的演示或 Web 应用 **分享** 给他人。*无需任何 JavaScript、CSS 或 Web 托管经验！*\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgradio-app_gradio_readme_6687d231751e.gif\" style=\"padding-bottom: 10px\">\n\n只需几行 Python 代码，即可轻松创建属于自己的演示应用，让我们马上开始吧 💫\n\n\n### 安装\n\n**前提条件**：Gradio 需要 [Python 3.10 或更高版本](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)。\n\n我们建议使用 `pip` 进行安装，因为 Python 默认已包含该工具。在终端或命令提示符中运行以下命令：\n\n```bash\npip install --upgrade gradio\n```\n\n\n> [!提示]\n > 最好在虚拟环境中安装 Gradio。关于所有常见操作系统的详细安装说明，请参阅 \u003Ca href=\"https:\u002F\u002Fwww.gradio.app\u002Fmain\u002Fguides\u002Finstalling-gradio-in-a-virtual-environment\">此处\u003C\u002Fa>。\n\n### 构建你的第一个演示\n\n你可以在自己最喜爱的代码编辑器、Jupyter Notebook、Google Colab，或者任何其他你可以编写 Python 代码的地方运行 Gradio。让我们来编写你的第一个 Gradio 应用：\n\n\n```python\nimport gradio as gr\n\ndef greet(name, intensity):\n    return \"Hello, \" + name + \"!\" * int(intensity)\n\ndemo = gr.Interface(\n    fn=greet,\n    inputs=[\"text\", \"slider\"],\n    outputs=[\"text\"],\n    api_name=\"predict\"\n)\n\ndemo.launch()\n```\n\n\n\n> [！提示]\n > 我们将导入的 `gradio` 名称简写为 `gr`。这一命名约定已被广泛采用，以提升代码的可读性。\n\n现在，运行你的代码。如果你将 Python 代码保存在名为 `app.py` 的文件中，那么你只需在终端中运行 `python app.py` 即可。\n\n如果从文件中运行，下方的演示将在浏览器中打开，网址为 [http:\u002F\u002Flocalhost:7860](http:\u002F\u002Flocalhost:7860)。如果你是在 Jupyter Notebook 中运行，演示将会嵌入到 Notebook 内部显示。\n\n![`hello_world_4` 演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgradio-app_gradio_readme_e28d7b2b6580.gif)\n\n在左侧的文本框中输入你的名字，拖动滑块，然后点击“提交”按钮。你应该会在右侧看到一条友好的问候语。\n\n> [！提示]\n > 在本地开发时，你可以将 Gradio 应用置于 \u003Cstrong>热重载模式\u003C\u002Fstrong>下运行，只要你在文件中进行修改，Gradio 应用就会自动重新加载。要实现这一点，只需在文件名前输入 `\u003Cgradio>`，而不是直接输入 `python`。在上面的示例中，你可以在终端中输入：`gradio app.py`。你还可以通过使用 `--vibe` 标志启用 \u003Cstrong>Vibe 模式\u003C\u002Fstrong>,例如：`gradio --vibe app.py`，该模式会提供一个浏览器内置的聊天窗口，可用于使用自然语言编写或编辑你的 Gradio 应用。更多详情请参阅 \u003Ca href=\"https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fdeveloping-faster-with-reload-mode\">热重载指南\u003C\u002Fa>。\n\n\n**理解 `Interface` 类**\n\n你会发现，为了构建你的第一个演示，你创建了一个 `gr.Interface` 类的实例。`Interface` 类旨在为机器学习模型创建演示，这些模型可以接受一个或多个输入，并返回一个或多个输出。\n\n`Interface` 类有三个核心参数：\n\n- `fn`：用于包裹用户界面（UI）的函数\n- `inputs`：用于输入的 Gradio 组件。组件的数量应与函数中的参数数量一致。\n- `outputs`：用于输出的 Gradio 组件。组件的数量应与函数返回的值数量一致。\n\n`fn` 参数非常灵活——你可以传递任意你想用 UI 包装的 Python 函数。在上面的示例中，我们看到的是一个相对简单的函数，但这个函数可以是任何东西，从音乐生成器到税务计算器，再到预训练机器学习模型的预测函数。\n\n`inputs` 和 `outputs` 参数则接收一个或多个 Gradio 组件。正如我们接下来将看到的那样，Gradio 已经内置了超过 [30 种组件](https:\u002F\u002Fwww.gradio.app\u002Fdocs\u002Fgradio\u002Fintroduction)（如 `gr.Textbox()`、`gr.Image()` 和 `gr.HTML()` 等组件），这些组件专为机器学习应用而设计。\n\n> [！提示]\n > 对于 `inputs` 和 `outputs` 参数，你可以以字符串形式（如 `\"textbox\"`）或类的实例（如 `gr.Textbox()`）来传入这些组件的名称。\n\n如果你的函数接受多个参数，就像上面的例子一样，可以将输入组件列表传递给 `inputs`，每个输入组件对应函数的一个参数。同样地，如果你的函数返回多个值，只需将组件列表传递给 `outputs` 即可。这种灵活性使 `Interface` 类成为构建演示的极为强大的工具。\n\n在后续的系列文章中，我们将深入探讨 `gr.Interface`，重点讲解如何构建接口（[构建接口](https:\u002F\u002Fwww.gradio.app\u002Fmain\u002Fguides\u002Fthe-interface-class)）。\n\n### 分享你的演示\n\n如果一个演示再美观，却无法分享，又有什么意义呢？Gradio 让你轻松分享机器学习演示，而无需担心在 Web 服务器上托管的繁琐流程。只需在 `launch()` 中设置 `share=True`，即可为你的演示生成一个公开可访问的 URL。让我们回到之前的示例演示，但将最后一行修改为如下内容：\n\n```python\nimport gradio as gr\n\ndef greet(name):\n    return \"Hello \" + name + \"!\"\n\ndemo = gr.Interface(fn=greet, inputs=\"textbox\", outputs=\"textbox\")\n    \ndemo.launch(share=True)  # 仅需一个额外参数，即可与他人共享你的演示 🚀\n```\n\n当你运行这段代码时，你的演示将在几秒钟内生成一个公开的 URL，例如：\n\n👉 &nbsp; `https:\u002F\u002Fa23dsf231adb.gradio.live`\n\n现在，世界各地的任何人都可以通过浏览器试用你的 Gradio 演示，而机器学习模型和所有计算仍将继续在你电脑本地运行。\n\n如需了解更多关于分享演示的信息，请阅读我们的专属指南——[分享你的 Gradio 应用](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fsharing-your-app)。\n\n### Gradio 概述\n\n到目前为止，我们一直在探讨 `Interface` 类——这是一个高级别类，能够帮助您快速使用 Gradio 构建各种演示应用。不过，Gradio 还有哪些其他功能呢？\n\n#### 使用 `gr.Blocks` 自定义演示应用\n\nGradio 提供了一种低级的开发方式，通过 `gr.Blocks` 类，您可以设计出布局更加灵活、数据流更富于变化的 Web 应用。`Blocks` 支持多种功能，例如：控制组件在页面中的显示位置、处理多条数据流以及实现更为复杂的交互（例如，输出可以作为其他函数的输入）、根据用户交互动态更新组件的属性或可见性——所有这一切都完全基于 Python 语言来实现。\n\n借助 `gr.Blocks()`，您可以构建出高度定制化且功能强大的应用程序。以广受欢迎的图像生成工具 [Automatic1111 Web UI](https:\u002F\u002Fgithub.com\u002FAUTOMATIC1111\u002Fstable-diffusion-webui) 为例，其正是基于 Gradio 的 Blocks 功能打造而成。在后续的系列文章中，我们将深入探讨 `gr.Blocks` 的更多细节，重点介绍如何利用它来构建各类应用（详见 [使用 Blocks 构建应用](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fblocks-and-event-listeners)）。\n\n#### 使用 `gr.ChatInterface` 构建聊天机器人\n\nGradio 还提供了一个高级别的类——`gr.ChatInterface`，专为创建聊天机器人界面而设计。与 `Interface` 类类似，您只需提供一个函数，Gradio 就会自动为您搭建起一个功能完备的聊天机器人界面。如果您对创建聊天机器人感兴趣，可以直接跳转至我们的专属指南——[使用 `gr.ChatInterface` 创建聊天机器人](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fcreating-a-chatbot-fast)。\n\n#### Gradio 的 Python 与 JavaScript 生态系统\n\n以上便是 Gradio 核心 Python 库的核心内容，但 Gradio 其实远不止于此！它是一个完整的 Python 和 JavaScript 库生态系统，让您能够使用 Python 或 JavaScript 构建机器学习应用，或者以编程方式对这些应用进行查询与操作。以下是 Gradio 生态系统的其他相关组成部分：\n\n* [Gradio Python 客户端](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fgetting-started-with-the-python-client)（`gradio_client`）：通过 Python 程序代码，以编程方式查询任意 Gradio 应用。\n* [Gradio JavaScript 客户端](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fgetting-started-with-the-js-client)（`@gradio\u002Fclient`）：通过 JavaScript 程序代码，以编程方式查询任意 Gradio 应用。\n* [Hugging Face Spaces](https:\u002F\u002Fhuggingface.co\u002Fspaces)：Gradio 应用最热门的托管平台——免费使用！\n* [服务器模式](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fserver-mode)（`gradio.Server`）：借助 Gradio 的后端，构建自定义前端——支持队列、流式处理、MCP、ZeroGPU 以及 Spaces 托管服务。\n\n### 接下来该做什么？\n\n请持续按顺序学习 Gradio 相关知识，通过 Gradio 指南，您将获得详尽的讲解、示例代码以及嵌入式的交互式演示。接下来，我们将深入探讨 `Interface` 类的相关内容（详见 [Interface 类详解](https:\u002F\u002Fwww.gradio.app\u002Fguides\u002Fthe-interface-class)）。\n\n或者，如果您已经掌握了基本知识，并且正寻找特定的功能，也可以查阅更详细的 [技术 API 文档](https:\u002F\u002Fwww.gradio.app\u002Fdocs\u002F)。\n\n### AI 编程技能\n\nGradio 提供了一项“技能”，可为 AI 编程助手（如 Cursor、Claude Code、Codex 等）注入 Gradio 特有的知识，从而帮助它们更高效地构建 Gradio 应用。尤其是在创建自定义 Gradio 组件或进行样式设计时，这项技能尤为实用。只需一条命令，即可为您的编程助手安装 Gradio 技能：\n\n```bash\ngradio skills add --cursor   # 或者 --claude, --codex, --opencode\n```\n\n使用 `--global` 命令，可将其安装于用户级别（适用于所有项目）。您的技能将自动为特定的编程代理所用。\n\n您还可以为某个 **特定的 Gradio Space** 安装技能，该技能可自动生成 API 使用文档（包括 Python、JS、cURL 等格式）：\n\n```bash\ngradio skills add abidlabs\u002Fen2fr --cursor\n```\n\n## 有问题吗？\n\n如果您想报告错误或提出功能建议，请前往 GitHub 上提交问题（[GitHub 问题表单](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fissues\u002Fnew\u002Fchoose)）。如需了解有关使用 Gradio 的通用问题，欢迎随时访问我们的 Discord 服务器（[Discord 服务器链接](https:\u002F\u002Fdiscord.com\u002Finvite\u002FfeTf9x3ZSB)），我们非常乐意为您提供帮助。\n\n如果您喜欢 Gradio，也请在 GitHub 上为我们留下一个 ⭐！\n\n## 开源生态\n\nGradio 依托众多优秀的开源库而构建！\n\n[\u003Cimg src=\"readme_files\u002Fhuggingface_mini.svg\" alt=\"huggingface\" height=40>](https:\u002F\u002Fhuggingface.co)\n[\u003Cimg src=\"readme_files\u002Fpython.svg\" alt=\"python\" height=40>](https:\u002F\u002Fwww.python.org)\n[\u003Cimg src=\"readme_files\u002Ffastapi.svg\" alt=\"fastapi\" height=40>](https:\u002F\u002Ffastapi.tiangolo.com)\n[\u003Cimg src=\"readme_files\u002Fencode.svg\" alt=\"encode\" height=40>](https:\u002F\u002Fwww.encode.io)\n[\u003Cimg src=\"readme_files\u002Fsvelte.svg\" alt=\"svelte\" height=40>](https:\u002F\u002Fsvelte.dev)\n[\u003Cimg src=\"readme_files\u002Fvite.svg\" alt=\"vite\" height=40>](https:\u002F\u002Fvitejs.dev)\n[\u003Cimg src=\"readme_files\u002Fpnpm.svg\" alt=\"pnpm\" height=40>](https:\u002F\u002Fpnpm.io)\n[\u003Cimg src=\"readme_files\u002Ftailwind.svg\" alt=\"tailwind\" height=40>](https:\u002F\u002Ftailwindcss.com)\n[\u003Cimg src=\"readme_files\u002Fstorybook.svg\" alt=\"storybook\" height=40>](https:\u002F\u002Fstorybook.js.org\u002F)\n[\u003Cimg src=\"readme_files\u002Fchromatic.svg\" alt=\"chromatic\" height=40>](https:\u002F\u002Fwww.chromatic.com\u002F)\n\n## 许可证\n\nGradio 采用 Apache License 2.0 许可协议，该协议位于本仓库根目录下的 [LICENSE](LICENSE) 文件中。\n\n## 引用文献\n\n此外，还请参阅论文 _[Gradio: 在真实世界中轻松分享与测试 ML 模型](https:\u002F\u002Farxiv.org\u002Fabs\u002F1906.02569), ICML HILL 2019_，并在您的工作中使用 Gradio 时，务必予以引用。\n\n```\n@article{abid2019gradio,\n  title = {Gradio: 在真实世界中轻松分享与测试 ML 模型},\n  author = {Abid, Abubakar and Abdalla, Ali and Abid, Ali and Khan, Dawood and Alfozan, Abdulrahman and Zou, James},\n  journal = {arXiv preprint arXiv:1906.02569},\n  year = {2019},\n}\n```","# Gradio 快速上手指南\n\nGradio 是一个开源 Python 库，让你只需几行代码即可为机器学习模型、API 或任意 Python 函数构建演示界面或 Web 应用，并轻松分享链接。无需掌握 JavaScript、CSS 或 Web 托管知识。\n\n## 环境准备\n\n- **操作系统**：Windows、macOS 或 Linux\n- **Python 版本**：3.10 或更高（[下载地址](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)）\n- **推荐**：在虚拟环境中安装以避免依赖冲突\n\n## 安装步骤\n\n使用 pip 安装（推荐使用国内镜像源加速）：\n\n```bash\npip install --upgrade gradio -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n> 💡 提示：建议先在虚拟环境中安装。详细安装指南请参考 [官方文档](https:\u002F\u002Fwww.gradio.app\u002Fmain\u002Fguides\u002Finstalling-gradio-in-a-virtual-environment)。\n\n## 基本使用\n\n### 创建第一个 Demo\n\n在任意 Python 环境（如脚本文件、Jupyter Notebook、Google Colab）中运行以下代码：\n\n```python\nimport gradio as gr\n\ndef greet(name, intensity):\n    return \"Hello, \" + name + \"!\" * int(intensity)\n\ndemo = gr.Interface(\n    fn=greet,\n    inputs=[\"text\", \"slider\"],\n    outputs=[\"text\"],\n    api_name=\"predict\"\n)\n\ndemo.launch()\n```\n\n保存为 `app.py` 后，在终端运行：\n\n```bash\npython app.py\n```\n\n应用将在浏览器中打开，地址为：[http:\u002F\u002Flocalhost:7860](http:\u002F\u002Flocalhost:7860)\n\n> 💡 开发提示：使用 `gradio app.py` 替代 `python app.py` 可启用热重载模式，修改代码后自动刷新页面。还可添加 `--vibe` 参数启用自然语言编程辅助功能。\n\n### 核心概念说明\n\n`gr.Interface` 是构建演示的核心类，包含三个关键参数：\n\n- `fn`：要包装的 Python 函数\n- `inputs`：输入组件列表（需与函数参数数量和顺序一致）\n- `outputs`：输出组件列表（需与函数返回值数量一致）\n\nGradio 提供 30+ 内置组件，如 `gr.Textbox()`、`gr.Image()`、`gr.HTML()` 等，可直接用于构建 ML 应用界面。\n\n### 分享你的 Demo\n\n添加 `share=True` 参数即可生成公网可访问链接：\n\n```python\ndemo.launch(share=True)\n```\n\n运行后将获得类似 `https:\u002F\u002Fxxx.gradio.live` 的链接，全球用户均可通过浏览器访问，而计算仍在本地执行。\n\n---\n\n下一步可探索更强大的 `gr.Blocks` 自定义布局、`gr.ChatInterface` 聊天机器人构建，或使用 Gradio 客户端进行程序化调用。完整指南请访问 [Gradio 官方文档](https:\u002F\u002Fgradio.app\u002Fdocs\u002F)。","某初创公司的算法工程师刚训练好一个“医疗影像肺炎检测模型”，急需向非技术背景的医院合作方演示效果以争取试点机会。\n\n### 没有 gradio 时\n- **开发门槛高**：工程师必须临时学习 HTML、CSS 和 JavaScript，或求助前端同事编写交互界面，耗时数天才能做出一个简单的上传页面。\n- **部署流程繁琐**：为了让外网访问，需要配置 Nginx、购买云服务器、设置域名解析和 SSL 证书，运维成本极高且容易出错。\n- **反馈循环慢**：医生只能通过发送图片文件给工程师，由工程师在本地运行代码后口头告知结果，无法实时互动调整参数，沟通效率极低。\n- **演示体验差**：缺乏直观的滑动条或可视化热力图，合作方难以理解模型是如何判断病灶区域的，信任感建立困难。\n\n### 使用 gradio 后\n- **极速构建界面**：工程师仅用 20 行 Python 代码就定义了图片输入和标签输出组件，自动生成了包含上传、推理和结果展示功能的完整网页。\n- **一键共享演示**：利用 gradio 内置的 `share=True` 功能，瞬间生成一个可公开访问的临时链接，无需任何服务器配置即可发给医院专家测试。\n- **实时交互验证**：医生直接在网页上传 CT 片，系统秒级返回检测结果及置信度，甚至能通过滑块调整阈值，即时观察模型敏感度变化。\n- **专注核心逻辑**：团队无需关心前端样式或后端部署，将所有精力集中在优化模型算法本身，将原本一周的演示准备期缩短至一下午。\n\ngradio 让算法工程师能跳过繁琐的全栈开发流程，直接将 Python 模型转化为可交互的 Web 应用，极大地加速了从实验室原型到实际业务价值的转化过程。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgradio-app_gradio_e28d7b2b.gif","gradio-app","Gradio","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgradio-app_2a90de03.png","Delightfully easy-to-use open-source tools that make machine learning easier and more accessible",null,"admin@gradio.app","www.gradio.app","https:\u002F\u002Fgithub.com\u002Fgradio-app",[84,88,92,96,100,104,108,112,116,120],{"name":85,"color":86,"percentage":87},"Python","#3572A5",49.8,{"name":89,"color":90,"percentage":91},"Svelte","#ff3e00",23.8,{"name":93,"color":94,"percentage":95},"TypeScript","#3178c6",20.2,{"name":97,"color":98,"percentage":99},"mdsvex","#5f9ea0",3.1,{"name":101,"color":102,"percentage":103},"CSS","#663399",1.3,{"name":105,"color":106,"percentage":107},"JavaScript","#f1e05a",0.9,{"name":109,"color":110,"percentage":111},"Jupyter Notebook","#DA5B0B",0.4,{"name":113,"color":114,"percentage":115},"HTML","#e34c26",0.2,{"name":117,"color":118,"percentage":119},"SCSS","#c6538c",0.1,{"name":121,"color":122,"percentage":119},"Shell","#89e051",42259,3366,"2026-04-05T23:32:08","Apache-2.0",1,"Linux, macOS, Windows","未说明",{"notes":131,"python":132,"dependencies":133},"Gradio 是一个纯 Python 包，用于快速构建机器学习 Web 应用，无需 JavaScript、CSS 或 Web 托管经验。建议在虚拟环境中安装。支持热重载模式（使用 'gradio app.py' 运行）和 Vibe 模式（使用 '--vibe' 标志）。可通过设置 share=True 生成公网链接分享演示。核心组件包括 gr.Interface（高层接口）、gr.Blocks（自定义布局）和 gr.ChatInterface（聊天机器人）。拥有独立的 Python 和 JavaScript 客户端库，并可与 Hugging Face Spaces 集成进行免费托管。","3.10+",[],[54,14,51,13],[136,137,138,139,140,141,142,143,144,145,67,146,147,148],"machine-learning","models","ui","ui-components","interface","python","data-science","data-visualization","deep-learning","data-analysis","gradio-interface","python-notebook","deploy",25,"2026-03-27T02:49:30.150509","2026-04-06T08:45:17.908364",[153,158,163,168,173,177],{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},6505,"在 EC2 或云端部署时，使用 --share 参数生成的链接几小时后失效怎么办？","这通常是因为会话因请求过多而崩溃。虽然有人建议设置 `live=True` 来自动刷新界面，但这并不总是有效。更可靠的解决方案是检查是否因负载过高导致会话中断，尝试仅运行相关代码单元格或优化请求频率。如果是长期服务，建议使用正式的部署方式（如 Docker、Kubernetes）而不是临时的 share 链接。","https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fissues\u002F3060",{"id":159,"question_zh":160,"answer_zh":161,"source_url":162},6506,"如何在 Gradio 应用中集成 Google 身份验证？","Gradio 原生不直接提供 Google 登录组件，但可以通过前端 JavaScript 结合 Firebase 实现。基本流程是：1. 在 HTML 模板中引入 Firebase SDK；2. 配置 `apiKey` 和 `authDomain`；3. 使用 `signInWithEmailAndPassword` 或 Google Provider 进行登录；4. 通过 `onAuthStateChanged` 监听登录状态。社区提供了一个完整的示例项目可供参考：https:\u002F\u002Fgithub.com\u002Faisurfer\u002Fgradio_app_auth。对于纯 Python 开发者，也可以考虑在后端通过 OAuth 库处理验证逻辑。","https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fissues\u002F2790",{"id":164,"question_zh":165,"answer_zh":166,"source_url":167},6507,"通过代理或 Ingress 访问 Gradio 应用时出现 '404 Session Not Found' 错误如何解决？","这是因为反向代理（如 Nginx Ingress）未正确维持会话粘性（Session Affinity），导致长轮询请求被分发到不同后端实例。解决方法是在 Ingress 配置中添加会话粘性注解，例如：\n```yaml\nannotations:\n  nginx.ingress.kubernetes.io\u002Faffinity: \"cookie\"\n  nginx.ingress.kubernetes.io\u002Faffinity-mode: \"balanced\"\n  nginx.ingress.kubernetes.io\u002Fsession-cookie-name: \"INGRESSCOOKIE\"\n  nginx.ingress.kubernetes.io\u002Fsession-cookie-expires: \"172800\"\n  nginx.ingress.kubernetes.io\u002Fsession-cookie-max-age: \"172800\"\n```\n启用后，同一用户的请求将被路由到同一 Pod，从而解决会话丢失问题。","https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fissues\u002F6920",{"id":169,"question_zh":170,"answer_zh":171,"source_url":172},6508,"将 Gradio 应用部署到服务器或容器环境后，UI 样式丢失（CSS 404 错误）怎么办？","当 Gradio 挂载在 FastAPI 下并位于反向代理或子路径中时，静态资源路径可能解析错误。解决方案是在 `mount_gradio_app` 时显式指定 `root_path` 参数，使其与实际访问路径一致。示例代码如下：\n```python\napp = FastAPI()\nblocks = interface.render()\ngr.mount_gradio_app(app, blocks, path=\"\u002Fgradio\", root_path=\"\u002Fgradio\")\n```\n确保 `root_path` 与 URL 中的前缀匹配，这样 CSS 和 JS 文件才能正确加载。","https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fissues\u002F3472",{"id":174,"question_zh":175,"answer_zh":176,"source_url":167},6509,"如何在 Kubernetes (Minikube) 环境中正确部署 Gradio 以避免连接中断？","在 Kubernetes 环境中，必须配置 Ingress 的会话粘性（Session Affinity），否则 Gradio 的 WebSocket 或长轮询连接会在不同 Pod 间切换导致断开。需要在 Ingress 资源中添加以下注解：\n- `nginx.ingress.kubernetes.io\u002Faffinity: \"cookie\"`\n- `nginx.ingress.kubernetes.io\u002Fsession-cookie-name: \"INGRESSCOOKIE\"`\n- `nginx.ingress.kubernetes.io\u002Fsession-cookie-expires: \"172800\"`\n这将确保用户会话始终绑定到同一个后端 Pod。",{"id":178,"question_zh":179,"answer_zh":180,"source_url":172},6510,"Gradio 与 FastAPI 结合部署时，如何处理根路径（root_path）配置问题？","当 Gradio 应用作为 FastAPI 的子应用运行在反向代理后时，必须正确设置 `root_path` 以修复静态文件加载失败的问题。在使用 `gr.mount_gradio_app` 时，需传入 `root_path` 参数，其值应与外部访问的路径前缀相同。例如，如果通过 `example.com\u002Fgradio` 访问，则代码应为：`gr.mount_gradio_app(app, demo, path=\"\u002Fgradio\", root_path=\"\u002Fgradio\")`。这对于部署在 Railway、Docker 或 Nginx 后的应用尤为关键。",[182,187,192,196,200,204,209,213,217,221,226,230,235,240,244,249,254,258,263,267],{"id":183,"version":184,"summary_zh":185,"released_at":186},115790,"@gradio\u002Fsimpletextbox@0.3.39","### Dependency updates\n\n-   @gradio\u002Futils@0.12.2\n-   @gradio\u002Fatoms@0.23.0\n-   @gradio\u002Fstatustracker@0.13.1\n","2026-04-03T01:04:12",{"id":188,"version":189,"summary_zh":190,"released_at":191},115791,"@gradio\u002Fsimpleimage@0.9.8","### Dependency updates\n\n-   @gradio\u002Futils@0.12.2\n-   @gradio\u002Fatoms@0.23.0\n-   @gradio\u002Fstatustracker@0.13.1\n-   @gradio\u002Fupload@0.17.8\n","2026-04-03T01:03:57",{"id":193,"version":194,"summary_zh":185,"released_at":195},115792,"@gradio\u002Fsimpledropdown@0.3.37","2026-04-03T01:03:54",{"id":197,"version":198,"summary_zh":185,"released_at":199},115793,"@gradio\u002Fsidebar@0.2.6","2026-04-03T01:03:51",{"id":201,"version":202,"summary_zh":185,"released_at":203},115794,"@gradio\u002Fradio@0.10.1","2026-04-03T01:03:48",{"id":205,"version":206,"summary_zh":207,"released_at":208},115795,"@gradio\u002Fpreview@0.16.2","### Fixes\n\n-   [#13182](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13182) [`2e36802`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F2e36802a04251315454c3872aa888bbf984ae4c1) - fix: make example field optional in cc build.  Thanks @xr843!\n","2026-04-03T01:03:45",{"id":210,"version":211,"summary_zh":185,"released_at":212},115796,"@gradio\u002Fplot@0.10.7","2026-04-03T01:03:42",{"id":214,"version":215,"summary_zh":185,"released_at":216},115797,"@gradio\u002Fparamviewer@0.9.7","2026-04-03T01:03:39",{"id":218,"version":219,"summary_zh":185,"released_at":220},115798,"@gradio\u002Fnumber@0.8.6","2026-04-03T01:03:36",{"id":222,"version":223,"summary_zh":224,"released_at":225},115799,"@gradio\u002Fnavbar@0.2.9","### Dependency updates\n\n-   @gradio\u002Futils@0.12.2\n-   @gradio\u002Fatoms@0.23.0\n-   @gradio\u002Fstatustracker@0.13.1\n-   @gradio\u002Fcore@1.4.2\n","2026-04-03T01:03:22",{"id":227,"version":228,"summary_zh":185,"released_at":229},115800,"@gradio\u002Fnativeplot@0.10.5","2026-04-03T01:03:30",{"id":231,"version":232,"summary_zh":233,"released_at":234},115781,"gradio@6.11.0","### Features\n\n-   [#13151](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13151) [`c13daab`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fc13daab68aa40cb58f2c643a650b5db48e986935) - add test utils.  Thanks @pngwn!\n-   [#13167](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13167) [`a4e1c92`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fa4e1c92c11e05bee332ff69e19b533fbd9abc840) - Audio and Video unit tests.  Thanks @freddyaboulton!\n-   [#13150](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13150) [`9487b60`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F9487b60670f6532eaccb3251d15f5505fa23d4e3) - migrate dataframe to svelte 5.  Thanks @pngwn!\n-   [#13122](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13122) [`64828b0`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F64828b08d5be4fdde8a73932b3f288c073ec49bd) - Add Image Unit Tests.  Thanks @freddyaboulton!\n-   [#13159](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13159) [`7aec6bd`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F7aec6bd41b40f963e62f5fc0e22382c366078dae) - Add Starlette 1.0 compatibility by relaxing version constraint.  Thanks @xr843!\n-   [#13168](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13168) [`a8e0cc6`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fa8e0cc66b0c5a9032e8c70de320419a724e674e1) - Run Pre\u002FPost processing for components in a separate thread.  Thanks @freddyaboulton!\n\n### Fixes\n\n-   [#13048](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13048) [`a5d4096`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fa5d40965bba21a832da522127048926b71c1a6dd) - Fix Tab Interactive Bug.  Thanks @freddyaboulton!\n-   [#13172](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13172) [`03a9d4c`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F03a9d4c99f3c9466e4fc162d02800850ed67a29e) - fix: prevent [object Object] when label matches a nested i18n key.  Thanks @mango766!\n-   [#13165](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13165) [`1a0e277`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F1a0e2770067789ba6ec5646e473e1df183cd7183) - Use test utils.  Thanks @freddyaboulton!\n-   [#13161](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13161) [`0a0378d`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F0a0378dee463fb10e5a95685d595801171cf641b) - Fix get_type_hints NameError on TYPE_CHECKING imports.  Thanks @hysts!\n-   [#13164](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13164) [`beb4b7f`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fbeb4b7f2124cacea17db2b3fe91cd52ccb2ee106) - Cancel HEARTBEAT Task.  Thanks @freddyaboulton!\n-   [#12981](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F12981) [`8bc7513`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F8bc75137b24ba8a8571b49b9b006741819c0518b) - Fix ImageEditor brush preview dead area on vertical images.  Thanks @MaxwellCalkin!\n-   [#13046](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13046) [`b372228`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fb3722285163dcee97fe236e87d6ef98cee6be441) - Avoid Polling in SSE Route To Reduce Overhead.  Thanks @freddyaboulton!\n-   [#13163](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13163) [`1c4ce3e`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F1c4ce3e64480f65a6531f33d38aff2efdeb9632a) - Close iterators in \u002Fcancel endpoint.  Thanks @hysts!\n-   [#13155](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13155) [`59421d1`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F59421d13fbefb493fc5d0b4c5fc48ff30ebb3ef3) - fix(group): read visibility from shared props to fix dynamic toggling.  Thanks @viditkbhatnagar!\n-   [#13041](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13041) [`835e4bd`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F835e4bd1adcaf5716283fa379e909f916a032b8a) - Reduce load times of all components.  Thanks @dawoodkhan82!\n-   [#13178](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13178) [`d815881`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fd815881739689f45f5387ea52cc92e2cddf8adcf) - fix(gallery): prevent incorrect selected_index clamping on image append.  Thanks @Gopesh111!\n-   [#13134](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13134) [`75f8dce`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F75f8dceb679b505c8887f0a3c3b9fee98a931db9) - Fix sync generator cancel ValueError.  Thanks @hysts!\n-   [#13183](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13183) [`1bf9bae`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002F1bf9bae723475ad664f7d3d32596856c4881e63d) - Ensure the Accordion's `expand` and `collapse` events fire when toggled from python.  Thanks @pngwn!\n","2026-04-03T01:04:27",{"id":236,"version":237,"summary_zh":238,"released_at":239},115782,"@gradio\u002Fvideo@0.20.6","### Features\n\n-   [#13167](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13167) [`a4e1c92`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fa4e1c92c11e05bee332ff69e19b533fbd9abc840) - Audio and Video unit tests.  Thanks @freddyaboulton!\n\n### Dependency updates\n\n-   @gradio\u002Futils@0.12.2\n-   @gradio\u002Fatoms@0.23.0\n-   @gradio\u002Fstatustracker@0.13.1\n-   @gradio\u002Fupload@0.17.8\n-   @gradio\u002Fimage@0.26.1\n","2026-04-03T01:04:24",{"id":241,"version":242,"summary_zh":185,"released_at":243},115783,"@gradio\u002Fvibeeditor@0.3.8","2026-04-03T01:04:21",{"id":245,"version":246,"summary_zh":247,"released_at":248},115784,"@gradio\u002Futils@0.12.2","### Features\n\n-   [#13167](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13167) [`a4e1c92`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fa4e1c92c11e05bee332ff69e19b533fbd9abc840) - Audio and Video unit tests.  Thanks @freddyaboulton!\n","2026-04-03T01:04:15",{"id":250,"version":251,"summary_zh":252,"released_at":253},115785,"@gradio\u002Fupload@0.17.8","### Dependency updates\n\n-   @gradio\u002Futils@0.12.2\n-   @gradio\u002Fatoms@0.23.0\n","2026-04-03T01:04:18",{"id":255,"version":256,"summary_zh":185,"released_at":257},115786,"@gradio\u002Ftextbox@0.13.7","2026-04-03T01:04:06",{"id":259,"version":260,"summary_zh":261,"released_at":262},115787,"@gradio\u002Ftabs@0.5.9","### Fixes\n\n-   [#13048](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fpull\u002F13048) [`a5d4096`](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio\u002Fcommit\u002Fa5d40965bba21a832da522127048926b71c1a6dd) - Fix Tab Interactive Bug.  Thanks @freddyaboulton!\n\n### Dependency updates\n\n-   @gradio\u002Futils@0.12.2\n","2026-04-03T01:04:00",{"id":264,"version":265,"summary_zh":252,"released_at":266},115788,"@gradio\u002Fstatustracker@0.13.1","2026-04-03T01:04:03",{"id":268,"version":269,"summary_zh":185,"released_at":270},115789,"@gradio\u002Fslider@0.7.9","2026-04-03T01:04:09"]