openclaw - 💡(How to fix) Fix [Bug]: node-llama-cpp optional=true, cause GPU acceleration cannot be leveraged [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#48987Fetched 2026-04-08 00:50:07
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×2commented ×1

In the new OpenClaw code released after March 9, 2026, the following configuration is present in the package.json file:

"peerDependencies": {
  "@napi-rs/canvas": "^0.1.89",
  "node-llama-cpp": "3.16.2"
},
"peerDependenciesMeta": {
  "node-llama-cpp": {
    "optional": true
  }
}

The node-llama-cpp package is marked as an optional peer dependency here. As a result, it will not be installed automatically when you install OpenClaw via npm. This leads to the following issue: when the memorySearch feature is configured some like: provider=localand modelPath=embeddinggemma-300m-qat-Q8_0.gguf, GPU acceleration cannot be leveraged. The local model indexing process will run entirely on the CPU, resulting in an extremely long execution time.

Root Cause

In the new OpenClaw code released after March 9, 2026, the following configuration is present in the package.json file:

"peerDependencies": {
  "@napi-rs/canvas": "^0.1.89",
  "node-llama-cpp": "3.16.2"
},
"peerDependenciesMeta": {
  "node-llama-cpp": {
    "optional": true
  }
}

The node-llama-cpp package is marked as an optional peer dependency here. As a result, it will not be installed automatically when you install OpenClaw via npm. This leads to the following issue: when the memorySearch feature is configured some like: provider=localand modelPath=embeddinggemma-300m-qat-Q8_0.gguf, GPU acceleration cannot be leveraged. The local model indexing process will run entirely on the CPU, resulting in an extremely long execution time.

Code Example

"peerDependencies": {
  "@napi-rs/canvas": "^0.1.89",
  "node-llama-cpp": "3.16.2"
},
"peerDependenciesMeta": {
  "node-llama-cpp": {
    "optional": true
  }
}

---

"memorySearch": {
        "sources": [
          "memory",
          "sessions"
        ],
        "extraPaths": [
          "F:\\qlib\\docs"
        ],
        "experimental": {
          "sessionMemory": true
        },
        "provider": "local",
        "fallback": "none",
        "local": {
          "modelPath": "C:\\Users\\Administrator\\.node-llama-cpp\\models\\embeddinggemma-300m-qat-Q8_0.gguf"
        },
        "sync": {
          "watch": true
        },
        "query": {
          "hybrid": {
            "enabled": true,
            "vectorWeight": 0.7,
            "textWeight": 0.3,
            "candidateMultiplier": 4,
            "mmr": {
              "enabled": true,
              "lambda": 0.7
            }
          }
        }
      },

---
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

In the new OpenClaw code released after March 9, 2026, the following configuration is present in the package.json file:

"peerDependencies": {
  "@napi-rs/canvas": "^0.1.89",
  "node-llama-cpp": "3.16.2"
},
"peerDependenciesMeta": {
  "node-llama-cpp": {
    "optional": true
  }
}

The node-llama-cpp package is marked as an optional peer dependency here. As a result, it will not be installed automatically when you install OpenClaw via npm. This leads to the following issue: when the memorySearch feature is configured some like: provider=localand modelPath=embeddinggemma-300m-qat-Q8_0.gguf, GPU acceleration cannot be leveraged. The local model indexing process will run entirely on the CPU, resulting in an extremely long execution time.

Steps to reproduce

npm install -g openclaw@latest install openclaw.

configure openclaw.json:

"memorySearch": {
        "sources": [
          "memory",
          "sessions"
        ],
        "extraPaths": [
          "F:\\qlib\\docs"
        ],
        "experimental": {
          "sessionMemory": true
        },
        "provider": "local",
        "fallback": "none",
        "local": {
          "modelPath": "C:\\Users\\Administrator\\.node-llama-cpp\\models\\embeddinggemma-300m-qat-Q8_0.gguf"
        },
        "sync": {
          "watch": true
        },
        "query": {
          "hybrid": {
            "enabled": true,
            "vectorWeight": 0.7,
            "textWeight": 0.3,
            "candidateMultiplier": 4,
            "mmr": {
              "enabled": true,
              "lambda": 0.7
            }
          }
        }
      },

Expected behavior

node-llama-cpp node moudle installed and runing local model use GPU

Actual behavior

CPU only

OpenClaw version

2026.3.9

Operating system

windows11

Install method

No response

Model

kimi2.3

Provider / routing chain

openclaw->kimi-coding/k2p5

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To fix the issue, you need to install the node-llama-cpp package manually since it's marked as an optional peer dependency. Here are the steps:

  • Install node-llama-cpp using npm:
npm install [email protected]
  • Verify that the package is installed correctly by checking the node_modules directory:
dir node_modules\node-llama-cpp
  • Update the openclaw.json configuration file to include the correct path to the node-llama-cpp model:
"memorySearch": {
  ...
  "local": {
    "modelPath": "C:\\Users\\Administrator\\.node-llama-cpp\\models\\embeddinggemma-300m-qat-Q8_0.gguf"
  }
  ...
}
  • Restart the OpenClaw service to apply the changes.

Verification

To verify that the fix worked, check the OpenClaw logs for any errors related to GPU acceleration. You can also use tools like nvidia-smi (for NVIDIA GPUs) or gpu-z (for AMD GPUs) to monitor GPU usage.

Extra Tips

  • Make sure that your system meets the requirements for running node-llama-cpp with GPU acceleration.
  • If you're using a virtual environment, ensure that the node-llama-cpp package is installed in the correct environment.
  • You can also try updating the node-llama-cpp package to the latest version to see if it resolves the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

node-llama-cpp node moudle installed and runing local model use GPU

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: node-llama-cpp optional=true, cause GPU acceleration cannot be leveraged [1 comments, 2 participants]