rkllm-sharp 1.0.2

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

This is a C# wrapper for rkllm-runtime-linux

With this wrapper you can use converted large language models on RK series chip. E.g. RK3588.

Note you need to convert your model to .rkllm, and you will need the librkllmrt.so.

You can find the lib here.

According to this tutorial, you need the rkllm-driver >= v0.9.6

Check the version by:

$ sudo cat /proc/rknpu/version

Sample

var param = new RkllmParameters(){
                NumNpuCore = 3,     //3 for 3588
                MaxNewTokens = 512,
                Temperature = 9999
            };
var llm = new Rkllm("/home/orangepi/ssd/rkllm/qwen.rkllm",param);

var prompt = "<|im_start|>system 你是一个人工智能助手。<|im_end|>\n<|im_start|>user你妈死了<|im_end|>\n<|im_start|>assistant\n";

// llm.OnModelMessage += (string msg, Rkllm.ModelState state)=>{
// Console.Write(msg);
// };

// llm.OnModelFinalMessage += (string msg, Rkllm.ModelState state)=>{
// Console.WriteLine();
// Console.WriteLine(msg);
// };

// llm.Trigger(prompt);

var resoponse = await llm.RunAsync(prompt);
Console.WriteLine(resoponse);
llm.Dispose();
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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.
  • net7.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
1.0.2 103 7/29/2024
1.0.1 91 7/29/2024
1.0.0 89 7/29/2024