๐ Try the demo:
https://github.com/LM-Kit/lm-kit-net-samples/tree/main/console_net/text-generation/conversations/single_turn_chat
Single Turn AI Chatbot in .NET Applications
๐ฏ Purpose of the Demo
The Single Turn Chat Demo demonstrates how to use the LM-Kit.NET SDK for single-turn conversational interactions. This sample highlights the simplicity and efficiency of using large language models (LLMs) to handle one-off questions or statements, making it ideal for quick, informative exchanges.
๐ฅ Industry Target Audience
This sample is particularly useful for developers and organizations in the following sectors:
- ๐ Customer Support: Provide instant answers to frequently asked questions or simple queries.
- ๐ Information Services: Deliver quick, accurate information retrieval for various industries such as travel, finance, and education.
- ๐ค Virtual Assistants: Enhance the capabilities of virtual assistants by enabling them to respond to single-turn requests effectively.
- ๐ฅ Healthcare: Offer immediate responses to patient inquiries or general health information queries.
๐ Problem Solved
Traditional chatbots often require complex, multi-turn interactions to provide useful information, which can be cumbersome for simple queries. The Single Turn Chat Demo addresses this problem by enabling efficient and accurate single-turn conversations, thereby improving user experience and response times for straightforward inquiries.
๐ป Sample Application Description
The Single Turn Chat Demo is a console application that allows users to interact with various AI models for single-turn conversations.
โจ Key Features
- ๐ Model Selection: Users can choose from predefined models or provide a custom model URI.
- ๐ Progress Tracking: The application displays download and loading progress for the selected model.
- ๐ Single-Turn Interaction: The chatbot handles one-off user inputs and provides prompt responses.
- ๐ Performance Metrics: Displays generated tokens, stop reasons, quality score, and speed of response for each interaction.
๐ง Supported Models
The sample supports several state-of-the-art models:
- Alibaba Qwen 3.5 9B (~7 GB VRAM)
- Google Gemma 4 E4B (~6 GB VRAM)
- Microsoft Phi-4 14.7B (~11 GB VRAM)
- OpenAI GPT OSS 20B (~16 GB VRAM)
- Z.ai GLM 4.7 Flash 30B (~18 GB VRAM)
- Alibaba Qwen 3.8 27B (~18 GB VRAM)
- Alibaba Qwen 3.6 35B-A3B (~22 GB VRAM)
๐ ๏ธ Getting Started
๐ Prerequisites
- .NET 8.0 or later
๐ฅ Download the Project
โถ๏ธ Running the Application
๐ Clone the repository:
git clone https://github.com/LM-Kit/lm-kit-net-samples๐ Navigate to the project directory:
cd lm-kit-net-samples/console_net/text-generation/conversations/single_turn_chat๐จ Build and run the application:
dotnet build dotnet run๐ Follow the on-screen prompts to select a model and start the single-turn chat.
๐ก Example Usage
- Select a Model: Choose from the available models or enter a custom model URI.
- Initiate Conversation: Start by entering a prompt, such as "Hello!".
- Receive Response: The chatbot will provide a response based on the prompt.
- Continue Interaction: Enter another prompt or end the chat by submitting an empty input.
By following these steps, developers can explore the functionalities of LM-Kit.NET and integrate efficient single-turn conversational AI into their applications, enhancing user interactions through prompt and accurate responses to individual queries.
๐ Related Content
- How-To: Load Model and Generate: Learn how to load models and run text generation, the foundation of single-turn chat.
- How-To: Stream Agent Responses in Real Time: Guide to streaming LLM output token by token for responsive UIs.
- Glossary: Chat Completion: Core concepts behind single-turn and multi-turn chat completion with LLMs.
- Multi-Turn Chat Demo: The natural next step, adding context retention across multiple conversation exchanges.