Table of Contents

๐Ÿ‘‰ 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

  1. ๐Ÿ“‚ Clone the repository:

    git clone https://github.com/LM-Kit/lm-kit-net-samples
    
  2. ๐Ÿ“ Navigate to the project directory:

    cd lm-kit-net-samples/console_net/text-generation/conversations/single_turn_chat
    
  3. ๐Ÿ”จ Build and run the application:

    dotnet build
    dotnet run
    
  4. ๐Ÿ“ Follow the on-screen prompts to select a model and start the single-turn chat.

๐Ÿ’ก Example Usage

  1. Select a Model: Choose from the available models or enter a custom model URI.
  2. Initiate Conversation: Start by entering a prompt, such as "Hello!".
  3. Receive Response: The chatbot will provide a response based on the prompt.
  4. 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.

Share