Onnxify.HuggingFace 0.3.9

dotnet add package Onnxify.HuggingFace --version 0.3.9
                    
NuGet\Install-Package Onnxify.HuggingFace -Version 0.3.9
                    
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="Onnxify.HuggingFace" Version="0.3.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Onnxify.HuggingFace" Version="0.3.9" />
                    
Directory.Packages.props
<PackageReference Include="Onnxify.HuggingFace" />
                    
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 Onnxify.HuggingFace --version 0.3.9
                    
#r "nuget: Onnxify.HuggingFace, 0.3.9"
                    
#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 Onnxify.HuggingFace@0.3.9
                    
#: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=Onnxify.HuggingFace&version=0.3.9
                    
Install as a Cake Addin
#tool nuget:?package=Onnxify.HuggingFace&version=0.3.9
                    
Install as a Cake Tool

Warning This package is currently in active development and research. Its public API is unstable and may change radically in future versions.

Onnxify.HuggingFace

Onnxify.HuggingFace downloads model repository contents from Hugging Face into a local directory. It is intended for ONNX model workflows where you want to fetch only the files needed for a specific runtime variant, such as bf16, instead of cloning or downloading the entire repository.

Install

dotnet add package Onnxify.HuggingFace

What It Provides

  • Download all files listed by a Hugging Face model repository.
  • Preserve repository-relative paths in the target directory.
  • Restrict downloads with include and exclude path filters.
  • Track download progress through a callback or IProgress<HuggingFaceDownloadProgress>.
  • Use a revision and optional Hugging Face access token.
  • Avoid writing files outside the target directory when repository paths are malformed.

Basic Usage

using Onnxify.HuggingFace;

var client = new HuggingFaceClient();

var result = await client.DownloadRepositoryAsync(
    repositoryId: "onnx-community/gemma-4-E2B-it-ONNX",
    targetDirectoryPath: "models/gemma-fp16",
    options: new HuggingFaceDownloadOptions
    {
        Revision = "main",
        IncludePath = path =>
            path.Contains("fp16", StringComparison.OrdinalIgnoreCase)
            || path.EndsWith(".json", StringComparison.OrdinalIgnoreCase)
            || path.EndsWith(".model", StringComparison.OrdinalIgnoreCase),
        ExcludePath = path => path.EndsWith(".md5", StringComparison.OrdinalIgnoreCase),
        ProgressCallback = progress =>
        {
            if (progress.Completed)
            {
                Console.WriteLine($"Downloaded {progress.FileIndex}/{progress.FileCount}: {progress.RepositoryPath}");
            }
        },
        Overwrite = true,
    }
);

Console.WriteLine($"Downloaded files: {result.DownloadedFileCount}");

Authentication

For private or gated repositories, pass an access token:

var result = await client.DownloadRepositoryAsync(
    "owner/private-model",
    "models/private-model",
    new HuggingFaceDownloadOptions
    {
        AccessToken = Environment.GetEnvironmentVariable("HF_TOKEN"),
    }
);

CLI

The Onnxify.CLI package also exposes this workflow:

onnxify hf download onnx-community/gemma-4-E2B-it-ONNX models/gemma-bf16 --variant bf16 --exclude "*.md5" --overwrite

Repository

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 was computed.  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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

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.3.9 34 7/8/2026
0.3.8 93 6/30/2026
0.3.7 105 6/27/2026
0.3.6 103 6/26/2026
0.3.5 107 6/23/2026
0.3.4 102 6/19/2026
0.3.3 109 6/15/2026
0.3.2 103 6/14/2026
0.3.1 100 6/12/2026
0.3.0 104 6/11/2026
0.2.0 108 6/8/2026
0.1.4 106 6/2/2026
0.1.3 108 6/1/2026

## 0.3.9

- Aligned the package version with the 0.3.9 Onnxify package family release.

## 0.3.6

- Aligned the package version with the 0.3.6 Onnxify package family release.

## 0.3.5

- Aligned the package version with the 0.3.5 Onnxify package family release.

## 0.3.3

- Aligned the package version with the 0.3.3 Onnxify package family release.

## 0.3.2

- Aligned the package version with the 0.3.2 Onnxify package family release.

## 0.3.0

- Aligned the package version with the 0.3.0 Onnxify package family release.

## 0.2.0

- Aligned the package version with the 0.2.0 Onnxify package family release.

## 0.1.3

- Initial release.
- Added `HuggingFaceClient` for downloading Hugging Face model repository files into a local directory.
- Added include and exclude path filters for downloading only selected variants, such as `bf16`.
- Added progress reporting through `ProgressCallback` and `IProgress<HuggingFaceDownloadProgress>`.
- Added revision, access token, overwrite, and path-safety support.