A developer has successfully run the Gemma 4 language model directly within the Godot game engine without relying on llama.cpp, Python, external servers, or GDExtensions.

  • The project utilizes a GGUF file for local execution of the model.
  • Vulkan compute shaders handle the model calculations.
  • GDScript manages GGUF loading, tokenization, sampling, the KV cache, and the chat UI.
  • The implementation is approximately 10 times slower than llama.cpp with CUDA.

This experiment demonstrates that it is possible to integrate LLMs into Godot using only its native scripting and graphics capabilities.