TensorSharp

(โ˜… 375)

A native .NET LLM inference engine for GGUF models. TensorSharp provides a console application, a web-based chatbot interface, and Ollama/OpenAI-compatible HTTP APIs for programmatic access. It supports Windows/MacOS/Linux with full GPU capability

  • .gitattributes
  • .gitignore
  • DEVELOPMENT.md
  • DEVELOPMENT_zh-cn.md
  • Directory.Build.props
  • Directory.Solution.props
  • docs_models_README_zh-cn.md
  • docs_models_wan_zh-cn.md
  • FEATURES.md
  • FEATURES_zh-cn.md
  • LICENSE
  • MODEL_DOWNLOADS.md
  • MODEL_DOWNLOADS_zh-cn.md
  • README.md
  • README_zh-cn.md
  • TENSOR_PARALLELISM_PLAN.md
  • TensorSharp.slnx
  • USAGE.md
  • USAGE_zh-cn.md

# Installation Guide

1. Get the code
git clone https://github.com/zhongkaifu/TensorSharp

Downloads the entire project code from GitHub to your computer.

cd TensorSharp

Moves into the project folder you just downloaded.

2. CMake

Medium Recommended
Prerequisites
  • Git Needed to download the project code from GitHub.
  • CMake The tool used to generate build configuration.
  • C/C++ ์ปดํŒŒ์ผ๋Ÿฌ Windows needs Visual Studio (Community edition, free), macOS needs Xcode Command Line Tools, Linux needs the gcc/g++ package.
cd TensorSharp.Backends.MLX/Native

This project's files live in a subfolder, so move into it first.

mkdir build && cd build

Creates a folder to hold the build output and moves into it.

cmake ..

Analyzes the source code and generates build configuration files (must be run inside the build folder).

make

Compiles the code based on the generated build configuration to produce an executable.

โœ… Check that an executable was created inside the build folder, then run it directly (e.g. ./build/app_name).

3. .NET

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • .NET SDK The SDK required for the dotnet command.
dotnet --list-sdks

Type this command into your terminal and run it.

dotnet run --project TensorSharp.Cli -c Release -p:TensorSharpSkipMlxNative=true -- --model models\gemma-4-E4B-it-Q8_0.gguf --input prompt.txt --max-tokens 128 --backend ggml_cuda

Builds the project and runs it immediately.

add-apt-repository ppa:dotnet/backports

Type this command into your terminal and run it.

apt update && apt install dotnet-sdk-10.0

Type this command into your terminal and run it.

dotnet build -c Release

Type this command into your terminal and run it.

โœ… After dotnet run, check the message or address shown in the terminal.

Pulled directly from this repo's README.

// repository documentation