![]() |
VOOZH | about |
dotnet add package ElBruno.HuggingFace.Downloader --version 1.1.0
NuGet\Install-Package ElBruno.HuggingFace.Downloader -Version 1.1.0
<PackageReference Include="ElBruno.HuggingFace.Downloader" Version="1.1.0" />
<PackageVersion Include="ElBruno.HuggingFace.Downloader" Version="1.1.0" />Directory.Packages.props
<PackageReference Include="ElBruno.HuggingFace.Downloader" />Project file
paket add ElBruno.HuggingFace.Downloader --version 1.1.0
#r "nuget: ElBruno.HuggingFace.Downloader, 1.1.0"
#:package ElBruno.HuggingFace.Downloader@1.1.0
#addin nuget:?package=ElBruno.HuggingFace.Downloader&version=1.1.0Install as a Cake Addin
#tool nuget:?package=ElBruno.HuggingFace.Downloader&version=1.1.0Install as a Cake Tool
๐ NuGet
๐ Build Status
๐ GitHub stars
๐ Twitter Follow
A .NET library and CLI tool to download files (ONNX models, tokenizers, voice presets, etc.) from Hugging Face Hub repositories with progress reporting, caching, and authentication support.
IServiceCollection extension methodsdotnet add package ElBruno.HuggingFace.Downloader
dotnet tool install -g ElBruno.HuggingFace.Downloader.Cli
Once installed, use the hfdownload command:
# Download model files
hfdownload download sentence-transformers/all-MiniLM-L6-v2 onnx/model.onnx tokenizer.json
# Check if files exist locally
hfdownload check sentence-transformers/all-MiniLM-L6-v2 onnx/model.onnx tokenizer.json
# List cached models
hfdownload list
# Delete a cached model
hfdownload delete sentence-transformers/all-MiniLM-L6-v2
# See all commands
hfdownload --help
See the full for all commands and options.
using ElBruno.HuggingFace;
using var downloader = new HuggingFaceDownloader();
await downloader.DownloadFilesAsync(new DownloadRequest
{
RepoId = "sentence-transformers/all-MiniLM-L6-v2",
LocalDirectory = "./models/miniLM",
RequiredFiles = ["onnx/model.onnx", "tokenizer.json"],
OptionalFiles = ["tokenizer_config.json", "vocab.txt"]
});
bool ready = downloader.AreFilesAvailable(
["onnx/model.onnx", "tokenizer.json"],
"./models/miniLM");
if (!ready)
{
var missing = downloader.GetMissingFiles(
["onnx/model.onnx", "tokenizer.json"],
"./models/miniLM");
Console.WriteLine($"Missing {missing.Count} files");
}
var progress = new Progress<DownloadProgress>(p =>
{
if (p.Stage == DownloadStage.Downloading)
Console.Write($"\rโฌ๏ธ [{p.CurrentFile}] {p.PercentComplete:F0}%");
else
Console.WriteLine($"{p.Stage}: {p.Message}");
});
await downloader.DownloadFilesAsync(new DownloadRequest
{
RepoId = "sentence-transformers/all-MiniLM-L6-v2",
LocalDirectory = "./models/miniLM",
RequiredFiles = ["onnx/model.onnx", "tokenizer.json"],
Progress = progress
});
Set the HF_TOKEN environment variable, or pass it explicitly:
var downloader = new HuggingFaceDownloader(new HuggingFaceDownloaderOptions
{
AuthToken = "hf_your_token_here"
});
builder.Services.AddHuggingFaceDownloader(options =>
{
options.Timeout = TimeSpan.FromMinutes(60);
});
// Then inject HuggingFaceDownloader in your services
public class MyModelService(HuggingFaceDownloader downloader)
{
public async Task EnsureModelAsync()
{
await downloader.DownloadFilesAsync(new DownloadRequest
{
RepoId = "my-org/my-model",
LocalDirectory = DefaultPathHelper.GetDefaultCacheDirectory("MyApp"),
RequiredFiles = ["model.onnx", "tokenizer.json"]
});
}
}
| Topic | Description |
|---|---|
| Installation, all usage examples, and setup | |
| Complete CLI command reference | |
| Complete class and method documentation | |
| Design decisions, data flow, and project structure | |
| NuGet publishing with GitHub Actions |
git clone https://github.com/elbruno/ElBruno.HuggingFace.Downloader.git
cd ElBruno.HuggingFace.Downloader
dotnet build ElBruno.HuggingFace.Downloader.slnx
dotnet test ElBruno.HuggingFace.Downloader.slnx
Contributions are welcome! Please:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License โ see the file for details.
Hi! I'm ElBruno ๐งก, a passionate developer and content creator exploring AI, .NET, and modern development practices.
Made with โค๏ธ by ElBruno
If you like this project, consider following my work across platforms:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on ElBruno.HuggingFace.Downloader:
| Package | Downloads |
|---|---|
|
ElBruno.LocalEmbeddings
Local embedding generation using Microsoft.Extensions.AI and ONNX Runtime |
|
|
ElBruno.Text2Image
A .NET library for local text-to-image generation using Stable Diffusion and ONNX Runtime. Supports multiple models (SD 1.5, LCM Dreamshaper) with automatic model download from HuggingFace and native C# inference โ no Python dependency. |
|
|
ElBruno.QwenTTS
Run Qwen3-TTS text-to-speech locally from C# using ONNX Runtime. Models download automatically from HuggingFace on first run. |
|
|
ElBruno.LocalLLMs
Local LLM chat completions using Microsoft.Extensions.AI and ONNX Runtime GenAI. IChatClient implementation for running LLMs locally. |
|
|
ElBruno.VibeVoiceTTS
A .NET library for VibeVoice text-to-speech using ONNX Runtime. Supports automatic model download from HuggingFace, voice presets, and native C# inference with no Python dependency. |
This package is not used by any popular GitHub repositories.