Gradio.Net 0.6.0

dotnet add package Gradio.Net --version 0.6.0
                    
NuGet\Install-Package Gradio.Net -Version 0.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Gradio.Net" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gradio.Net" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Gradio.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Gradio.Net --version 0.6.0
                    
#r "nuget: Gradio.Net, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Gradio.Net@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Gradio.Net&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Gradio.Net&version=0.6.0
                    
Install as a Cake Tool

Gradio.NET: Build Machine Learning Web Apps — in .NET main NuGet

English | 简体中文 | 日本語

For more information, see the Guides.

Gradio for .NET – a port of Gradio, 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. No JavaScript, CSS, or web hosting experience needed!

demo

It just takes a few lines of .NET code to create a beautiful demo like the one above, so let's get started 💫

Building Your First Demo

    1. Create an ASP.NET Core Web API project.
    1. Install NuGet package Gradio.Net.
    1. Enter the sample code in Program.cs:
Using gr.Interface (quickest way)
using Gradio.Net;

string Greet(string name, double intensity)
{
    return "Hello, " + name + "!" + new string('!', (int)intensity - 1);
}

var demo = gr.Interface(
    fn: Greet,
    inputs: new object[] { "text", gr.Slider(value: 2, minimum: 1, maximum: 10, step: 1) },
    outputs: new[] { "text" }
);

await demo.Launch();

gr.Interface wraps any C# function into a UI in seconds — no layout code required.

Using gr.Blocks (full layout control)
using Gradio.Net;

await (await CreateBlocks()).Launch();

async Task<Blocks> CreateBlocks()
{
    using (var blocks = gr.Blocks())
    {
        gr.Markdown("Start typing below and then click **Run** to see the output.");
        Textbox input, output;
        using (gr.Row())
        {
            input = gr.Textbox(placeholder: "What is your name?");
            output = gr.Textbox();
        }
        var btn = gr.Button("Run");
        btn.Click(
            fn: new Func<string, (string, string)>(name => ($"Welcome to Gradio.Net, {name}!", "")),
            inputs: new[] { input },
            outputs: new[] { output, input });

        return blocks;
    }
}

That's All 🎉🎉🎉

Integrating into an existing ASP.NET Core project

Use the AddGradio and UseGradio extension methods:

using Gradio.Net;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGradio();

var app = builder.Build();

app.UseGradio(await CreateBlocks());

app.Run();

async Task<Blocks> CreateBlocks()
{
    using (var blocks = gr.Blocks())
    {
        gr.Markdown("# My Gradio App");
        Textbox input, output;
        using (gr.Row())
        {
            input = gr.Textbox(placeholder: "What is your name?");
            output = gr.Textbox();
        }
        var btn = gr.Button("Run");
        btn.Click(
            fn: new Func<string, (string, string)>(name => ($"Welcome to Gradio.Net, {name}!", "")),
            inputs: new[] { input },
            outputs: new[] { output, input });

        return blocks;
    }
}

You can also use gr.Interface with app.UseGradio:

using Gradio.Net;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGradio();

var app = builder.Build();

string Greet(string name, double intensity)
{
    return "Hello, " + name + "!" + new string('!', (int)intensity - 1);
}

var demo = gr.Interface(
    fn: Greet,
    inputs: new object[] { "text", gr.Slider(value: 2, minimum: 1, maximum: 10, step: 1) },
    outputs: new[] { "text" }
);

app.UseGradio(await demo.BuildBlocks());

app.Run();

Demos

Source Code Demo Image
Layout image
Form image
Media image
Chatbot image
Progress image
Theme image
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 48 7/19/2026