Larroy.Kokoro.runtime.win-x64.cuda 0.1.0

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

Larroy.Kokoro

.NET bindings for kokoro.cpp, a C++ runtime for the Kokoro text-to-speech model on ONNX Runtime.

Install

dotnet add package Larroy.Kokoro

kokoro.dll for win-x64 and win-arm64 arrives through the Larroy.Kokoro.runtime.win-x64 and Larroy.Kokoro.runtime.win-arm64 packages. ONNX Runtime is not bundled: those packages depend on Microsoft.ML.OnnxRuntime 1.23.2 or newer, so an app that also references Microsoft.ML.OnnxRuntime gets one onnxruntime.dll, the highest version requested, and kokoro uses it.

Usage

using Kokoro.Net;

using var ctx = new KokoroContext(
    "models/kokoro-v1.1-zh.onnx", "models/voices-v1.1-zh.bin", KokoroContext.BundledDictDirectory,
    new KokoroOptions(KokoroDevice.Cpu, 0));
KokoroAudio audio = ctx.Synthesize("Hello world.", "af_maple");
// audio.Samples: mono float PCM; audio.SampleRate: 24000 (24 kHz).

Failures throw KokoroException; its Status mirrors the C API status code.

Model files are not included

The model and the voices file are passed by path; no package contains them. Get them by running uv run bootstrap.py configure in the kokoro.cpp repository, or download the release URLs it pins.

The G2P dictionaries are tied to the native code version, so Larroy.Kokoro ships them and copies them to <output>/kokoro-dict on build and publish. Pass KokoroContext.BundledDictDirectory as dictDir.

Threading

Separate contexts are independent and may be used from different threads. A single context must not be used by two threads at the same time.

CUDA (win-x64)

  • Add Larroy.Kokoro.runtime.win-x64.cuda; KokoroDevice.Auto then uses CUDA. It brings Microsoft.ML.OnnxRuntime.Gpu.Windows and makes its CUDA build of onnxruntime.dll take precedence over the CPU build from Microsoft.ML.OnnxRuntime.
  • If the app references a newer Microsoft.ML.OnnxRuntime, also reference Microsoft.ML.OnnxRuntime.Gpu.Windows at the same version; otherwise the newer CPU onnxruntime.dll wins and CUDA is unavailable.
  • The CUDA 12 / cuDNN 9 runtime DLLs must be on PATH: cudart64_12.dll, cublas64_12.dll, cublasLt64_12.dll, curand64_10.dll, cufft64_11.dll, cudnn64_9.dll.
  • Needs an NVIDIA driver supporting CUDA 12.8 or newer. The provider contains code for sm 7.5, 8.6 and 8.9; newer GPUs run through PTX 9.0.
  • Without the add-on onnxruntime.dll is the CPU build: KokoroDevice.Auto runs on the CPU and KokoroDevice.Cuda fails.

VC++ runtime (required)

kokoro.dll and onnxruntime.dll need the MSVC C++ runtime 14.38 or newer (an ONNX Runtime 1.20+ requirement). The packages deliberately do not include it.

  • Ship msvcp140.dll, msvcp140_1.dll, vcruntime140.dll and vcruntime140_1.dll (from the VC++ 2015-2022 redistributable, 14.38 or newer) app-local, in the same directory as kokoro.dll. That is the app directory when building or publishing with -r win-x64 / -r win-arm64, and runtimes/<rid>/native/ for RID-less builds.
  • Alternatively, require the VC++ redistributable 14.38 or newer installed system-wide. Older copies in System32 crash ONNX Runtime.
There are no supported framework assets in this 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.1.0 121 10/8/2026