Pages/Index.cshtml.cscsharp

Documentation

Lilith.RazorWebGui (Version 5)

ASP.NET Core Razor Pages web UI for Lilith Version 5. Mirrors LilithConsole chat, commands, and logging.

  • Model: LILITH_MODEL (default gemma4)
  • Commands: exit, /new, /history, /history <n>, /voice <name> (when TTS is enabled)
dotnet run --project Lilith.RazorWebGui.csproj

Browse http://localhost:5000 (see Properties/launchSettings.json).

using Lilith.RazorWebGui.Services;using Microsoft.AspNetCore.Mvc;using Microsoft.AspNetCore.Mvc.RazorPages;namespace Lilith.RazorWebGui.Pages;public class IndexModel(LilithChatService chat) : PageModel{  public IReadOnlyList<ChatLine> Lines => chat.Lines;  public string ModelName => chat.Model;  public int VersionNumber => chat.VersionNumber;  public bool TtsEnabled => chat.TtsEnabled;  public bool IsReady => chat.IsReady;  [BindProperty]  public string? Input { get; set; }  public void OnGet()  {  }  public async Task<IActionResult> OnPostSendAsync()  {    if (string.IsNullOrWhiteSpace(Input))    {      return RedirectToPage();    }    string text = Input.Trim();    Input = string.Empty;    bool running = await chat.SendAsync(text);    if (!running)    {      chat.Shutdown();    }    return RedirectToPage();  }}