diff --git a/Makefile b/Makefile index 40da9a28d..77a7e9016 100644 --- a/Makefile +++ b/Makefile @@ -738,7 +738,7 @@ endif # the atomic-chat-conf manifest (Windows/Linux), e.g.: # make download-llamacpp-upstream-backend LLAMACPP_UPSTREAM_TAG=b9222 # make download-llamacpp-upstream-backend LLAMACPP_UPSTREAM_TAG= -LLAMACPP_UPSTREAM_TAG ?= b9937 +LLAMACPP_UPSTREAM_TAG ?= b10063 download-llamacpp-upstream-backend: ifeq ($(shell uname -s),Darwin) @rm -rf src-tauri/resources/llamacpp-backend-upstream diff --git a/extensions/llamacpp-upstream-extension/src/backend.ts b/extensions/llamacpp-upstream-extension/src/backend.ts index 2ecb679ff..7caa780a1 100644 --- a/extensions/llamacpp-upstream-extension/src/backend.ts +++ b/extensions/llamacpp-upstream-extension/src/backend.ts @@ -39,14 +39,14 @@ const MANIFEST_FETCH_TIMEOUT_MS = 8_000 // than the live manifest until the network recovers. Update this whenever // the atomic-chat-conf manifest is updated. const BUNDLED_MANIFEST_BASELINE = { - tag_name: 'b9937', + tag_name: 'b10063', assets: [ - { name: 'llama-b9937-bin-win-cpu-x64.zip' }, - { name: 'llama-b9937-bin-win-cuda-12.4-x64.zip' }, - { name: 'llama-b9937-bin-win-cuda-13.3-x64.zip' }, - { name: 'llama-b9937-bin-win-vulkan-x64.zip' }, - { name: 'llama-b9937-bin-ubuntu-x64.tar.gz' }, - { name: 'llama-b9937-bin-ubuntu-vulkan-x64.tar.gz' }, + { name: 'llama-b10063-bin-win-cpu-x64.zip' }, + { name: 'llama-b10063-bin-win-cuda-12.4-x64.zip' }, + { name: 'llama-b10063-bin-win-cuda-13.3-x64.zip' }, + { name: 'llama-b10063-bin-win-vulkan-x64.zip' }, + { name: 'llama-b10063-bin-ubuntu-x64.tar.gz' }, + { name: 'llama-b10063-bin-ubuntu-vulkan-x64.tar.gz' }, { name: 'cudart-llama-bin-win-cuda-12.4-x64.zip' }, { name: 'cudart-llama-bin-win-cuda-13.3-x64.zip' }, ], @@ -443,14 +443,14 @@ export async function fetchRemoteBackends(): Promise { * Builds the download URL for a specific backend version from ggml-org/llama.cpp. * * Asset naming differs by platform: - * - macOS: `llama-{tag}-bin-macos-{arm64,x64}.zip` + * - macOS: `llama-{tag}-bin-macos-{arm64,x64}.tar.gz` * - Windows: `llama-{tag}-bin-win-{variant}.zip` * - Linux: `llama-{tag}-bin-ubuntu-{variant}.tar.gz` (note: internal * backend ids are `linux-*` but upstream filenames carry `ubuntu-*`; * `LINUX_UPSTREAM_ASSET_BY_BACKEND` provides the mapping). * - * macOS / Windows use `.zip`, Linux uses `.tar.gz`. The Tauri `decompress` - * command handles both formats transparently. + * Only Windows uses `.zip`; macOS and Linux use `.tar.gz`. The Tauri + * `decompress` command handles both formats transparently. */ export function getBackendDownloadUrl( version: string, @@ -472,6 +472,12 @@ export function getBackendDownloadUrl( if (linuxInfix) { return `${LLAMACPP_DOWNLOAD_BASE}/${version}/llama-${version}-bin-${linuxInfix}.tar.gz` } + // ggml-org publishes macOS backends only as `.tar.gz` (there is no macOS + // `.zip` asset), so a `.zip` URL here is a guaranteed 404 and the runtime + // backend download silently fails on macOS. Only Windows ships `.zip`. + if (backend.startsWith('macos-')) { + return `${LLAMACPP_DOWNLOAD_BASE}/${version}/llama-${version}-bin-${backend}.tar.gz` + } return `${LLAMACPP_DOWNLOAD_BASE}/${version}/llama-${version}-bin-${backend}.zip` } @@ -482,6 +488,10 @@ export function getBackendArchiveName(version: string, backend: string): string if (linuxInfix) { return `llama-${version}-bin-${linuxInfix}.tar.gz` } + // Mirrors getBackendDownloadUrl: macOS assets are `.tar.gz`, not `.zip`. + if (backend.startsWith('macos-')) { + return `llama-${version}-bin-${backend}.tar.gz` + } return `llama-${version}-bin-${backend}.zip` } diff --git a/extensions/llamacpp-upstream-extension/src/index.ts b/extensions/llamacpp-upstream-extension/src/index.ts index 131a83504..4e9367d71 100644 --- a/extensions/llamacpp-upstream-extension/src/index.ts +++ b/extensions/llamacpp-upstream-extension/src/index.ts @@ -194,7 +194,7 @@ function modelLoadReadyTimeoutSecs(configuredTimeoutSecs: number): number { /// (`LLAMACPP_UPSTREAM_TAG`) and `atomic-chat-conf/backends/manifest.json` /// (`tag_name`). Remove (or move to a real settings-driven pin) once the /// team is done validating this tag broadly. See `enforcePinnedBackendVersion`. -const PINNED_BACKEND_TAG = 'b9937' +const PINNED_BACKEND_TAG = 'b10063' /** * Override the default app.log function to use Jan's logging system. @@ -4967,9 +4967,9 @@ export default class llamacpp_upstream_extension extends AIEngine { * Downloads a backend archive from ggml-org/llama.cpp GitHub releases * and extracts it into the local backends directory. * - * ggml-org publishes Windows and macOS backends as `.zip` archives - * (not `.tar.gz`). The Tauri `decompress` command handles both formats, - * so the extension change here is transparent to the extraction path. + * ggml-org publishes Windows backends as `.zip` archives and macOS / + * Linux backends as `.tar.gz`. The Tauri `decompress` command handles + * both formats, so the difference is transparent to the extraction path. */ private async downloadAndInstallBackend( backendString: string diff --git a/extensions/llamacpp-upstream-extension/src/test/backend.test.ts b/extensions/llamacpp-upstream-extension/src/test/backend.test.ts index 6a2174c40..88f9440d7 100644 --- a/extensions/llamacpp-upstream-extension/src/test/backend.test.ts +++ b/extensions/llamacpp-upstream-extension/src/test/backend.test.ts @@ -74,11 +74,21 @@ describe('Backend functions', () => { ) }) - it('keeps zip archive names for non-Linux backend archives', () => { + it('keeps zip archive names for Windows backend archives', () => { expect(getBackendArchiveName('b9691', 'win-cpu-x64')).toBe( 'llama-b9691-bin-win-cpu-x64.zip' ) }) + + it('uses tarball names for macOS backend archives', () => { + // ggml-org publishes macOS assets only as .tar.gz; a .zip name 404s. + expect(getBackendArchiveName('b9691', 'macos-arm64')).toBe( + 'llama-b9691-bin-macos-arm64.tar.gz' + ) + expect(getBackendArchiveName('b9691', 'macos-x64')).toBe( + 'llama-b9691-bin-macos-x64.tar.gz' + ) + }) }) describe('getBackendDir and getBackendExePath', () => {