LLMFromScratch.SDK.ThirdPartyTraining 0.1.4

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

LLMFromScratch third-party training extension

LLMFromScratch.SDK.ThirdPartyTraining is the opt-in extension for training Hugging Face Qwen, Llama, and compatible decoder models through Python tooling. It is deliberately separate from the original in-process GPT SDK.

Install it alongside the base SDK:

dotnet add package LLMFromScratch.SDK --version 0.3.2
dotnet add package LLMFromScratch.SDK.ThirdPartyTraining --version 0.1.4

The extension provides ThirdPartyModelPipeline for Unsloth or PEFT LoRA/QLoRA training, llama.cpp GGUF conversion, and local Ollama import.

Complete pipeline example

using System.Collections.Generic;
using LLMFromScratch.SDK.ThirdPartyTraining;

var pipeline = new ThirdPartyModelPipeline();
var result = await pipeline.RunAsync(
    new ThirdPartyModelPipelineRequest
    {
        Training = new ThirdPartyTrainingOptions
        {
            ModelId = "Qwen/Qwen2.5-0.5B-Instruct",
            ModelFamily = ThirdPartyModelFamily.Qwen,
            Backend = ThirdPartyTrainingBackend.Unsloth,
            DatasetPath = "Data/train.jsonl",
            OutputDirectory = "outputs/qwen-support",
            Epochs = 1,
            BatchSize = 1,
            GradientAccumulationSteps = 8,
            MaxSequenceLength = 2048,
            LoadIn4Bit = true,
            MergeAdapter = true
        },
        GgufExport = new ThirdPartyGgufExportOptions
        {
            // Filled with the merged training output by the pipeline.
            OutputPath = "outputs/qwen-support/qwen-support-q4_k_m.gguf",
            LlamaCppDirectory = @"C:\src\llama.cpp",
            Quantization = "Q4_K_M"
        },
        OllamaImport = new OllamaImportOptions
        {
            // GgufPath is filled by the GGUF stage.
            ModelName = "qwen-support",
            ModelfilePath = "outputs/qwen-support/Modelfile.qwen-support",
            SystemPrompt = "You are a concise, helpful support assistant.",
            Parameters = new Dictionary<string, string>
            {
                ["temperature"] = "0.2",
                ["num_ctx"] = "4096"
            }
        }
    },
    new Progress<string>(Console.WriteLine));

Console.WriteLine($"GGUF: {result.GgufExport?.OutputPath}");
Console.WriteLine($"Ollama model: {result.OllamaImport?.ModelName}");
Console.WriteLine($"Modelfile: {result.OllamaImport?.ModelfilePath}");

OllamaImportOptions writes the Modelfile and then runs ollama create <model-name> --file <modelfile-path>. The generated file uses the absolute GGUF path, supplied PARAMETER values, and optional SYSTEM or TEMPLATE directives. Leave Template unset unless you intentionally need to override the model's chat template.

For a manual import, the generated Modelfile has this form:

FROM C:/absolute/path/to/outputs/qwen-support/qwen-support-q4_k_m.gguf
PARAMETER temperature 0.2
PARAMETER num_ctx 4096
SYSTEM """You are a concise, helpful support assistant."""
ollama create qwen-support:latest --file outputs/qwen-support/Modelfile.qwen-support

For Python, llama.cpp, Ollama, dataset, standalone import, and manual Modelfile guidance, see the repository documentation at docs/ThirdPartyModels.md.

MIT. See the repository license.

Product Compatible and additional computed target framework versions.
.NET 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.1.4 120 9/7/2026
0.1.3 100 9/7/2026
0.1.2 108 9/7/2026
0.1.1 104 9/2/2026
0.1.0 102 9/2/2026

Updates the extension to depend on LLMFromScratch.SDK 0.3.2, which lowers the auto-generated companion Modelfile's default repeat_penalty (1.3 to 1.1) and temperature (0.7 to 0.3) to reduce malformed control-tag output, and documents that this tokenizer has no atomic special tokens for control tags as a separate, known limitation.