Gradio.Net
0.6.0
dotnet add package Gradio.Net --version 0.6.0
NuGet\Install-Package Gradio.Net -Version 0.6.0
<PackageReference Include="Gradio.Net" Version="0.6.0" />
<PackageVersion Include="Gradio.Net" Version="0.6.0" />
<PackageReference Include="Gradio.Net" />
paket add Gradio.Net --version 0.6.0
#r "nuget: Gradio.Net, 0.6.0"
#:package Gradio.Net@0.6.0
#addin nuget:?package=Gradio.Net&version=0.6.0
#tool nuget:?package=Gradio.Net&version=0.6.0
Gradio.NET: Build Machine Learning Web Apps — in .NET

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!
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
-
- Create an ASP.NET Core Web API project.
-
- Install NuGet package Gradio.Net.
-
- Enter the sample code in
Program.cs:
- Enter the sample code in
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 | |
| Form | |
| Media | |
| Chatbot | |
| Progress | |
| Theme |
| Product | Versions 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. |
-
net10.0
- BouncyCastle.Cryptography (>= 2.2.1)
- SixLabors.ImageSharp (>= 3.1.12)
- SixLabors.ImageSharp.Drawing (>= 2.1.7)
-
net8.0
- BouncyCastle.Cryptography (>= 2.2.1)
- SixLabors.ImageSharp (>= 3.1.12)
- SixLabors.ImageSharp.Drawing (>= 2.1.7)
-
net9.0
- BouncyCastle.Cryptography (>= 2.2.1)
- SixLabors.ImageSharp (>= 3.1.12)
- SixLabors.ImageSharp.Drawing (>= 2.1.7)
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 |
See https://github.com/feiyun0112/Gradio.Net/blob/main/CHANGELOG.md for release history.