Pi Agent and llama.cpp: local coding setup and skills

Set up Pi Agent with llama.cpp on Windows, build an HTML game, add SKILL.md instructions, and review code changes with Git.

Player not loading? Watch on YouTube

This tutorial connects Pi Agent to a llama.cpp server on Windows and uses the coding assistant to build a tic-tac-toe game. The speaker describes Pi as a lightweight model harness with tools to read, edit and write files and run Bash commands.

The setup starts with Pi's installation command from pi.dev. It assumes llama.cpp is already installed; the speaker points to a separate tutorial for that step. After starting the server with a folder containing GGUF models, he checks its browser chat, selects llama.cpp through Pi's /login command, accepts the default URL and leaves the API key blank. He then selects a local LLM with /model.

Pi creates index.html and adds a score tracker. Resetting the game produces an incorrect draw count. The speaker suspects the 4 billion parameter model and switches to a 27 billion parameter model with MTP. The subsequent check appears successful, but this example does not establish that model size caused the bug.

The skills section creates an HTML separator SKILL.md under Pi's user skills directory. After /reload, the speaker invokes it with /skill to split the game into HTML, CSS and JavaScript files. He also describes Matt Pocock's Grill Me skill as a way to clarify requirements through questions. Finally, he uses a locally hosted Forgejo repository and Zed's Git panel to inspect a CSS change, then asks Pi to commit and push it.