{"record":{"id":"4e869a320a7afa8d","repo":"CherryHQ/cherry-studio","slug":"local-model-inference-is-not-supported-on-intel-ma","errorCode":null,"errorMessage":"Local model inference is not supported on Intel Mac (darwin x64) — onnxruntime-node ships no darwin-x64 binding.","messagePattern":"Local model inference is not supported on Intel Mac \\(darwin x64\\) — onnxruntime-node ships no darwin-x64 binding\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/main/ai/inference/InferenceServiceBase.ts","lineNumber":108,"sourceCode":"  private closing = false\n  private readonly logger: ReturnType<typeof loggerService.withContext>\n\n  protected constructor(kind: LocalModelKind) {\n    super()\n    this.logger = loggerService.withContext(`InferenceService:${kind}`)\n  }\n\n  private async ensureWorker(): Promise<Worker> {\n    if (this.closing) {\n      throw new Error('inference host is shutting down')\n    }\n    // Last line of defense: the settings/KB cards already hide on Intel Mac (see\n    // LocalModelDownloadService.getStatus), but this is the spawn point every\n    // caller (embed/loadEmbedding/recognize, including the OCR agent tool)\n    // funnels through, so anything that reaches it programmatically fails fast\n    // instead of loading a worker that will crash on the missing native binding.\n    if (isDarwinX64) {\n      throw new Error(\n        'Local model inference is not supported on Intel Mac (darwin x64) — onnxruntime-node ships no darwin-x64 binding.'\n      )\n    }\n    const generation = this.workerGeneration\n    const proxyRouting = await application.get('ProxyService').getRoutingSnapshot()\n    const runtimeProfile = resolveLocalInferenceProfile(\n      application.get('PreferenceService').get('feature.local_model.hardware_acceleration.enabled')\n    )\n    if (generation !== this.workerGeneration) {\n      throw new Error('inference host terminated')\n    }\n    if (this.closing) {\n      throw new Error('inference host is shutting down')\n    }\n    if (this.worker && this.workerProxyVersion === proxyRouting.version && this.workerProfileId === runtimeProfile.id) {\n      return this.worker\n    }\n    if (this.worker) {","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/inference/InferenceServiceBase.ts#L90-L126","documentation":"Thrown by InferenceServiceBase.ensureWorker() as a hard platform guard on Intel Mac (darwin x64). The onnxruntime-node package ships no native binding for darwin-x64, so spawning a worker would crash immediately on import. This check is the 'last line of defense' — the settings UI and knowledge-base cards already hide local-model features on Intel Mac, but this catches any programmatic call (embed, loadEmbedding, recognize, OCR agent tool) that bypassed the UI gate.","triggerScenarios":"Called on every inference request path: EmbeddingInferenceService.embed()/loadEmbedding() and OcrInferenceService.recognize() all funnel through ensureWorker(). On darwin x64, the isDarwinX64 constant (from @main/core/platform) is true, so the error fires immediately before any worker spawn attempt.","commonSituations":"Running Cherry Studio on an Intel Mac (pre-Apple-Silicon) and a knowledge-base embedding or OCR task was triggered programmatically without going through the UI that hides these features; a corrupted or misdetected platform check; running under Rosetta 2 which may report as x64.","solutions":["Switch to an Apple Silicon Mac (arm64) where onnxruntime-node has a working native binding.","Use a cloud-based embedding/OCR provider instead of local model inference on Intel Mac.","If running under Rosetta 2, run the native arm64 binary of Electron/Node instead of the x64 version.","Ensure the UI gating (LocalModelDownloadService.getStatus) is not bypassed by programmatic callers on Intel Mac."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"import { isDarwinX64 } from '@main/core/platform'\n\n// Gate all inference calls on platform support\nif (isDarwinX64) {\n  logger.info('Local model inference is not available on Intel Mac — use a cloud provider')\n  return null // or fall back to a cloud-based embedding/OCR service\n}","typeGuard":"// Check platform support before any inference call\nfunction supportsLocalInference(): boolean {\n  return !isDarwinX64 // true on arm64 Mac, Linux, Windows; false on Intel Mac\n}","tryCatchPattern":null,"preventionTips":["Gate local-model UI features on platform detection — LocalModelDownloadService.getStatus already hides on Intel Mac.","Ensure all programmatic callers (embed, loadEmbedding, recognize, OCR agent tool) check supportsLocalInference() before calling.","When local inference is unavailable, provide a cloud-based fallback (e.g., OpenAI embeddings, cloud OCR).","If running under Rosetta 2, ensure the native arm64 binary is used instead of the x64 build."],"tags":["platform","darwin","intel-mac","onnxruntime","local-model","inference"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}