abhigyanpatwari/GitNexus · error · Error

Local semantic embeddings are unavailable on macOS Intel (da

Error message

Local semantic embeddings are unavailable on macOS Intel (darwin/x64).
The bundled ONNX Runtime package (onnxruntime-node) does not ship a
darwin/x64 native binding, so the local embedding model cannot load here.
ONNX_WEB_BACKEND=wasm does not help: the failure happens while importing
the native runtime, before any backend can be selected. Forcing
GITNEXUS_EMBEDDING_DEVICE=wasm (or cpu) does not help either, for the same reason.

Use one of these instead:
  - Run analyze without --embeddings (all other indexing still works).
  - Point GITNEXUS_EMBEDDING_URL (with GITNEXUS_EMBEDDING_MODEL) at an
    OpenAI-compatible /v1/embeddings endpoint to embed over HTTP.
  - Run GitNexus on Linux or in Docker, where the native binding ships.
  - Run GitNexus on Apple Silicon (darwin/arm64), which ships a binding.
  - Use a future GitNexus build that restores darwin/x64 ONNX support.

What it means

initEmbedder fails fast when getLocalEmbeddingRuntimeBlocker() reports that the current platform (macOS Intel, darwin/x64) has no bundled onnxruntime-node native binding (#1515/#1516). The check runs before any transformers.js/onnxruntime-node import so the user gets structured guidance instead of a raw 'Cannot find module ...onnxruntime_binding.node' crash that no backend selection (ONNX_WEB_BACKEND=wasm, GITNEXUS_EMBEDDING_DEVICE) can rescue.

Source

Thrown at gitnexus/src/mcp/core/embedder.ts:57

let isInitializing = false;
let initPromise: Promise<FeatureExtractionPipeline> | null = null;

/**
 * Initialize the embedding model (lazy, on first search)
 */
export const initEmbedder = async (): Promise<FeatureExtractionPipeline> => {
  if (isHttpMode()) {
    throw new Error('initEmbedder() should not be called in HTTP mode.');
  }

  // Fail fast on platforms where the bundled native ONNX Runtime binding is not
  // shipped (macOS Intel, #1515). Must run before any transformers.js /
  // onnxruntime-node import or resolution — otherwise the native module load
  // crashes with a raw "Cannot find module ...onnxruntime_binding.node" that
  // ONNX_WEB_BACKEND=wasm cannot rescue (#1516).
  const runtimeBlocker = getLocalEmbeddingRuntimeBlocker();
  if (runtimeBlocker) {
    throw new Error(runtimeBlocker);
  }

  if (embedderInstance) {
    return embedderInstance;
  }

  if (isInitializing && initPromise) {
    return initPromise;
  }

  isInitializing = true;

  initPromise = (async () => {
    try {
      // Lazy-load transformers.js only after the runtime guard has passed, so
      // unsupported platforms never reach the native ONNX import (#1515).
      // Registered FIRST so it sits last in the hook chain (registerHooks runs
      // the most recent hook first): when the optional stack was pruned at

View on GitHub (pinned to aac7515d2a)

Solutions

  1. Run analyze without --embeddings — all other indexing still works.
  2. Point GITNEXUS_EMBEDDING_URL (with GITNEXUS_EMBEDDING_MODEL) at an OpenAI-compatible /v1/embeddings endpoint to embed over HTTP.
  3. Run GitNexus on Linux or in Docker, where the native binding ships.
  4. Run on Apple Silicon (darwin/arm64), which ships a binding.
  5. Track for a future GitNexus build that restores darwin/x64 ONNX support.

Example fix

# before: local embeddings on Intel macOS
$ gitnexus analyze --embeddings
# → long 'unavailable on macOS Intel (darwin/x64)' error

# after: HTTP embeddings via an OpenAI-compatible endpoint
$ export GITNEXUS_EMBEDDING_URL=https://api.openai.com/v1/embeddings
$ export GITNEXUS_EMBEDDING_MODEL=text-embedding-3-small
$ export GITNEXUS_EMBEDDING_API_KEY=sk-...
$ gitnexus analyze --embeddings
Defensive patterns

Strategy: validation

Validate before calling

// Gate embeddings on platform before invoking any embedding feature
function localEmbeddingsSupported(): boolean {
  const { platform, arch } = process;
  return !(platform === 'darwin' && arch === 'x64'); // darwin/x64 ships no onnxruntime-node binding
}

const useEmbeddings = flags.embeddings && localEmbeddingsSupported();
const useHttp = Boolean(process.env.GITNEXUS_EMBEDDING_URL);

Try / catch

try {
  await runAnalyze({ embeddings: true });
} catch (err) {
  if (err instanceof Error && err.message.includes('unavailable on macOS Intel')) {
    // platform limitation, retrying cannot help: continue without embeddings or switch to HTTP mode
    await runAnalyze({ embeddings: false });
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Running `gitnexus analyze --embeddings`, or any MCP query-time semantic search that initializes the local embedder, on an Intel Mac (darwin/x64). The throw happens unconditionally on that platform regardless of env-var overrides.

Common situations: Teams on Intel MacBooks discovering semantic search fails after upgrading; CI jobs pinned to macos-13 (x64) runners while local devs are on Apple Silicon; Docker-averse users trying to enable --embeddings locally; users following docs that assume darwin/arm64.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@aac7515d2a (2026-08-20). Data as JSON: /api/errors/cda151c1d152087d. Report an issue: GitHub.