{"record":{"id":"c96aaed5aa0b4395","repo":"SubtitleEdit/subtitleedit","slug":"chatllm-is-not-available-for-linux-arm64","errorCode":null,"errorMessage":"ChatLLM is not available for Linux ARM64.","messagePattern":"ChatLLM is not available for Linux ARM64\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"critical","filePath":"src/ui/Logic/Download/ChatLlmDownloadService.cs","lineNumber":61,"sourceCode":"    }\n\n    public async Task DownloadEngine(Stream stream, IProgress<float>? progress, CancellationToken cancellationToken)\n    {\n        await DownloadHelper.DownloadFileAsync(_httpClient, GetUrl(), stream, progress, cancellationToken);\n    }\n\n    private static string GetUrl()\n    {\n        if (OperatingSystem.IsWindows())\n        {\n            return WindowsUrl;\n        }\n\n        if (OperatingSystem.IsLinux())\n        {\n            if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)\n            {\n                throw new PlatformNotSupportedException(\"ChatLLM is not available for Linux ARM64.\");\n            }\n\n            return LinuxUrl;\n        }\n\n        if (OperatingSystem.IsMacOS())\n        {\n            switch (RuntimeInformation.ProcessArchitecture)\n            {\n                case Architecture.Arm64:\n                    return MacArmUrl; // e.g., for M1, M2, M3, M4, M5 chips\n                // case Architecture.X64:\n                //     return MacX64Url;\n                default:\n                    throw new PlatformNotSupportedException(\"Unsupported macOS architecture.\");\n            }\n        }\n        throw new PlatformNotSupportedException();","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/ChatLlmDownloadService.cs#L43-L79","documentation":"Thrown by ChatLlmDownloadService.GetUrl() when the process is running on Linux with an ARM64 (aarch64) CPU. ChatLLM binaries are only published for Linux x64, Windows, and macOS, so the service refuses to hand out a URL it cannot honor. It is a PlatformNotSupportedException, meaning the operation is structurally unavailable rather than transiently failing.","triggerScenarios":"Calling any ChatLLM download API (GetUrl() directly, or DownloadXxx that internally resolves the URL) while RuntimeInformation.ProcessArchitecture == Architecture.Arm64 AND OperatingSystem.IsLinux() returns true. This includes Raspberry Pi 4/5, AWS Graviton, Ampere Altra, and Linux ARM dev containers.","commonSituations":"Running the app on a Raspberry Pi or other ARM SBC; deploying to Graviton-based cloud VMs; cross-compiling and running under qemu-arm64 emulation; CI on ARM Linux runners. Also hit by users who installed an arm64 .NET runtime by mistake on an x64 host.","solutions":["Run the application on a Linux x64, Windows, or macOS (Intel or Apple Silicon) host instead of Linux ARM64.","If ARM64 Linux is required, build/obtain a ChatLLM build for that architecture yourself and skip the service's GetUrl() by supplying the binary through an alternate install path.","Confirm RuntimeInformation.ProcessArchitecture at startup and disable the ChatLLM feature on ARM64 Linux via feature flag rather than letting the call fail at download time."],"exampleFix":"// before\nvar url = ChatLlmDownloadService.GetUrl(); // throws on arm64 linux\n\n// after\nif (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)\n{\n    _logger.Warning(\"ChatLLM is unsupported on Linux ARM64; feature disabled.\");\n    return;\n}\nvar url = ChatLlmDownloadService.GetUrl();","handlingStrategy":"validation","validationCode":"// Run before invoking ChatLLM download\nstatic bool IsChatLlmSupportedOnThisPlatform()\n    => OperatingSystem.IsWindows()\n       || OperatingSystem.IsMacOS()\n       || (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture != Architecture.Arm64);\n\nif (!IsChatLlmSupportedOnThisPlatform()) { DisableChatLlmFeature(); return; }","typeGuard":"// narrows to a supported config before GetUrl()\nstatic bool CanGetChatLlmUrl()\n    => OperatingSystem.IsWindows()\n       || OperatingSystem.IsMacOS()\n       || (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture != Architecture.Arm64);","tryCatchPattern":"try { var url = ChatLlmDownloadService.GetUrl(); }\ncatch (PlatformNotSupportedException ex) when (ex.Message.Contains(\"Linux ARM64\"))\n{ _logger.Warning(\"ChatLLM disabled: {Msg}\", ex.Message); DisableChatLlmFeature(); }","preventionTips":["Surface architecture/OS support in the UI so users on Linux ARM64 see a disabled state instead of an error.","Add a startup platform probe logging RuntimeInformation.OSDescription and ProcessArchitecture.","Keep the GetUrl() matrix and your feature-gating matrix in one place to avoid drift."],"tags":["platform","arm64","linux","chatllm","download"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}