Table of Contents

💬 Build a MAUI AI based Chat Playground


🎯 Purpose of the Demo

The MAUI Chat Playground Demo showcases how to use the LM-Kit.NET SDK to run large language models (LLMs) directly within a .NET MAUI application. This demo enables developers to interact with LLMs, run them offline, and explore their text completion and chat capabilities. It demonstrates how seamlessly LLMs can be integrated into .NET applications, empowering users with advanced AI-driven text interactions.


💻 Application Screenshot

MAUI Chat Playground Demo


👥 Industry Target Audience

This demo is particularly beneficial for developers and organizations in the following sectors:

  • 🔧 Application Development: Developers building interactive apps that require intelligent responses from AI models.
  • 💬 Customer Support: Chatbot solutions that rely on LLMs for natural language understanding and continuous conversations.
  • 🎓 Education and Training: E-learning platforms leveraging AI to provide conversational learning aids or tutors.
  • 📊 Data Science and AI Research: Experimentation with different LLMs for data analysis or language research.

🚀 Problem Solved

Manual text interactions in apps can be inefficient, limited, and lacking contextual understanding. The MAUI Chat Playground Demo provides a solution by enabling LLMs to engage in conversations and retain context over extended chat sessions, making it possible to build highly intelligent and adaptable AI-powered apps.

It allows users to test different models, switch between them seamlessly, and continuously improve interactions—all in an offline environment to ensure privacy and autonomy.


💻 Demo Application Description

The MAUI Chat Playground Demo is a C# application built with .NET MAUI that allows users to interact with LLMs, switching models on the fly, managing chat history, and experimenting with different AI capabilities.

✨ Key Features

  • Run LLMs Offline: Leverage the power of LLMs locally on your machine, without the need for an internet connection.
  • Model Switching: Easily switch between various models during chat sessions, while keeping the conversation history intact.
  • Contextual Chat: Engage in interactive conversations with AI models, which maintain context even as models are switched.
  • History Management: Automatically save chat histories, ensuring that your conversations can be resumed seamlessly when the app is reopened.
  • ️Sampling Strategy Selection: Modify parameters like temperature, top-k, and top-p to adjust how the model generates its responses.
  • Unlimited Chat Length: Enjoy uninterrupted, extended conversations with no length limitations.
  • Auto-Synchronization with Model Folder: The application will automatically synchronize with all modifications to the model folder, allowing new models or changes to be detected instantly without restarting the app.
  • Continuous Improvement: This demo is regularly updated to improve performance, add new features, and integrate feedback from users.

🧠 Supported Models

The MAUI Chat Playground Demo supports any GGUF-compatible model, and several state-of-the-art models are available from the LM-Kit repository on Hugging Face:

You can easily load models from this repository or choose a model that you’ve already downloaded.


🛠️ Getting Started

📋 Prerequisites

  • .NET MAUI installed on your machine
  • LM-Kit.NET SDK configured

📥 Download the Project


▶️ Running the Application

  1. 📂 Clone the repository:

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

    cd lm-kit-net-samples/maui_net8/chat_playground
    
  3. 🔨 Build and run the application:

    dotnet build
    dotnet run
    
  4. 💬 Start Chatting: The application will launch with a simple and intuitive chat interface. Load a model from the LM-Kit repository or a custom GGUF model and start interacting.