Run Codex CLI with Local LLM - Gemma4 with llama.cpp on WSL2
This guide details how to set up the Codex CLI to interact with a local LLM, specifically Gemma-4, using llama.cpp on Windows Subsystem for Linux (WSL2). The process involves installing Codex, configuring it to use llama.cpp as a model provider, and then running the llama.cpp server with the Gemma-4 model. The author shares specific commands and configuration file examples, including troubleshooting a context size error. AI
IMPACT Enables developers to run LLM tools locally, reducing reliance on cloud services and potentially improving privacy.