-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8d72ece
Showing
186 changed files
with
21,597 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Typos configuration file | ||
# | ||
# Info: https://github.com/marketplace/actions/typos-action | ||
# Install: brew install typos-cli | ||
# Install: conda install typos | ||
# Run: typos -c .github/_typos.toml | ||
|
||
[files] | ||
extend-exclude = [ | ||
"_typos.toml", | ||
"LM-Kit-Maestro/wwwroot/*" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: build_test | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET 9 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 9.0.x | ||
|
||
- name: Install MAUI Workload | ||
run: dotnet workload install maui | ||
|
||
|
||
- name: Restore Dependencies | ||
run: dotnet restore LM-Kit-Maestro.sln | ||
|
||
- name: Build Debug Configuration | ||
run: dotnet build LM-Kit-Maestro.sln --no-restore --configuration Debug | ||
|
||
- name: Build Release Configuration | ||
run: dotnet build LM-Kit-Maestro.sln --no-restore --configuration Release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Check pull requests for typos. | ||
# | ||
# Configuration: .github/_typos.toml | ||
# | ||
# Info: https://github.com/marketplace/actions/typos-action | ||
# Local install: brew install typos-cli | ||
# Local install: conda install typos | ||
# Local run: typos -c .github/_typos.toml | ||
|
||
name: spell_check | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
name: Spell check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use custom config file | ||
uses: crate-ci/typos@master | ||
with: | ||
config: .github/_typos.toml | ||
write_changes: false | ||
quiet: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.vs | ||
LM-Kit-Maestro/bin | ||
LM-Kit-Maestro/obj | ||
*.user | ||
/tests/bin | ||
/tests/obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 LM-Kit | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.11.35327.3 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LM-Kit-Maestro", "LM-Kit-Maestro\LM-Kit-Maestro.csproj", "{CA06766A-A00F-4496-8992-0944994AFB9F}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LM-Kit-Maestro.Tests", "tests\LM-Kit-Maestro.Tests.csproj", "{37E609B0-C258-406F-B596-771B757667C6}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{CA06766A-A00F-4496-8992-0944994AFB9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{CA06766A-A00F-4496-8992-0944994AFB9F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{CA06766A-A00F-4496-8992-0944994AFB9F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU | ||
{CA06766A-A00F-4496-8992-0944994AFB9F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{CA06766A-A00F-4496-8992-0944994AFB9F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{CA06766A-A00F-4496-8992-0944994AFB9F}.Release|Any CPU.Deploy.0 = Release|Any CPU | ||
{37E609B0-C258-406F-B596-771B757667C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{37E609B0-C258-406F-B596-771B757667C6}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{37E609B0-C258-406F-B596-771B757667C6}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{37E609B0-C258-406F-B596-771B757667C6}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {416A0EEC-3B05-40E2-AB90-DC69F9E18DDE} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version = "1.0" encoding = "UTF-8" ?> | ||
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:local="clr-namespace:LMKitMaestro" | ||
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" | ||
x:Class="LMKitMaestro.App"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<!--<StyleSheet Source="Resources/CSS/LmKitMaestro.css"/> | ||
<StyleSheet Source="Resources/CSS/font-awesome.css"/>--> | ||
<mct:VariableMultiValueConverter x:Key="AllTrueConverter" ConditionType="All"/> | ||
<mct:VariableMultiValueConverter x:Key="AllFalseConverter" ConditionType="None"/> | ||
<mct:VariableMultiValueConverter x:Key="AnyTrueConverter" ConditionType="Any"/> | ||
|
||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary x:Name="colors" Source="Resources/Styles/Colors.xaml" /> | ||
<ResourceDictionary Source="Resources/Styles/Styles.xaml" /> | ||
<ResourceDictionary Source="Resources/Styles/Icons.xaml"/> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using LMKitMaestro.ViewModels; | ||
using Microsoft.AspNetCore.Components.WebView.Maui; | ||
|
||
namespace LMKitMaestro | ||
{ | ||
public partial class App : Application | ||
{ | ||
private readonly AppShellViewModel _appShellViewModel; | ||
|
||
public App(AppShellViewModel appShellViewModel) | ||
{ | ||
InitializeComponent(); | ||
|
||
BlazorWebViewHandler.BlazorWebViewMapper.AppendToMapping("CustomBlazorWebView", (handler, view) => | ||
{ | ||
#if WINDOWS | ||
// Setting background color of Blazor Web View to the page background color | ||
// to avoid visual white flash while the view is loading. | ||
if (App.Current != null && App.Current.Resources.TryGetValue("Background", out object value) && value is Color color) | ||
{ | ||
color.ToRgb(out byte r, out byte g, out byte b); | ||
|
||
handler.PlatformView.DefaultBackgroundColor = new Windows.UI.Color() | ||
{ | ||
A = 255, | ||
R = r, | ||
G = g, | ||
B = b | ||
}; | ||
} | ||
#endif | ||
}); | ||
|
||
_appShellViewModel = appShellViewModel; | ||
MainPage = new AppShell(appShellViewModel); | ||
Check warning on line 35 in LM-Kit-Maestro/App.xaml.cs GitHub Actions / build
|
||
} | ||
|
||
protected override async void OnStart() | ||
{ | ||
base.OnStart(); | ||
|
||
Current!.UserAppTheme = AppTheme.Dark; | ||
await _appShellViewModel.Init(); | ||
} | ||
|
||
protected override Window CreateWindow(IActivationState? activationState) | ||
{ | ||
Window window = base.CreateWindow(activationState); | ||
|
||
window.Destroying += OnAppWindowDestroying; | ||
|
||
window.MinimumWidth = AppConstants.WindowMinimumWidth; | ||
window.MinimumHeight = AppConstants.WindowMinimumHeight; | ||
|
||
return window; | ||
} | ||
|
||
private void OnAppWindowDestroying(object? sender, EventArgs e) | ||
{ | ||
_appShellViewModel.SaveAppSettings(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
namespace LMKitMaestro; | ||
|
||
internal static class AppConstants | ||
{ | ||
public const string DatabaseFilename = "LMKitMaestroSQLite.db3"; | ||
|
||
public const SQLite.SQLiteOpenFlags Flags = | ||
// open the database in read/write mode | ||
SQLite.SQLiteOpenFlags.ReadWrite | | ||
// create the database if it doesn't exist | ||
SQLite.SQLiteOpenFlags.Create | | ||
// enable multi-threaded database access | ||
SQLite.SQLiteOpenFlags.SharedCache; | ||
|
||
public const string ChatRoute = "Chat"; | ||
|
||
public const string ModelsRoute = "Models"; | ||
|
||
public const double ChatMessageMaximumWidth = 800; | ||
|
||
public const double ChatWindowLayoutMinimumWidth = 720; | ||
|
||
public const double WindowMinimumWidth = 568; | ||
|
||
public const double WindowMinimumHeight = 600; | ||
|
||
public const double PopupWidth = 536; | ||
|
||
public const double AlertPopupWidth = 400; | ||
|
||
public const double AppBarHeight = 72; | ||
|
||
public const double ChatPageTopBarHeight = AppBarHeight + ChatPageHeaderHeight - 8; | ||
|
||
public const double ModelSelectionButtonMaxWidth = 568; | ||
|
||
public const double MinimizedHeaderButtonWidth = ChatWindowLayoutMinimumWidth - (16 * 2); | ||
|
||
public const double ModelSelectionButtonHeight = 48; | ||
|
||
public const double ChatPageHeaderHeight = ModelSelectionButtonHeight + (8 * 2); | ||
|
||
public const double ChatPageSidebarWidth = 300; | ||
|
||
public const double HeaderHorizontalMargin = 12; | ||
|
||
public const double ChatPageSideTogglesWidth = (ChatPageToggleButtonWidth * 2) + 16 + 8; | ||
|
||
public const double ChatPageToggleButtonWidth = 32; | ||
|
||
#if BETA_DOWNLOAD_MODELS | ||
//LM-Kit models catalog: https://huggingface.co/lm-kit | ||
public static readonly ModelInfo[] AvailableModels = | ||
{ | ||
new ModelInfo( | ||
@"https://huggingface.co/lm-kit/llama-3-8b-instruct-gguf/resolve/main/Llama-3-8B-Instruct-Q4_K_M.gguf", | ||
new ModelInfo.ModelMetadata() | ||
{ | ||
FileSize = 4920733952 | ||
}), | ||
|
||
new ModelInfo( | ||
@"https://huggingface.co/lm-kit/LM-Kit.Sentiment_Analysis-TinyLlama-1.1B-1T-OpenOrca-en-q4-gguf/resolve/main/LM-Kit.Sentiment_Analysis-TinyLlama-1.1B-1T-OpenOrca-en-q4.gguf", | ||
new ModelInfo.ModelMetadata() | ||
{ | ||
}), | ||
|
||
new ModelInfo( | ||
@"https://huggingface.co/lm-kit/LM-Kit.Sarcasm_Detection-TinyLlama-1.1B-1T-OpenOrca-en-q4-gguf/resolve/main/LM-Kit.Sarcasm_Detection-TinyLlama-1.1B-1T-OpenOrca-en-q4.gguf", | ||
new ModelInfo.ModelMetadata() | ||
{ | ||
}), | ||
|
||
new ModelInfo( | ||
@"https://huggingface.co/lm-kit/bge-1.5-gguf/resolve/main/bge-small-en-v1.5-f16.gguf", | ||
new ModelInfo.ModelMetadata() | ||
{ | ||
}), | ||
|
||
new ModelInfo( | ||
@"https://huggingface.co/lm-kit/mistral-0.1-openorca-7b-gguf/resolve/main/Mistral-0.1-OpenOrca-7B-Q4_K_M.gguf", | ||
new ModelInfo.ModelMetadata() | ||
{ | ||
}), | ||
|
||
new ModelInfo( | ||
@"https://huggingface.co/lm-kit/mistral-0.3-7b-gguf/resolve/main/Mistral-0.3-7B-Q4_K_M.gguf", | ||
new ModelInfo.ModelMetadata() | ||
{ | ||
}), | ||
|
||
new ModelInfo( | ||
@"https://huggingface.co/lm-kit/deepseek-coder-1.6-7b-gguf/resolve/main/DeepSeek-Coder-1.6-7B-Instruct-Q4_K_M.gguf", | ||
new ModelInfo.ModelMetadata() | ||
{ | ||
}), | ||
|
||
new ModelInfo( | ||
@"https://huggingface.co/lm-kit/deepseek-coder-2-lite-15.7b-gguf/resolve/main/DeepSeek-Coder-2-Lite-15.7B-Instruct-Q4_K_M.gguf", | ||
new ModelInfo.ModelMetadata() | ||
{ | ||
}), | ||
//https://huggingface.co/lm-kit/llama-3.1-8b-instruct-gguf | ||
//https://huggingface.co/lm-kit/phi-3.1-mini-4k-3.8b-instruct-gguf/tree/main | ||
//https://huggingface.co/lm-kit/gemma-2-2b-gguf/tree/main | ||
//https://huggingface.co/lm-kit/phi-3-medium-4k-14b-instruct-gguf/tree/main | ||
//https://huggingface.co/lm-kit/mistral-0.3-7b-instruct-gguf/tree/main | ||
//https://huggingface.co/lm-kit/mistral-nemo-2407-12.2b-instruct-gguf/tree/main | ||
//https://huggingface.co/lm-kit/qwen-2-7b-instruct-gguf/tree/main | ||
//https://huggingface.co/lm-kit/gemma-2-9b-gguf/tree/main | ||
}; | ||
#endif | ||
} |
Oops, something went wrong.