google/gemma.cpp — reverse-engineered prompt

Reverse engineered prompt

Build me a lightweight local C++ inference app for Google Gemma that I can compile and run on my own machine. I want it to be simple and fast, CPU only, with a basic interactive command line chat mode, plus a small C++ API and basic Python bindings so I can embed it in other projects later.

It should load Gemma model weights and the tokenizer from the files downloaded from Kaggle, then let me generate text with streaming output. Please include common controls like temperature and top k sampling, and support single prompts and batched inference if that is already part of the project. If the repo already supports Gemma 2, Gemma 3, and PaliGemma 2, keep that working too.

Please make the build flow straightforward with CMake, and make sure it works on Linux, with reasonable support for Windows and Mac if possible. Add clear README instructions for getting the weights, building, and running a first prompt so someone lightly technical can get from clone to working output without guessing. Look up current docs online if you need to.

Want more depth? Deep Reverse