GitHub

Snake

direction: R turn: 0/57 score: 0 length: 3 press an arrow key to start

What is this?

This is a snake game, running on an ollama server that serves a custom .gguf file. This .gguf file is not a model, it has not been built via training, it has been handcrafted to be able to receive inputs from the user (as tokens), and answers with the new position of the snake head and the current state.

Every 700ms the frontend sends the server its input, as always with the whole game history: the server has no state, and no idea of where the snake is. It will compute it using all of the inputs it receive, not using some stochastic learned method, but with good old deterministic computations.

Attention heads read the input at fixed offsets, so that they extract the latest move, the food position. The MLP compute the transition cell + move = new cell, and check for food and collisions.