How to Run Local LLMs with Claude Code & OpenAI Codex
Run Claude Code and OpenAI Codex on your local device guide.
📖 Step #1: Install Llama.cpp Tutorial
1
apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev git-all -y
git clone https://github.com/ggml-org/llama.cpp
cmake llama.cpp -B llama.cpp/build \
-DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=ON
cmake --build llama.cpp/build --config Release -j --clean-first --target llama-cli llama-mtmd-cli llama-server llama-gguf-split
cp llama.cpp/build/bin/llama-* llama.cpp
2
3
Start the Llama-server
./llama.cpp/llama-server \
--model unsloth/GLM-4.7-Flash-GGUF/GLM-4.7-Flash-UD-Q4_K_XL.gguf \
--alias "unsloth/GLM-4.7-Flash" \
--fit on \
--temp 1.0 \
--top-p 0.95 \
--min-p 0.01 \
--port 8000 \
--jinja \
--kv-unified \
--cache-type-k q8_0 --cache-type-v q8_0 \
--flash-attn on \
--batch-size 4096 --ubatch-size 1024 \
--ctx-size 131072👾 Claude Code Tutorial
Install Claude Code and run it locally
curl -fsSL https://claude.ai/install.sh | bash
# Or via Homebrew: brew install --cask claude-codeexport ANTHROPIC_BASE_URL="http://localhost:8000"irm https://claude.ai/install.ps1 | iex$env:ANTHROPIC_BASE_URL="http://localhost:8000"🌟Running Claude Code locally on Linux / Mac / Windows




👾 OpenAI Codex CLI Tutorial
Install



Last updated
Was this helpful?


