# Gufo: The ***Open Source*** Strix Halo AI engine

Gufo logo

Gufo is a vertical local inference engine specifically built and optimized for the AMD Strix Halo hardware: Ryzen AI MAX+ 395 systems with Radeon 8060S (`gfx1151`), up to 128 GiB of unified memory. **Contributions are welcome!** See the [changelog](CHANGELOG.md) and [GitHub Releases](https://github.com/gufo-org/gufo/releases) for user-facing changes and release history. > [!TIP] > There are two Gufo variants that haven't been merged yet: A **[Windows port](https://github.com/pixmaate/gufo)** and **[Gufo RDMA for Dual Strix Halo](https://github.com/neuhaus/gufo)**. Check them out! ## Models and benchmarks All model documentation lives under [docs/models](docs/models/README.md): | Model | Inference modes | Hugging Face weights | Benchmarks | Quality | | --- | --- | --- | --- | --- | | [Qwen3.8 27B](docs/models/qwen3.8-27b/README.md) | Q4/Q8, images, AR, DFlash2 | Unsloth [Q4_K_XL](https://huggingface.co/unsloth/Qwen3.8-27B-GGUF/blob/4ca720788d1e01f1bff70c033e0d0028fd02e502/Qwen3.8-27B-UD-Q4_K_XL.gguf) / [Q8_K_XL](https://huggingface.co/unsloth/Qwen3.8-27B-GGUF/blob/4ca720788d1e01f1bff70c033e0d0028fd02e502/Qwen3.8-27B-UD-Q8_K_XL.gguf) · [DFlash2 Q4_K_M](https://huggingface.co/z-lab/Qwen3.8-27B-DFlash2-GGUF/blob/2d9571f8ce46e151f61c6499c99dee6079e1d610/Qwen3.8-27B-DFlash2-Q4_K_M.gguf) | Q4: **656.33 tok/s pp**; up to **70.56 tok/s tg** single user and **123.00 aggregated tok/s** on 8 concurrent requests with DFlash2 · [Benchmarks](docs/models/qwen3.8-27b/BENCHMARKS.md) | [Quality](docs/models/qwen3.8-27b/QUALITY.md) | | [Qwen3.8 Flash-Next](docs/models/qwen3.8-flash-next/README.md) | Q4, images, AR, MTP | Unsloth [Q4_K_XL](https://huggingface.co/unsloth/Qwen3.8-Flash-Next-GGUF/tree/38bb39ee97821de2c9009abb7e93950eec396e66/UD-Q4_K_XL) · [MTP Q8_0](https://huggingface.co/unsloth/Qwen3.8-Flash-Next-GGUF/blob/38bb39ee97821de2c9009abb7e93950eec396e66/MTP/mtp-Qwen3.8-Flash-Next-shared-Q8_0.gguf) | **1,787.54 tok/s pp** (AR); up to **116.94 tok/s tg** single user and **245.11 aggregated tok/s** on 8 concurrent requests with MTP · [Benchmarks](docs/models/qwen3.8-flash-next/BENCHMARKS.md) | [Quality](docs/models/qwen3.8-flash-next/QUALITY.md) | | [DeepSeek V4 Flash](docs/models/deepseek-v4-flash/README.md) | AR, DSpark | [antirez Flash 0731 IQ2XXS](https://huggingface.co/antirez/deepseek-v4-gguf/blob/1cd7b564460821938add0475a60b942c409295e0/DeepSeek-V4-Flash-IQ2XXS-w2Q2K-AProjQ8-SExpQ8-OutQ8-chat-v2-imatrix-0731.gguf) · [DSpark](https://huggingface.co/antirez/deepseek-v4-gguf/blob/e7f04037032990db0346398d249baf9fb9df1ccc/DeepSeek-V4-Flash-DSpark-support-0731.gguf) | **484.62 tok/s pp**; up to **26.62 tok/s tg** single user and **54.74 aggregated tok/s** on 8 concurrent requests with DSpark · [Benchmarks](docs/models/deepseek-v4-flash/BENCHMARKS.md) | [Quality](docs/models/deepseek-v4-flash/QUALITY.md) | | [Qwen3-ASR 1.7B](docs/models/qwen3-asr/README.md) | Speech recognition | [BF16](https://huggingface.co/Qwen/Qwen3-ASR-1.7B/tree/7278e1e70fe206f11671096ffdd38061171dd6e5) | **15.27× realtime** · [Benchmarks](docs/models/qwen3-asr/BENCHMARKS.md) | [Quality](docs/models/qwen3-asr/QUALITY.md) | | [Qwen3-TTS 1.7B](docs/models/qwen3-tts/README.md) | Speech synthesis and voice cloning | BF16 [CustomVoice](https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice) / [VoiceDesign](https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign) / [Base](https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-Base) | Up to **2.54× realtime**; **201 ms** to first audio (CustomVoice) · [Benchmarks](docs/models/qwen3-tts/BENCHMARKS.md) | [Quality](docs/models/qwen3-tts/QUALITY.md) | | [Qwen-Image-2.1](docs/models/qwen-image-2.1/README.md) | BF16 image generation and editing | [Complete pipeline](https://huggingface.co/Qwen/Qwen-Image-2.1/tree/b3179ad355be050328e483a9dfdd9e60cd62adfa) | In progress · [Benchmarks](docs/models/qwen-image-2.1/BENCHMARKS.md) | [Quality](docs/models/qwen-image-2.1/QUALITY.md) | | [MiniMax H3](docs/models/minimax-h3/README.md) | BF16 text to video/audio | [FL2VA pipeline](https://huggingface.co/MiniMaxAI/MiniMax-H3/tree/42ed227ee7df40d41602854ae760620d6eb651fe/FL2VA) | In progress · [Benchmarks](docs/models/minimax-h3/BENCHMARKS.md) | [Quality](docs/models/minimax-h3/QUALITY.md) | Peak measured workloads; text pp is autoregressive (AR), while tg uses the named speculative mode. Peaks include repetitive output; aggregate tg sums individual request decode rates. Qwen27B's single-user peak uses the short-prompt C1 workload. Audio excludes loading. Each model guide lists the required files and complete benchmark settings. ## Philosophy - Contributions are welcome! We need the help of Strix Halo community to keep improving gufo! - We would like this to be the one-stop shop for Strix Halo Local AI enthusiasts: batteries included for text, audio, image, and video models. - Build and optimize specifically for the Strix Halo 128 GiB hardware. Smaller memory configurations should still work and preserve the speed benefits for models that can fit on memory. - Support only the best available models for their size that can run on this hardware: less code to maintain, more focused optimization and testing work. - Preserve quality when optimizing. Each model's quality report records independent numerical checks, execution consistency and unresolved gaps. Don't reuse kernels across different models to limit blast radius of a code change. - Treat concurrent requests, cancellation and conversation caching as first-class workloads. - Keep production dependencies small and development tools separate. ## Quickstart ```sh hf download unsloth/Qwen3.8-27B-GGUF \ Qwen3.8-27B-UD-Q8_K_XL.gguf \ --revision 4ca720788d1e01f1bff70c033e0d0028fd02e502 \ --repo-type model \ --local-dir models/Qwen3.8-27B-GGUF hf download z-lab/Qwen3.8-27B-DFlash2-GGUF \ Qwen3.8-27B-DFlash2-Q4_K_M.gguf \ --revision 2d9571f8ce46e151f61c6499c99dee6079e1d610 \ --repo-type model \ --local-dir models/Qwen3.8-27B-DFlash2-GGUF podman pull ghcr.io/gufo-org/toolboxes/gufo-runtime:latest podman run --rm \ --userns=keep-id:uid=1000,gid=1000 \ --device /dev/kfd \ --device /dev/dri \ --group-add keep-groups \ --ulimit memlock=-1 \ -p 8080:8080 \ -v ./models:/models:ro \ ghcr.io/gufo-org/toolboxes/gufo-runtime:latest \ gufo serve --host 0.0.0.0 --port 8080 llm \ --model /models/Qwen3.8-27B-GGUF/Qwen3.8-27B-UD-Q8_K_XL.gguf \ --speculative dflash2 \ --dflash-model /models/Qwen3.8-27B-DFlash2-GGUF/Qwen3.8-27B-DFlash2-Q4_K_M.gguf ``` Rootless Podman needs `crun` for `--group-add keep-groups`. Your host user must have read/write access to `/dev/kfd` and `/dev/dri/renderD*`, usually through the `render` and `video` groups; log out and back in after changing membership. Container groups named `video`/`render` do not preserve host supplementary groups. Check `id`, `ls -l /dev/kfd /dev/dri/renderD*`, and `podman info --format '{{.Host.OCIRuntime.Name}}'` if ROCm reports no device. See [Podman's rootless group-access guidance](https://github.com/containers/podman/blob/main/troubleshooting.md#20-passed-in-devices-or-files-cant-be-accessed-in-rootless-container). On Fedora or another SELinux-enforcing host, GPU enumeration can succeed while SELinux blocks mapping `/dev/kfd`, causing ROCr to report a misleading “Memory critical” error. Check the **host** audit log: ```sh sudo ausearch -m avc -ts recent | grep -E '/dev/kfd|hsa_device_t' ``` If it shows a denied `map` for the container, Podman documents this fix: ```sh sudo setsebool -P container_use_devices true ``` This persistently allows containers to access device labels for devices passed into them; it affects all containers on that host. Review that policy scope before enabling it. See [Podman's device documentation](https://docs.podman.io/en/latest/markdown/podman-run.1.html#device-host-device-container-device-permissions) and the [SELinux container policy](https://github.com/containers/container-selinux/blob/main/container.te). Then, from another terminal, ask it something through the OpenAI-compatible API: ```sh curl http://localhost:8080/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "Qwen3.8-27B-UD-Q8_K_XL", "messages": [{"role": "user", "content": "Say something"}] }' ``` For Open WebUI, VS Code, OpenAI SDK and Responses-API clients (for example Codex), set the API base URL to `http://localhost:8080/v1`. Chat Completions and Responses support text, images, function tools, structured output and streaming. See the [API contract](docs/SERVER.md). The text server uses the model's native context by default and generates until EOS or the context is full. `--context N` sets context capacity per session; `--max-tokens N` sets a default response limit that clients can override. Reasoning tokens count toward that response limit. ## Harness notes - **Qwen with Codex:** Codex sends developer messages mid-conversation, after compaction or a settings change. Qwen's template accepts only one leading system turn, so Gufo moves them there. The request that introduces one is prefilled again; later requests reuse the cache. See the [API contract](docs/SERVER.md). ## Build from source Linux x86-64 on AMD Strix Halo (`gfx1151`) is the supported target. CMake owns one production configuration for both Nix and ordinary Linux builds. Tests, profilers, tuning executables and Python reference runners are not installed with the production package. No `build.sh` wrapper is needed. ### With Nix ```sh nix build ./result/bin/gufo diagnose ./result/bin/gufo serve llm --model /path/to/model.gguf ``` [flake.lock](flake.lock) pins the dependencies. `nix develop` adds profiling, model-download and independent evaluation tools; these are not runtime requirements. Optional benchmark baselines are selected separately with `nix shell .#ds4-reference`, `.#llama-cpp-reference` or `.#llama-cpp-mtp-reference`; see [benchmarking](docs/BENCHMARKS.md). See [testing](docs/TESTING.md) for the small hosted CI suite and explicit local quality checks. ### Without Nix Install a C++20 compiler, CMake 3.21+, Ninja, pkg-config and the following development libraries. The currently qualified toolchain is GCC 15.3 and ROCm 7.2.3. Attention and audio convolution kernels are compiled directly from HIP. Python, Triton/AOTriton, Composable Kernel and MIOpen are not production build or runtime requirements. | Dependency | Used for | | --- | --- | | ROCm HIP compiler/runtime, hipBLAS, hipBLASLt, rocBLAS | GPU execution and matrix multiplication | | hipCUB, rocPRIM, rocWMMA headers | Compiled GPU kernels | | ICU, libcurl, OpenSSL, libpng, libjpeg, libwebp | Tokenization, HTTPS, hashing and images | | FFmpeg and ffprobe | Video/audio output; invoked as separate executables | Install ROCm using [AMD's Linux instructions](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/). Use the development packages for the libraries above. ROCm normally installs under `/opt/rocm`. For example, on Debian/Ubuntu the ordinary system libraries are: ```sh sudo apt install build-essential cmake ninja-build pkg-config \ libicu-dev libcurl4-openssl-dev libssl-dev libpng-dev libjpeg-dev libwebp-dev ffmpeg # ROCm libraries from the table, named as AMD's repository ships them. sudo apt install hipblas-dev hipblaslt-dev rocblas-dev \ hipcub-dev rocprim-dev rocwmma-dev cmake --preset release -DCMAKE_INSTALL_PREFIX="$HOME/.local" cmake --build --preset release --parallel 4 ./build/release/gufo diagnose ./build/release/gufo serve llm --model /path/to/model.gguf ``` Configuring fails at `find_package(hipblas)` when those ROCm packages are missing. Other distributions name them `-devel` instead of `-dev`. For nonstandard installations, pass ordinary CMake paths, for example `cmake --preset release -DCMAKE_PREFIX_PATH="/opt/rocm"`. If compiler discovery picks a system Clang, also pass `-DCMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++`. Use `cmake --install build/release` to install Gufo, its runtime data and license notices. The GPU driver must allow your user to access `/dev/kfd` and `/dev/dri`; model weights are acquired separately. The same source, compiler flags and install rules serve both builds. Nix pins the complete toolchain for reproducible comparisons; changing the compiler or math libraries requires the affected model's quality checks. ## License Gufo's original code is [MIT licensed](LICENSE). Adapted code and dependencies retain their own notices in [NOTICE](NOTICE), [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) and `licenses/`, installed under `share/licenses/gufo`. Model weights are not bundled and retain their publishers' terms. ## Reference Projects The initial design is informed by the following open source projects: - [llama.cpp](https://github.com/ggml-org/llama.cpp) for compact model serving, GGUF, and CPU/GPU correctness paths. - [LaurentZuijdwijk/llama.cpp](https://github.com/LaurentZuijdwijk/llama.cpp), [Nathanw1014/strix-halo-llamacpp](https://github.com/Nathanw1014/strix-halo-llamacpp), and [gaetan-puleo/llama-cpp-strix-halo](https://github.com/gaetan-puleo/llama-cpp-strix-halo) for Strix Halo optimization inspiration. - [vLLM](https://github.com/vllm-project/vllm) for continuous batching and paged request scheduling. - [hipEngine](https://github.com/shisa-ai/hipEngine) for torch-free HIP execution, and native speculative-cycle work. - [ds4](https://github.com/antirez/ds4) for DeepSeek V4 Flash, MoE scheduling, and DSpark. - [audio.cpp](https://github.com/0xShug0/audio.cpp) for audio models for tts and asr tasks.