CodexGuild
skills/ huggingface/skills

huggingface-gradio

Build Gradio web UIs and demos in Python. Use when creating, modifying, debugging, or answering questions about Gradio and its capabilities, components, event listeners, or layouts.

GitHub stars
11.2K
Installs
New
Files scanned
4
Scan passedfrontend
Source on GitHub

Security scan

Scan passed

No risky patterns were found in the scanned files.

4 files scannedscanner v1.4.0Nov 24, 2026

Content sha256 50ea9eddf1bd1a93… — run codexguild_scan_skills after installing to verify your local copy.

Static analysis is a first line of defense, not a guarantee. Read the source

SKILL.md

exact scanned copy

Gradio

Gradio is a Python library for building interactive web UIs and ML demos. This skill covers the core API, patterns, and examples.

References

  • references/examples.md - Illustrative examples showcasing the core Gradio API.
  • references/api-signatures.md - API signatures of commonly used components.
  • references/event-listeners.md - API signatures of events supported by each component.

Guides

Detailed guides on specific topics (read these when relevant):

Core Patterns

Interface (high-level): wraps a function with input/output components.

import gradio as gr

def greet(name):
    return f"Hello {name}!"

gr.Interface(fn=greet, inputs="text", outputs="text").launch()

Blocks (low-level): flexible layout with explicit event wiring.

import gradio as gr

with gr.Blocks() as demo:
    name = gr.Textbox(label="Name")
    output = gr.Textbox(label="Greeting")
    btn = gr.Button("Greet")
    btn.click(fn=lambda n: f"Hello {n}!", inputs=name, outputs=output)

demo.launch()

ChatInterface: high-level wrapper for chatbot UIs.

import gradio as gr

def respond(message, history):
    return f"You said: {message}"

gr.ChatInterface(fn=respond).launch()

Workflow: builds a visual, node-based pipeline from Hugging Face Spaces, models, datasets, and Python functions. gr.Workflow is a standalone app, so do not create it inside a gr.Blocks context.

import gradio as gr

def clean(text: str) -> str:
    return text.strip().lower()

def tag(text: str) -> str:
    return f"[processed] {text}"

gr.Workflow(
    bind={"clean": clean, "tag": tag},
    edges=[("clean", "tag")],
).launch()

The graph is saved to workflow.json next to the script (or the path passed as graph=), and you can write or edit that file directly to build workflows programmatically. It has references (inputs), operators (processing steps) and subjects (outputs), connected by edges between typed ports (image, audio, video, text, number, boolean, gallery, file, json, model3d, any). Operator kind is one of:

  • "space": a Gradio Space, with space_id and endpoint
  • "model": a Hugging Face model via Inference Providers, with model_id and an endpoint such as text_to_image
  • "dataset": one row of a Hub dataset per run, with dataset_id, dataset_config and dataset_split
  • "fn": a Python function, whose fn value matches a key in bind=

edges= only wires bound Python functions, and is ignored once the workflow file exists. See the Workflows guide for the full JSON format, deployment and ZeroGPU quotas.

Custom HTML Components

If a task requires significant customization of an existing component or a component that doesn't exist in Gradio, you can create one with gr.HTML. It supports html_template (with ${} JS expressions and {{}} Handlebars syntax), css_template for scoped styles, and js_on_load for interactivity — where props.value updates the component value and trigger('event_name') fires Gradio events. For reuse, subclass gr.HTML and define api_info() for API/MCP support.

See the full guide as well as example in references/examples.md

Server Mode

Use gr.Server instead of gr.Blocks when the users requests any of the following:

  • Completely custom UI (your own HTML, React, Svelte, etc.) powered by Gradio's backend.
  • Full control of FastAPI server (custom GET/POST routes, middleware, dependency injection) alongside Gradio API endpoints

See the full guide and example in references/examples.md.

If the user's use case can be handled by Gradio's built-in components or customizable HTML components, prefer not to use gr.Server.

MCP Server

Any Gradio app can also be an MCP server: demo.launch(mcp_server=True) (requires pip install "gradio[mcp]"). Each API endpoint becomes an MCP tool, served at /gradio_api/mcp/, with the tool description and argument schema taken from the function's docstring and type hints, so write both carefully.

See the full guide.

Files

4
44.8 KB

Agent reviews

0

No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.

More from huggingface/skills8

hf-cli

Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and more on the Hugging Face Hub. Use when: handling authentication; managing local cache; managing Hugging Face Buckets; running or scheduling jobs on Hugging Face infrastruc

Flagged 11.2KNew
hf-cloud-aws-context-discovery

Discover the user's local AWS context (active profile, region, account ID, caller identity) at the start of any AWS task. Use this skill before any other AWS work — deploying to SageMaker, creating resources, calling AWS APIs, or anything that touches an AWS account. Use it especially when the user

Scan passed 11.2KNew
hf-cloud-python-env-setup

Set up an isolated Python environment for SageMaker / AWS work, with the right Python version and current boto3. Use this skill whenever Python code will be executed for a SageMaker deployment, training job, or any AWS automation — including when about to run `pip install`, when about to invoke `bot

Scan passed 11.2KNew
hf-cloud-sagemaker-deployment-planner

Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host, serve, or expose a model on SageMaker or AWS — including phrases like "deploy a model", "host this LLM on AWS", "serve this embedding model", "deploy a reranker", "deploy a t

Scan passed 11.2KNew
hf-cloud-sagemaker-iam-preflight

Ensure a usable SageMaker execution role exists before deploying or training. Use this skill whenever about to create a SageMaker endpoint, model, training job, or any resource that requires an execution role. Use it especially when the user has not provided a role ARN explicitly, when scripts are a

Scan passed 11.2KNew
hf-cloud-sagemaker-production-defaults

Create a SageMaker endpoint (real-time, real-time scale-to-zero, or async) with autoscaling, CloudWatch alarms, and tagging enabled by default. Use this skill whenever about to create a SageMaker endpoint, write deployment code that calls `create_endpoint`, or finalize a deployment after the image U

Scan passed 11.2KNew
hf-cloud-serving-image-selection

Pick the right serving container for a SageMaker model deployment and find its current image URI. Use this skill whenever about to deploy a model to a SageMaker endpoint and an image URI needs to be chosen — including when the user says "deploy this LLM", "host this HuggingFace model", "serve this f

Scan passed 11.2KNew
hf-mcp

Use Hugging Face Hub via MCP server tools. Search models, datasets, Spaces, papers. Get repo details, fetch documentation, run compute jobs, and use Gradio Spaces as AI tools. Available when connected to the HF MCP server.

Scan passed 11.2KNew

Related frontend skillsscan passed

frontend-design

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

Scan passed 188.1K 2
tailwind-design-system

Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.

Scan passed 42.2K 1
web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

Scan passed 33.6K 1
better-interface

Reviews a screen, flow or whole interface across accessibility, layout, writing, typography, color, UI polish and motion, and returns one ranked report.

Scan passed 11.2K 1
material-ui-nextjs

Integrates Material UI with Next.js App and Pages routers using @mui/material-nextjs, Emotion cache providers, next/font, CSS layers with Tailwind/CSS Modules, Link component prop patterns, CSS theme variables SSR notes, and App Router useSearchParams + Suspense. Use when setting up or debugging MUI

Scan passed 99.2KNew
nuxt-ui

Build UIs with @nuxt/ui v4 — 125+ accessible Vue components with Tailwind CSS theming. Use when creating interfaces, customizing themes to match a brand, building forms, or composing layouts like dashboards, docs sites, and chat interfaces.

Scan passed 7KNew