https://github.com/pboardman/koboldsharp
koboldcpp REST API wrapper for C#
https://github.com/pboardman/koboldsharp
ai koboldcpp llama llm text-generation
Last synced: 12 days ago
JSON representation
koboldcpp REST API wrapper for C#
- Host: GitHub
- URL: https://github.com/pboardman/koboldsharp
- Owner: pboardman
- License: mit
- Created: 2023-07-20T16:25:38.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-21T20:32:15.000Z (almost 2 years ago)
- Last Synced: 2025-05-11T00:02:32.779Z (14 days ago)
- Topics: ai, koboldcpp, llama, llm, text-generation
- Language: C#
- Homepage:
- Size: 8.79 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# KoboldSharp
A C# package for interfacing with [koboldcpp](https://github.com/LostRuins/koboldcpp)'s REST API
# Installation
## With .NET CLI
```
dotnet add package KoboldSharp
```## With Package Manager
```
NuGet\Install-Package KoboldSharp
```# Usage
```csharp
using KoboldSharp;// Replace 127.0.0.1 with the ip/hostname of the host running Koboldcpp
KoboldClient client = new KoboldClient("http://127.0.0.1:5001");var parameters = new GenParams("Hello my name is ");
// multiple parameters can be adjusted, such as max length, temperature etc...
parameters.MaxLength = 10;var result = await client.Generate(paramaters);
Console.WriteLine(result.Results[0].Text);
```