Running 30B LLMs on Mini PCs: A Practical Guide to iGPU Local Inference

    Running large language models locally has traditionally been limited by VRAM capacity and hardware costs. This guide explains how mini PCs equipped with powerful integrated GPUs (iGPUs) and unified memory can run 30B-parameter models using the Vulkan backend in llama.cpp. It covers hardware selection, BIOS and driver configuration, compilation steps, performance tuning, and integration with AI agent workflows, offering a cost-effective solution for privacy-preserving, offline AI applications.

    1. Why Mini PCs Can Run Large Models

    Running large language models locally has long been constrained by two factors: VRAM capacity and hardware costs. Even with 4-bit quantization, a 30B-parameter model requires around 18GB of storage for its weight files. However, common discrete graphics cards typically only offer 4GB to 16GB of VRAM, which is insufficient to load the entire model. While cloud APIs can solve the compute problem, they pose ongoing costs and data privacy risks for agent workflows that require data protection, offline execution, or high-frequency calls.

    In recent years, mini PCs equipped with powerful integrated GPUs (iGPUs) and large-capacity unified memory have become increasingly popular. Although they lack discrete graphics cards, they allow the iGPU to directly utilize system memory, providing a more cost-effective path for local inference.

    2. Working Principle: Unified Memory and Vulkan

    2.1 How Unified Memory Works

    In a traditional discrete GPU architecture, the CPU and GPU each maintain their own independent memory, requiring data to be copied back and forth across the PCIe bus. In an iGPU with unified memory architecture, the iGPU and CPU share the same physical memory. The inference framework can place the model weights in system memory, allowing the iGPU to read and compute directly, bypassing cross-device copying.

    Whether this approach can leverage large memory capacities depends on three conditions: the shared video memory size allocated by the BIOS, the available VRAM heap size reported by the driver to the framework, and the framework’s native support. If any of these are missing, the model can only be partially loaded or will fail to load entirely.

    2.2 The Vulkan Backend

    Taking the AMD Radeon 780M iGPU as an example, llama.cpp provides a Vulkan compute backend. The key features of Vulkan include:

    • Cross-vendor: It does not rely on CUDA, meaning both AMD and Intel iGPUs can use it.
    • Lower driver overhead and efficient operator scheduling.
    • Runs using the system’s built-in iGPU drivers without requiring an additional discrete GPU driver stack.

    2.3 Inference Pipeline

    1. User Input -> Tokenizer -> Model Weights (located in system memory)
    2. -> Vulkan backend schedules to iGPU
    3. -> Token-by-token decoding -> Detokenizer -> Output

    The weights reside in shared memory, and the iGPU reads and executes matrix operations layer by layer without cross-device copying in between. This is the primary reason mini PCs can host large models.

    3. Pre-Deployment Preparation

    3.1 Hardware Selection

    • iGPU: Choose a relatively new iGPU, such as the RDNA3 architecture (the 780M falls into this category). The iGPU’s compute power directly determines the generation speed.
    • Memory Capacity: 32GB can load an 18GB 30B quantized model, but the system and other programs will consume a significant amount of space, leaving a tight margin. 64GB is a more secure choice and allows for larger context windows.
    • Memory Frequency and Channels: Higher frequencies provide greater available bandwidth for the iGPU. It is crucial to set up dual-channel memory; single-channel memory significantly reduces iGPU bandwidth and directly slows down tok/s.

    Costs depend on the overall configuration and memory capacity. The community case mentioned in this article had a total machine cost under $750, though actual prices may vary.

    3.2 BIOS and Driver Settings

    1. Enter the BIOS and look for the UMA Frame Buffer Size or a similar option, setting the shared video memory to a larger value. Different motherboards have different option names and limits, so consult the machine’s manual before adjusting. Some models lack this option and instead adjust it via Variable Graphics Memory in AMD Software.
    2. Install the latest AMD graphics driver to ensure the system recognizes Vulkan 1.3 or higher.
    3. Install the Vulkan SDK, which is required to compile the Vulkan backend for llama.cpp.
    4. Verify dual-channel memory: Open CPU-Z and confirm that the Channels field on the Memory tab displays as Dual.

    After setup, verify that the system’s available shared video memory has increased. The exact value will be reflected in the framework’s startup logs.

    3.3 Compiling llama.cpp with the Vulkan Backend

    You will need to pre-install CMake, Git, and Visual Studio Build Tools. Execute the following in PowerShell:

    1. git clone https://github.com/ggml-org/llama.cpp
    2. cd llama.cpp
    3. cmake -B build -DGGML_VULKAN=ON
    4. cmake --build build --config Release

    After compilation, the build\bin\Release directory will contain tools like llama-server.exe and llama-bench.exe. When starting the server, the appearance of the Vulkan device name in the logs indicates that the backend has recognized the iGPU. If no Vulkan device appears in the logs, first verify that the driver and Vulkan SDK are installed correctly.

    3.4 Models and Quantization

    You can download pre-existing GGUF format models from Hugging Face or use the conversion and quantization tools included with llama.cpp to generate them yourself. This article uses Q4_K_M quantization as an example, as it offers a good balance between file size and quality.

    Choosing a Mixture of Experts (MoE) architecture model is key to speeding up inference. MoE models only activate a small number of expert parameters per token, making the actual compute load much smaller than a dense model with the same total parameter count. For example, a model with around 30B total parameters and roughly 3B active parameters can achieve a usable generation speed on an iGPU.

    4. Launching the Service and Key Parameters

    4.1 Launch Command

    The default launch method, which only allows local access, is as follows:

    1. llama-server -m model-q4_k_m.gguf -ngl 99 \
    2. -c 8192 --host 127.0.0.1 --port 8080
    • -m: Path to the model file;
    • -ngl 99: Offloads all layers to the GPU for execution, letting the iGPU handle the computation;
    • -c 8192: Context length;
    • --host 127.0.0.1: Listens only on the local loopback address.

    4.2 Security Settings for LAN Access

    If other devices need access, change the listening address to 0.0.0.0 and ensure the following conditions are met:

    • Only open port 8080 in the Windows Firewall for trusted IP segments;
    • Use --api-key to set an access key, for example, --api-key replace_with_a_sufficiently_long_random_string;
    • Do not map the port to the public internet. For remote access, connect via a VPN or a reverse proxy with TLS.

    Full example:

    1. llama-server -m model-q4_k_m.gguf -ngl 99 -c 8192 \
    2. --host 0.0.0.0 --port 8080 --api-key replace_with_a_random_string

    Listening on 0.0.0.0 without setting a key allows any device on the LAN to directly call the model; this should be avoided.

    4.3 Key Parameter Tuning

    • Context Length (-c): A longer context requires more memory for the KV Cache. Set it according to actual needs to avoid squeezing the memory required for the weights.
    • Thread Count (-t): There is no fixed ratio. It is recommended to start with the number of physical cores and use llama-bench to test both higher and lower thread counts, selecting the one that yields the fastest generation speed.
    • Memory Locking: Some systems can try locking memory pages to reduce stuttering caused by paging. The effect varies by machine, so rely on actual testing.

    5. Performance Testing and Results

    Inference speed should be measured using llama-bench, with the metric being token generation speed (tg, in tok/s):

    1. llama-bench -m model-q4_k_m.gguf -ngl 99 -p 512 -n 128 -t 8

    Test results are only valuable if accompanied by complete conditions. It is recommended to record the details listed in the table below:

    Item Recorded Details
    Model Full name, quantization type, total and active parameters
    Context The value of -c
    Memory Capacity, frequency, dual-channel status
    Threads The value of -t
    Driver & SDK AMD driver version, Vulkan SDK version
    Command The actual llama-bench parameters used
    Result tg speed (tok/s)

    In the community case, the generation speed for a 30B-level MoE model was approximately 19.5 to 20.8 tok/s, which is close to normal human reading speed. These figures are not accompanied by complete test conditions and should only serve as a reference, not a performance guarantee. Rely on your own machine’s actual test results.

    6. Integrating with Agent Workflows

    llama-server provides an OpenAI-compatible API, meaning any client that supports this interface can call it directly. Using Python as an example:

    1. from openai import OpenAI
    2. client = OpenAI(
    3. base_url="http://127.0.0.1:8080/v1",
    4. api_key="The key set at startup, or any random string if not set",
    5. )
    6. resp = client.chat.completions.create(
    7. model="local",
    8. messages=[{"role": "user", "content": "Hello"}],
    9. )
    10. print(resp.choices[0].message.content)

    Agent frameworks that support custom OpenAI-compatible endpoints, such as the HermesAgent mentioned in the article, usually only require you to fill in the base_url and key. Refer to the specific framework’s documentation for exact configuration options.

    Typical use cases for local inference include:

    • Automated workflows involving multi-step tool calls;
    • Processing text containing private data without data leaving the local machine;
    • Long-running offline knowledge Q&A services.

    7. Choosing Between Local and Cloud

    Local mini PCs are not without their shortcomings. First-token latency is typically higher, long-context throughput is limited, and complex reasoning tasks still fall short compared to high-compute cloud instances.

    Before choosing a solution, consider the following points:

    • Whether the data involves privacy or compliance requirements that prohibit external transmission;
    • Daily call frequency and total token volume;
    • Commonly used context length;
    • Whether there are peak concurrency demands;
    • Available hardware budget.

    In most scenarios, a pragmatic approach is to use a hybrid model: run small-to-medium MoE models locally for high-frequency, lightweight tasks, while offloading complex tasks and peak loads to elastic cloud computing power.

    Conclusion

    The combination of unified memory, iGPUs, and Vulkan enables mini PCs to host 30B-level models. However, getting it running requires careful configuration across BIOS, drivers, compilation, and parameters.