S&Box LLM POC is a proof of concept demonstrating that a transformer language model can run entirely inside the s&box game runtime without external AI software, servers, APIs, Python, Ollama, or separate executables.
The project includes a custom C# inference engine capable of loading packaged model weights, GPT-2 tokenization, GPT-Neo transformer inference, global and local attention, and autoregressive text generation directly within s&box.
The current implementation runs TinyStories-Instruct-1M locally on the CPU and has been numerically validated against the original PyTorch/Hugging Face model. Generated token sequences match the reference implementation while inference runs on an s&box worker thread to keep the game responsive.
The end goal of the POC is a simple in-game chat interface powered entirely by an LLM running inside s&box itself.
From this, I hope other developers can see what is possible and potentially use small LLM to power NPCs, game functions or even whole games.