{"record":{"id":"fe7f2b7845ad196d","repo":"SubtitleEdit/subtitleedit","slug":"llama-cpp-download-is-not-supported-on-this-platfo","errorCode":null,"errorMessage":"llama.cpp download is not supported on this platform.","messagePattern":"llama\\.cpp download is not supported on this platform\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"critical","filePath":"src/ui/Logic/Download/LlamaCppDownloadService.cs","lineNumber":134,"sourceCode":"\n                return variant == VariantVulkan\n                    ? BaseUrl + \"llama-\" + ReleaseTag + \"-bin-ubuntu-vulkan-arm64.tar.gz\"\n                    : BaseUrl + \"llama-\" + ReleaseTag + \"-bin-ubuntu-arm64.tar.gz\";\n            }\n\n            return variant == VariantVulkan\n                ? BaseUrl + \"llama-\" + ReleaseTag + \"-bin-ubuntu-vulkan-x64.tar.gz\"\n                : BaseUrl + \"llama-\" + ReleaseTag + \"-bin-ubuntu-x64.tar.gz\";\n        }\n\n        if (OperatingSystem.IsMacOS())\n        {\n            return RuntimeInformation.ProcessArchitecture == Architecture.Arm64\n                ? BaseUrl + \"llama-\" + ReleaseTag + \"-bin-macos-arm64.tar.gz\"\n                : BaseUrl + \"llama-\" + ReleaseTag + \"-bin-macos-x64.tar.gz\";\n        }\n\n        throw new PlatformNotSupportedException(\"llama.cpp download is not supported on this platform.\");\n    }\n}\n","sourceCodeStart":116,"sourceCodeEnd":137,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/LlamaCppDownloadService.cs#L116-L137","documentation":"Terminal fallback thrown by LlamaCppDownloadService's URL resolver when the OS is neither Windows nor Linux nor macOS. Windows, Linux (x64 + ARM64, CPU/Vulkan/CUDA-with-guards), and macOS (Arm64 + X64) all have URLs; anything else falls through to 'throw new PlatformNotSupportedException(\"llama.cpp download is not supported on this platform.\")'.","triggerScenarios":"Running on an OS where IsWindows/IsLinux/IsMacOS all return false — FreeBSD, Solaris, a bare runtime, or a future uncategorized OS. All standard desktop/server OSes are covered, so this is the defensive gate.","commonSituations":"Unsupported host OS; exotic container runtime; porting to a new OS before URL constants exist. Practically unreachable on the supported matrix (Windows/Linux/macOS, both arches).","solutions":["Run on Windows, Linux, or macOS where llama.cpp build URLs are defined.","If you must support another OS, build llama.cpp for it yourself and supply the binary outside the download path.","At the caller, detect the unsupported OS up front and disable the llama.cpp feature gracefully instead of letting the call throw at download time."],"exampleFix":"// before\nvar url = llamaService.GetUrl(variant); // throws on unsupported OS\n\n// after\nif (!OperatingSystem.IsWindows() && !OperatingSystem.IsLinux() && !OperatingSystem.IsMacOS())\n{\n    DisableLlamaCppFeature();\n    return;\n}\nvar url = llamaService.GetUrl(variant);","handlingStrategy":"validation","validationCode":"static bool IsLlamaCppSupportedPlatform()\n    => OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS();\n\nif (!IsLlamaCppSupportedPlatform()) { DisableLlamaCpp(); return; }","typeGuard":"static bool LlamaCppPlatformSupported()\n    => OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS();","tryCatchPattern":"try { var url = llamaService.GetUrl(variant); }\ncatch (PlatformNotSupportedException ex) when (ex.Message.Contains(\"not supported on this platform\"))\n{ _logger.Warning(\"llama.cpp download unsupported on {OS}\", RuntimeInformation.OSDescription); DisableLlamaCpp(); }","preventionTips":["Constrain the llama.cpp feature to Windows/Linux/macOS in the UI.","Log OSDescription at startup to detect unsupported environments early.","Provide a BYO-binary path for unsupported OSes instead of relying on auto-download."],"tags":["platform","unsupported-os","llama-cpp","download"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}