LMStudio 1.2.0

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

LMStudio

LMStudio is a C# project that provides an interface to interact with the LMStudio integrated server. It is designed to manage chat history and send requests to an AI model server to generate responses based on the chat history.

Getting Started

To get started with LMStudio, you need to initialize a ModelConnection with the base URL of your AI model server and the model name. Optionally, you can also provide an API key.

var baseUrl = "http://your-model-server.com/v1/";
var model = "your-model-name";
var lmStudio = new ModelConnection(baseUrl, model);

Chatting with the AI

To chat with the AI, you need to create an instance of the Chat class, passing in your ModelConnection and an optional initial message.

var customInitMessage = "You are an AI assistant. You are designed to help users with their questions, always give a correct answer, and be polite.";
var chat = new Chat(lmStudio, customInitMessage);

You can then send user messages to the AI model server and receive responses using the CreateChatCompletion method.

var userInput = "Hello, AI!";
var response = chat.CreateChatCompletion(userInput);
Console.WriteLine(response);

Project Configuration

The project is configured to target .NET 8.0 and has enabled implicit usings and nullable reference types. The license for the project is MIT.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.
  • net8.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.2.0 455 6/12/2024
1.1.1 155 6/12/2024
1.1.0 176 6/12/2024 1.1.0 is deprecated because it has critical bugs.
1.0.0 198 5/22/2024 1.0.0 is deprecated.