Hi,
I've been working on updating the game My Summer Love from Gemma 3 to Gemma 4. Llama.cpp has changed completely since the last version I used (May 2025).
Now, the main llama.cpp tool uses a client-server architecture, like other applications such as Ollama or LM Studio. The idea is to open a port and listen on that port, receiving the text produced by LLM.
However, although this approach is easier to implement, there are two main reasons I want to avoid:
1) Eliminating local network latency and data serialization.
2) Avoiding having two executables and opening a potentially problematic port.
Therefore, the video game has to work directly with RAM (as it currently does), that is, execute the llama.cpp instructions directly in the game code.
It hasn't been easy at all; the code is complicated:
Basically, there's a priority queue that assigns slots with the configurations corresponding to the task being executed: generating text, reading an LLM model, etc. But nothing that the powerful `printf` function can't handle to understand what the hell is it doing :D...
After a week of work, I've managed to create my version of a chat application with Gemma 4 :). The next step now is the saving system.