Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/OpenClaw.SetupEngine.UI/Controls/LocalAiSetupControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ private async Task InitializeLocalAiReviewAsync(
if (_config.LocalAi.SelectedModelId is { } selectedModelId)
{
LocalInferenceEligibilityResult selectedEligibility =
LocalInferenceEligibility.Evaluate(_localAiHardware, selectedModelId);
_localAiRecoveryModelPinned
? LocalInferenceEligibility.EvaluateInstalled(_localAiHardware, selectedModelId)
: LocalInferenceEligibility.Evaluate(_localAiHardware, selectedModelId);
if (_localAiRecoveryModelPinned)
{
eligibility = selectedEligibility;
Expand All @@ -137,7 +139,11 @@ private async Task InitializeLocalAiReviewAsync(
}
_config.LocalAi.SelectedModelId ??= _localAiRecommendedModelId ?? availability.Plan.Model.Id;

eligibility ??= LocalInferenceEligibility.Evaluate(
eligibility ??= _localAiRecoveryModelPinned
? LocalInferenceEligibility.EvaluateInstalled(
_localAiHardware,
_config.LocalAi.SelectedModelId!)
: LocalInferenceEligibility.Evaluate(
_localAiHardware,
_config.LocalAi.SelectedModelId);
if (_localAiRecoveryModelPinned && !eligibility.CanInstall)
Expand Down
2 changes: 2 additions & 0 deletions src/OpenClaw.SetupEngine.UI/SetupWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ public SetupWindow(
if (!string.IsNullOrWhiteSpace(localAiRecoveryModelId))
{
_config.LocalAi.SelectedModelId = localAiRecoveryModelId;
_config.LocalAi.InstalledReceiptModelId = localAiRecoveryModelId;
_pinLocalAiRecoveryModel = true;
}
if (localAiRecoveryRequestedPort is { } requestedPort &&
Expand Down Expand Up @@ -602,6 +603,7 @@ private async Task ReviewLocalAiCoreAsync(LocalAiOnboardingSnapshot selection)
_config.GatewayPort = target.GatewayPort;
_config.GatewayUrl = null;
_config.LocalAi.SelectedModelId = target.ModelCatalogId;
_config.LocalAi.InstalledReceiptModelId = target.ModelCatalogId;
if (target.RequestedLocalAiPort is { } port)
_config.LocalAi.Port = port;
_config.LocalAi.Enabled = true;
Expand Down
3 changes: 3 additions & 0 deletions src/OpenClaw.SetupEngine/LocalAiRecoveryPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ internal sealed record LocalAiRecoveryConfigurationBaseline(
int GatewayPort,
string? GatewayUrl,
string? SelectedProfileId,
string? InstalledReceiptModelId,
bool NetworkingConsent)
{
public static LocalAiRecoveryConfigurationBaseline Capture(SetupConfig config) =>
Expand All @@ -49,6 +50,7 @@ public static LocalAiRecoveryConfigurationBaseline Capture(SetupConfig config) =
config.GatewayPort,
config.GatewayUrl,
config.LocalAi.SelectedProfileId,
config.LocalAi.InstalledReceiptModelId,
config.LocalAi.WslMirroredNetworkingConsent);

public void Restore(SetupConfig config)
Expand All @@ -62,6 +64,7 @@ public void Restore(SetupConfig config)
config.GatewayPort = GatewayPort;
config.GatewayUrl = GatewayUrl;
config.LocalAi.SelectedProfileId = SelectedProfileId;
config.LocalAi.InstalledReceiptModelId = InstalledReceiptModelId;
config.LocalAi.WslMirroredNetworkingConsent = NetworkingConsent;
}
}
Expand Down
12 changes: 9 additions & 3 deletions src/OpenClaw.SetupEngine/LocalAiSetupSteps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ public override Task<StepResult> ExecuteAsync(SetupContext ctx, CancellationToke
ex));
}

LocalInferenceEligibilityResult eligibility = LocalInferenceEligibility.Evaluate(
hardware,
ctx.Config.LocalAi.SelectedModelId);
string? selectedModelId = ctx.Config.LocalAi.SelectedModelId;
LocalInferenceEligibilityResult eligibility =
!string.IsNullOrWhiteSpace(selectedModelId) &&
string.Equals(
selectedModelId,
ctx.Config.LocalAi.InstalledReceiptModelId,
StringComparison.OrdinalIgnoreCase)
? LocalInferenceEligibility.EvaluateInstalled(hardware, selectedModelId)
: LocalInferenceEligibility.Evaluate(hardware, selectedModelId);
ctx.LocalAiHardware = hardware;
ctx.LocalAiEligibility = eligibility;
ctx.Config.LocalAi.SelectedProfileId = eligibility.Plan?.Profile.Id;
Expand Down
6 changes: 6 additions & 0 deletions src/OpenClaw.SetupEngine/SetupContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ public sealed class LocalAiConfig
/// <summary>Runtime-only effective profile selected from detected GPU capacity.</summary>
[JsonIgnore]
public string? SelectedProfileId { get; set; }
/// <summary>
/// Runtime-only model ID proven by the existing installation receipt for a pinned
/// recovery. It authorizes retired-catalog lookup only for that exact selection.
/// </summary>
[JsonIgnore]
internal string? InstalledReceiptModelId { get; set; }
/// <summary>Managed llama-server port. Zero selects a free loopback port during setup.</summary>
public int Port { get; set; }
public bool WslMirroredNetworkingConsent { get; set; }
Expand Down
147 changes: 132 additions & 15 deletions src/OpenClaw.Shared/Inference/Catalog/LlamaRuntimeCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ public LlamaRuntimeVariant(
/// </summary>
public static class LlamaRuntimeCatalog
{
public const string ReleaseTag = "b11026";
public const string ReleaseCommitSha = "b49650adb31f2e49a0d76113aeb1792134fd8413";
public const string ReleaseTag = "b11320";
public const string ReleaseCommitSha = "b8f96c3e82284028cb077811ed1666caac3c5bac";
public const string ServerExecutableName = "llama-server.exe";
public const string ServerImplementationLibraryName = "llama-server-impl.dll";
public const string X64RuntimeId = "b11026-cuda13-x64";
public const string Arm64RuntimeId = "b11026-cuda13-arm64";
public const string X64RuntimeId = "b11320-cuda13-x64";
public const string Arm64RuntimeId = "b11320-cuda13-arm64";

public static GitHubReleaseSource Source { get; } = new(
"ggml-org/llama.cpp",
Expand All @@ -85,13 +85,13 @@ public static class LlamaRuntimeCatalog
new[]
{
RuntimeArtifact(
"llama-b11026-cuda13-x64",
"llama-b11320-cuda13-x64",
ArtifactRole.RuntimeBinary,
"llama-b11026-bin-win-cuda-13.4-x64.zip",
150_102_391,
"6799f0962d066c54aee3773f0e5efa0076e46418695c0f4f6d24a38e7007dfb1"),
"llama-b11320-bin-win-cuda-13.4-x64.zip",
152_787_584,
"75afa9d56077ebbd7a6123e923e8b6e82d4f4b1e53947ce04ca14ccbbfbba9c0"),
RuntimeArtifact(
"cudart-b11026-cuda13-x64",
"cudart-b11320-cuda13-x64",
ArtifactRole.RuntimeDependency,
"cudart-llama-bin-win-cuda-13.4-x64.zip",
423_535_356,
Expand All @@ -106,13 +106,13 @@ public static class LlamaRuntimeCatalog
new[]
{
RuntimeArtifact(
"llama-b11026-cuda13-arm64",
"llama-b11320-cuda13-arm64",
ArtifactRole.RuntimeBinary,
"llama-b11026-bin-win-cuda-13.4-arm64.zip",
142_993_717,
"d4a31d05b4fe997872020d81e8482e7712c7c254ec9c7ccdb9597ae2a31e6728"),
"llama-b11320-bin-win-cuda-13.4-arm64.zip",
144_946_754,
"9fcf3fb79c7d107b2fc60cff6e5947b133c965ca071ba0f8b05f641308b8e660"),
RuntimeArtifact(
"cudart-b11026-cuda13-arm64",
"cudart-b11320-cuda13-arm64",
ArtifactRole.RuntimeDependency,
"cudart-llama-bin-win-cuda-13.4-arm64.zip",
153_262_407,
Expand All @@ -125,6 +125,15 @@ public static class LlamaRuntimeCatalog
// managed installation recorded before the runtime bump keeps resolving its own
// receipt and stays launchable until setup upgrades it. Pins are reproduced
// exactly as they were installed; nothing is remapped.
private const string LegacyB11026ReleaseTag = "b11026";
private const string LegacyB11026RuntimeIdX64 = "b11026-cuda13-x64";
private const string LegacyB11026RuntimeIdArm64 = "b11026-cuda13-arm64";

private static GitHubReleaseSource LegacyB11026Source { get; } = new(
"ggml-org/llama.cpp",
LegacyB11026ReleaseTag,
"b49650adb31f2e49a0d76113aeb1792134fd8413");

private const string LegacyB10655ReleaseTag = "b10655";
private const string LegacyB10655RuntimeIdX64 = "b10655-cuda13-x64";
private const string LegacyB10655RuntimeIdArm64 = "b10655-cuda13-arm64";
Expand Down Expand Up @@ -179,6 +188,50 @@ public static class LlamaRuntimeCatalog
"5a40dc7c5fa3d0a80ceeba4f16f9e8d25d87bcf1399c9233588953c43436c33c"),
}),
LegacyB10655ReleaseTag),
new LlamaRuntimeVariant(
LegacyB11026RuntimeIdX64,
Architecture.X64,
new Version(13, 4),
Array.AsReadOnly(
new[]
{
LegacyB11026Artifact(
"llama-b11026-cuda13-x64",
ArtifactRole.RuntimeBinary,
"llama-b11026-bin-win-cuda-13.4-x64.zip",
150_102_391,
"6799f0962d066c54aee3773f0e5efa0076e46418695c0f4f6d24a38e7007dfb1"),
LegacyB11026Artifact(
"cudart-b11026-cuda13-x64",
ArtifactRole.RuntimeDependency,
"cudart-llama-bin-win-cuda-13.4-x64.zip",
423_535_356,
"738f8c251ac22b70c3ae6f83a10cf222725df0395246a2cf58f32bdb85fbe668"),
}),
LegacyB11026ReleaseTag,
requiredFiles: LegacyB11026X64RuntimeFiles()),
new LlamaRuntimeVariant(
LegacyB11026RuntimeIdArm64,
Architecture.Arm64,
new Version(13, 4),
Array.AsReadOnly(
new[]
{
LegacyB11026Artifact(
"llama-b11026-cuda13-arm64",
ArtifactRole.RuntimeBinary,
"llama-b11026-bin-win-cuda-13.4-arm64.zip",
142_993_717,
"d4a31d05b4fe997872020d81e8482e7712c7c254ec9c7ccdb9597ae2a31e6728"),
LegacyB11026Artifact(
"cudart-b11026-cuda13-arm64",
ArtifactRole.RuntimeDependency,
"cudart-llama-bin-win-cuda-13.4-arm64.zip",
153_262_407,
"642dcde8805b3e3165ca710a5443b3b4044b27d96bd3ee3132473988c9bcb774"),
}),
LegacyB11026ReleaseTag,
requiredFiles: LegacyB11026Arm64RuntimeFiles()),
});

public static IReadOnlyList<LlamaRuntimeVariant> Variants => s_variants;
Expand All @@ -200,6 +253,55 @@ public static class LlamaRuntimeCatalog
?? s_legacyVariants.SingleOrDefault(variant => string.Equals(variant.Id, id, StringComparison.Ordinal));

private static IReadOnlyList<LlamaRuntimeFile> X64RuntimeFiles() =>
[
RuntimeFile("cublas64_13.dll", 54_942_320, "1119dbca0a808e0c8850bb4221e330daf0b5ddb348d62d37b6ac533854723df9"),
RuntimeFile("cublasLt64_13.dll", 492_752_496, "0f5bc315fef706b5626248ebd74e8a48a9e82fa2f0cad38330f5f70984913107"),
RuntimeFile("cudart64_13.dll", 551_024, "05bfafcb97bd53b0089568a96e1e5bd6921637bd0853ff7f5342bd31a6a16890"),
RuntimeFile("ggml-base.dll", 801_280, "777562364f0528eaadd7865faf0e6e0b17ff3904e50a18438caebc4bfd0790e3"),
RuntimeFile("ggml-cpu-alderlake.dll", 1_431_552, "6201c30f8b96e131654d196125c659d554ba478294c0703da0b7a20a89618122"),
RuntimeFile("ggml-cpu-cannonlake.dll", 1_657_856, "39a18866d22962cf20c604c93f877b351bd280d798d794c8e8905d03ca73c228"),
RuntimeFile("ggml-cpu-cascadelake.dll", 1_642_496, "e74f4902fa3bd58ccdfe75c36517a33574eeabb370e18b7ca803b9ee3f0e5113"),
RuntimeFile("ggml-cpu-cooperlake.dll", 1_643_520, "65bde4b5d95ff05523dbd3a403abbf47de569fae92708a38ebfd8abfa934a64c"),
RuntimeFile("ggml-cpu-haswell.dll", 1_436_160, "a54e0bb576b0b17453d0db649d0f367b59aeeaab9f5e394df501891dc7437142"),
RuntimeFile("ggml-cpu-icelake.dll", 1_649_152, "4734e2f5ad4a9003e0345d2dd785598fd8ea1af1f23408316b14aa54f2fbd855"),
RuntimeFile("ggml-cpu-ivybridge.dll", 1_307_136, "a6bc4be1e4cec08406fddead48feafc29dc5cc2ee3d4a30367335dc0ec277b8b"),
RuntimeFile("ggml-cpu-piledriver.dll", 1_310_208, "e86eb4d9c67a713b3a9faf7ffd430fc933d88fa993c150ba15fcc1ccc9edf334"),
RuntimeFile("ggml-cpu-sandybridge.dll", 1_286_656, "b2a4ac1f2a4391a707b23848a10326e42d86abf6e31ab3f1aa31eac8ff1a5f0c"),
RuntimeFile("ggml-cpu-sapphirerapids.dll", 1_920_000, "85b7c5163e8be5576e2bc87678c2a979c6d85b70be1b78317f0e7ee7324ff87e"),
RuntimeFile("ggml-cpu-skylakex.dll", 1_651_712, "572c006b7ab4df21f35f469ff7b20b9959a97097d2edb3f1fb28ee834c4c8f2f"),
RuntimeFile("ggml-cpu-sse42.dll", 916_480, "de669e22953f32567c0512199448fbd3259f96bd90b1d41967d42479a6d4f1be"),
RuntimeFile("ggml-cpu-x64.dll", 908_800, "95660d872ed83b6335708dbf539d1b15ca60ea5832a0aed59e9c6d38d6ed468e"),
RuntimeFile("ggml-cpu-zen4.dll", 1_649_664, "e75dea4fc377ffe75096cdca48cd26fc4777f4ace76c94483a2414c8c41b7b02"),
RuntimeFile("ggml-cuda.dll", 147_597_824, "af6121ddd035db3fddb90bdc7dbbef8bfb244db522157af459b9682f0d18934e"),
RuntimeFile("ggml-rpc.dll", 168_448, "29cd136e276a998b7d1ec43b5dd2d6d9dee837c38bbae73ffbc02e015584c740"),
RuntimeFile("ggml.dll", 79_872, "96a162e0be5a3c798af6b31a5d21c1bd04493914e7b11ae8f9212d0bf0996e6c"),
RuntimeFile("libomp.dll", 768_000, "a12116ba72d1d6820407cf30be23da04ce79d6bb8a71a5ee71759c5a1faa6f1c"),
RuntimeFile("llama-common.dll", 7_891_968, "a6a87f92224a11a562f5397554119882d81b9e0038ea98cf8aa4edc34f3d6d2d"),
RuntimeFile("llama-server-impl.dll", 8_946_688, "6dfeb749b21b6cd3f4a64d0319b75a090be3d79f222053239ac6a4527a5386ed"),
RuntimeFile("llama-server.exe", 9_216, "96bfefe33c2cf0f1f421cae2f9e1e4a385264c8d4d731f7b08ff880edbb4f133"),
RuntimeFile("llama.dll", 3_270_656, "cfbf1a2ac5d676ccb3c7685098877f832a90285ad21575faf5a71eefece7f759"),
RuntimeFile("mtmd.dll", 1_794_560, "c29eacab7497aa8b18951ea2e7466c8fd8867ff49d122322a203e8d6c7a87dfa"),
];

private static IReadOnlyList<LlamaRuntimeFile> Arm64RuntimeFiles() =>
[
RuntimeFile("cublas64_13.dll", 24_207_984, "49e8fa23d88ac0cbae27e200fc092b894dd55b4de5cb4293993986e29fb9b65a"),
RuntimeFile("cublasLt64_13.dll", 193_128_560, "daf579ae36bb3c85e2340c57a1994f634e07c6f55ef70dd4cdc26695de21c752"),
RuntimeFile("cudart64_13.dll", 606_832, "bd927ddf03823eeead7c8b261a8669d96764b89109311f4ab6accde8b7d97ec2"),
RuntimeFile("ggml-base.dll", 664_576, "4817c34746df9b1b519d3da9140e61752c4a852a4d1e9df63dabd8ae069bd03e"),
RuntimeFile("ggml-cpu.dll", 834_560, "2896d13bf7b05f80b0f4f1e4d1f85c19c3ebc207757117ea709a8e4dfe0914f7"),
RuntimeFile("ggml-cuda.dll", 145_212_928, "c877fcb29338139d502065d56bf93e1bbd8b3092ddc2dd032bd47b6395b2b8b3"),
RuntimeFile("ggml-rpc.dll", 155_648, "7b237414f5739105c41cf55cd4ad9e7c14f13ba417253d7bb3bfac961406a9cb"),
RuntimeFile("ggml.dll", 70_656, "09f47cabdce4c7efd13b68b5f4206b276516f89e09b946460b048c7eb5d215ff"),
RuntimeFile("libomp.dll", 764_928, "26caae17f29aaf2238f664375b663cd306d596bc9e36e780fa88356c51fe876a"),
RuntimeFile("llama-common.dll", 6_983_680, "fca38964f724eb153bb0d35926a397cfa010142cbeb6649f63d13a64b090bfc9"),
RuntimeFile("llama-server-impl.dll", 8_201_728, "cb751a06de6ac4fef398704c26807ff2a1740d6711d9f2ab7318ccb27d3e77f9"),
RuntimeFile("llama-server.exe", 9_728, "67a7789b17b2ec98ca87c079bf6686da7e5b9e56d4d9d6df8c3a08d4b654b6b5"),
RuntimeFile("llama.dll", 2_864_640, "9d18dfdd61e5f027a1763196f6c0d258c3e2307e6f4886da51679317dd779d8c"),
RuntimeFile("mtmd.dll", 1_507_328, "d47dc5f6441efa1de3176f60da2c5da28c4da411807be6c6b8a9c054f61cb37a"),
];

private static IReadOnlyList<LlamaRuntimeFile> LegacyB11026X64RuntimeFiles() =>
[
RuntimeFile("cublas64_13.dll", 54_942_320, "1119dbca0a808e0c8850bb4221e330daf0b5ddb348d62d37b6ac533854723df9"),
RuntimeFile("cublasLt64_13.dll", 492_752_496, "0f5bc315fef706b5626248ebd74e8a48a9e82fa2f0cad38330f5f70984913107"),
Expand Down Expand Up @@ -230,7 +332,7 @@ private static IReadOnlyList<LlamaRuntimeFile> X64RuntimeFiles() =>
RuntimeFile("mtmd.dll", 1_772_032, "131d3ddce28051fd48ca07a0fa9128fb35996631afa516e43ecc5094b7aa402f"),
];

private static IReadOnlyList<LlamaRuntimeFile> Arm64RuntimeFiles() =>
private static IReadOnlyList<LlamaRuntimeFile> LegacyB11026Arm64RuntimeFiles() =>
[
RuntimeFile("cublas64_13.dll", 24_207_984, "49e8fa23d88ac0cbae27e200fc092b894dd55b4de5cb4293993986e29fb9b65a"),
RuntimeFile("cublasLt64_13.dll", 193_128_560, "daf579ae36bb3c85e2340c57a1994f634e07c6f55ef70dd4cdc26695de21c752"),
Expand Down Expand Up @@ -266,6 +368,21 @@ private static PinnedArtifact RuntimeArtifact(
new Sha256Digest(sha256),
LocalInferenceCatalogProvenance.NvidiaCair);

private static PinnedArtifact LegacyB11026Artifact(
string id,
ArtifactRole role,
string fileName,
long sizeBytes,
string sha256) =>
new(
id,
role,
LegacyB11026Source,
fileName,
sizeBytes,
new Sha256Digest(sha256),
LocalInferenceCatalogProvenance.NvidiaCair);

private static PinnedArtifact LegacyB10655Artifact(
string id,
ArtifactRole role,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,25 @@ public static LocalInferenceEligibilityResult Evaluate(
{
ArgumentNullException.ThrowIfNull(hardware);

LocalInferenceSelectionResult selection = LocalInferenceSelector.Select(hardware, requestedModelId);
return Evaluate(hardware, LocalInferenceSelector.Select(hardware, requestedModelId));
}

/// <summary>
/// Evaluates the explicit model recorded by an existing installation receipt,
/// including a retired model that is no longer offered for fresh selection.
/// </summary>
public static LocalInferenceEligibilityResult EvaluateInstalled(
HostHardwareInfo hardware,
string installedModelId)
{
ArgumentNullException.ThrowIfNull(hardware);
return Evaluate(hardware, LocalInferenceSelector.SelectInstalled(hardware, installedModelId));
}

private static LocalInferenceEligibilityResult Evaluate(
HostHardwareInfo hardware,
LocalInferenceSelectionResult selection)
{
if (!selection.IsSelected || selection.Plan is null)
{
return Unsupported(
Expand Down
Loading
Loading