{
  "id": 22084079,
  "title": "Self-Hosting a Local LLM on AMD GPUs with llama.cpp: From Build to a Private OpenAI-Compatible API",
  "url": "https://urgent.news/2026/11/27/self-hosting-a-local-llm-on-amd-gpus-with-llama-cpp-from-build-to-a",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-27T00:55:35.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/eme_gug_0821b41b948be6516/self-hosting-a-local-llm-on-amd-gpus-with-llamacpp-from-build-to-a-private-openai-compatible-api-429a"
  },
  "original_language": "en",
  "account": "After self-hosting became more straightforward, it has returned to being enjoyable. Running a Large Language Model (LLM) on your own machine allows for a private OpenAI-compatible API without worrying about data leaving your device or incurring token-based costs. However, most online guides assume you have an NVIDIA card. Many developers in Vietnam, on the other hand, use AMD cards (RX 6700 XT, RX 7900 XTX) or mini PCs with integrated GPUs (iGPU) due to the lower cost. This article documents the author's experience of building llama.cpp for AMD, selecting the backend, building an OpenAI-compatible API, and running it as a service.\n\nThere are two main paths for AMD with llama.cpp: ROCm/HIP (-DGGML_HIP=ON) and Vulkan (-DGGML_VULKAN=ON). ROCm/HIP offers the official AMD compute stack, typically providing the best prompt processing speed. It is, however, more challenging to set up as ROCm 6.x only officially supports a limited number of GPUs, primarily RDNA2/RDNA3 high-end lines, and performs best on Ubuntu 22.04/24.04. Vulkan, on the other hand, requires only the Mesa (RADV) driver, and most cards, including iGPUs, should work. Recent builds have shown that Vulkan's token generation speed is very close to ROCm, sometimes even faster. The author's experience suggests trying Vulkan first, as it usually takes a few minutes to build without the challenges of setting up ROCm.\n\nThe flowchart for choosing the backend based on the AMD card and prompt processing needs is as follows: Card AMD -> ROCm available? (No/No iGPU) -> Vulkan backend, ROCm/HIP backend respectively. After building llama.cpp and benchmarking, compare the results using llama-bench. For the Vulkan backend, choose based on VRAM and required prompt processing speed (Q4_K_M for 7B–8B models on 12GB cards, Q6_K for 14B on 24GB cards). The -ngl 99 flag offloads the entire layer to the GPU. If OOM occurs, gradually decrease the number. For the API compatible with OpenAI using llama-server, llama.cpp already provides an endpoint at /v1/chat/completions, following the OpenAI standard. Code using the OpenAI SDK needs only the base_url to be changed to the local server address.",
  "summary": "Hồi trước, self-host thường có nghĩa là ngồi debug config Nginx lúc 2 giờ sáng. Giờ thì khác. Chạy được một LLM ngay trên máy mình, có API riêng, không lo data rời khỏi máy và không bị tính tiền theo token, làm cho self-host vui trở lại. Vấn đề là đa số hướng dẫn trên mạng mặc định bạn có card NVIDIA. Trong khi đó, nhiều anh em dev ở Việt Nam đang xài card AMD (RX 6700 XT, RX 7900 XTX) hoặc mini…",
  "key_points": [
    "AMD GPUs like RX 6700 XT, RX 7900 XTX, and integrated GPUs can self-host LLMs.",
    "Choose ROCm/HIP backend for best performance, Vulkan backend for compatibility with most AMD cards.",
    "llama-server provides OpenAI-compatible API endpoint for local LLM service."
  ],
  "editors_take": "Expanding local LLM capabilities to AMD hardware lowers the barrier for developers using budget-friendly GPUs and integrated graphics to maintain private, cost-effective alternatives to cloud-based AI services.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}