Cortex.SafeTensors 1.1.0

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

Cortex.SafeTensors

HuggingFace SafeTensors format reader/writer for Cortex with memory-mapped tensor loading.

Part of the Cortex data science ecosystem for .NET.

Requires .NET 10+.

Features

  • Read SafeTensors files — load HuggingFace model weights and embeddings
  • Write SafeTensors files — export tensors in the interoperable SafeTensors format
  • Memory-mapped I/O — mmap-backed loading for zero-copy, low-memory access
  • Zero-copy tensor views — access tensor data without deserialization overhead
  • Multi-file support — load sharded model weights across multiple files

Installation

dotnet add package Cortex.SafeTensors

Quick Start

using Cortex.ML;
using Cortex.SafeTensors;

// Load model weights
var tensors = SafeTensorsFile.Load("model.safetensors");
var weights = tensors["encoder.weight"];  // zero-copy tensor view

// Save tensors
var output = new SafeTensorsBuilder();
output.Add("embeddings", embeddingTensor);
output.Save("embeddings.safetensors");
Package Description
Cortex.ML ML models and tensor operations
Cortex.ML.Torch TorchSharp training with SafeTensors model saving
Product Compatible and additional computed target framework versions.
.NET 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 (1)

Showing the top 1 NuGet packages that depend on Cortex.SafeTensors:

Package Downloads
Cortex.ML.Torch

TorchSharp tensor bridge for Cortex DataFrames

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 87 3/30/2026
1.0.0 89 3/27/2026