node-llama-cpp icon indicating copy to clipboard operation
node-llama-cpp copied to clipboard

feat: `gemma4` model architecture

Open ittaboba opened this issue 7 months ago • 8 comments

Issue description

Gemma 4 E4B model loading fails

Expected Behavior

The loading of the model succeeds.

Actual Behavior

I am trying to load this model but it fails.

Here are the logs: error_logs.rtf

Steps to reproduce

Try to load this model using node-llama-cpp version 3.18.1

My Environment

Dependency Version
Operating System macOS 24.3.0 (arm64)
CPU Apple M4 Pro
Node.js version 22.21.1
Typescript version 5.9.3
node-llama-cpp version 3.18.1

npx --yes node-llama-cpp inspect gpu output:

Result of running `npx --yes node-llama-cpp inspect gpu`

Additional Context

No response

Relevant Features Used

  • [ ] Metal support
  • [ ] CUDA support
  • [ ] Vulkan support
  • [ ] Grammar
  • [ ] Function calling

Are you willing to resolve this issue by submitting a Pull Request?

No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

ittaboba avatar Apr 10 '26 10:04 ittaboba

@ittaboba Same issue here. I used the command below as a workaround for now. Just sharing in case it helps!

npx node-llama-cpp source download --release b8808

nunupy345345 avatar Apr 28 '26 01:04 nunupy345345

Any progress on this one?

sweetpalma avatar May 21 '26 21:05 sweetpalma

@sweetpalma I'm actively working on it in #591, currently stabilizing it as it's going to be a significant release

giladgd avatar May 21 '26 22:05 giladgd

@giladgd thank you very much. Honestly, I'm surprised by the latest Gemma capabilities, and very eager to use within my project.

sweetpalma avatar May 28 '26 01:05 sweetpalma

Just sharing what worked for me, I built from source with version b8678 (npx node-llama-cpp source build).

  • The default version didn't support Gemma 4
  • And the latest versions gave me compiler errors

→ So b8678 was the only version that compiled perfectly and loaded the models without any issues.

daanta-real avatar Jun 03 '26 12:06 daanta-real

Just sharing what worked for me, I built from source with version b8678 (npx node-llama-cpp source build).

  • The default version didn't support Gemma 4
  • And the latest versions gave me compiler errors

→ So b8678 was the only version that compiled perfectly and loaded the models without any issues.

To me it keeps failing with the error:

-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.9/include (found version "12.9.86") -- CUDA Toolkit found CMake Error at C:/Program Files/CMake/share/cmake-4.2/Modules/CMakeDetermineCompilerId.cmake:676 (message): No CUDA toolset found.

onzag avatar Jun 21 '26 10:06 onzag

Just sharing what worked for me, I built from source with version b8678 (npx node-llama-cpp source build).

  • The default version didn't support Gemma 4
  • And the latest versions gave me compiler errors

→ So b8678 was the only version that compiled perfectly and loaded the models without any issues.

To me it keeps failing with the error:

-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.9/include (found version "12.9.86") -- CUDA Toolkit found CMake Error at C:/Program Files/CMake/share/cmake-4.2/Modules/CMakeDetermineCompilerId.cmake:676 (message): No CUDA toolset found.

@onzag That error is a VS/CUDA toolchain setup issue, unrelated to b8678 itself - CMake can't find the CUDA MSBuild toolset.

Fix: copy the files from CUDA\v12.9\extras\visual_studio_integration\MSBuildExtensions\ into your VS's MSBuild\Microsoft\VC\<vc_version>\BuildCustomizations\ folder, or just reinstall CUDA Toolkit with VS already installed.

That should let CMake pick up the CUDA toolset properly.

daanta-real avatar Jun 21 '26 16:06 daanta-real

:tada: This issue has been resolved in version 3.19.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Jun 30 '26 01:06 github-actions[bot]