CherryHQ/cherry-studio · critical · Error

Local model inference is not supported on Intel Mac (darwin…

Error message

Local model inference is not supported on Intel Mac (darwin x64) — onnxruntime-node ships no darwin-x64 binding.

What it means

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.

Solutions

  1. Switch to an Apple Silicon Mac (arm64) where onnxruntime-node has a working native binding.
  2. Use a cloud-based embedding/OCR provider instead of local model inference on Intel Mac.
  3. If running under Rosetta 2, run the native arm64 binary of Electron/Node instead of the x64 version.
  4. Ensure the UI gating (LocalModelDownloadService.getStatus) is not bypassed by programmatic callers on Intel Mac.
Defensive patterns

Strategy: type-guard

Validate before calling

import { isDarwinX64 } from '@main/core/platform'

// Gate all inference calls on platform support
if (isDarwinX64) {
  logger.info('Local model inference is not available on Intel Mac — use a cloud provider')
  return null // or fall back to a cloud-based embedding/OCR service
}

Type guard

// Check platform support before any inference call
function supportsLocalInference(): boolean {
  return !isDarwinX64 // true on arm64 Mac, Linux, Windows; false on Intel Mac
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.


AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12). Data as JSON: /api/errors/4e869a320a7afa8d. Report an issue: GitHub.

Appendix: source

Thrown at src/main/ai/inference/InferenceServiceBase.ts:108

  private closing = false
  private readonly logger: ReturnType<typeof loggerService.withContext>

  protected constructor(kind: LocalModelKind) {
    super()
    this.logger = loggerService.withContext(`InferenceService:${kind}`)
  }

  private async ensureWorker(): Promise<Worker> {
    if (this.closing) {
      throw new Error('inference host is shutting down')
    }
    // Last line of defense: the settings/KB cards already hide on Intel Mac (see
    // LocalModelDownloadService.getStatus), but this is the spawn point every
    // caller (embed/loadEmbedding/recognize, including the OCR agent tool)
    // funnels through, so anything that reaches it programmatically fails fast
    // instead of loading a worker that will crash on the missing native binding.
    if (isDarwinX64) {
      throw new Error(
        'Local model inference is not supported on Intel Mac (darwin x64) — onnxruntime-node ships no darwin-x64 binding.'
      )
    }
    const generation = this.workerGeneration
    const proxyRouting = await application.get('ProxyService').getRoutingSnapshot()
    const runtimeProfile = resolveLocalInferenceProfile(
      application.get('PreferenceService').get('feature.local_model.hardware_acceleration.enabled')
    )
    if (generation !== this.workerGeneration) {
      throw new Error('inference host terminated')
    }
    if (this.closing) {
      throw new Error('inference host is shutting down')
    }
    if (this.worker && this.workerProxyVersion === proxyRouting.version && this.workerProfileId === runtimeProfile.id) {
      return this.worker
    }
    if (this.worker) {

View on GitHub (pinned to 726446b54c)