No description
  • C++ 56.4%
  • C 13.4%
  • Python 8.2%
  • Cuda 5.7%
  • TypeScript 3.2%
  • Other 12.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
dev-boffin-io 33804735c4
Some checks failed
Build — Android (Termux) / build (push) Has been cancelled
Build — Linux AMD64 / build (push) Has been cancelled
Build — Linux ARM64 / build (push) Has been cancelled
Build — Linux CUDA / Linux CUDA 12.4.0 (push) Has been cancelled
Build — Linux Vulkan / build (push) Has been cancelled
Build — macOS / macOS arm64 (push) Has been cancelled
Build — macOS / macOS x86_64 (push) Has been cancelled
Build — Windows CUDA / Windows CUDA cu124 (push) Has been cancelled
Build — Windows Vulkan / build (push) Has been cancelled
Build — Windows / Windows x64 (push) Has been cancelled
Build — Windows / Windows ARM64 (push) Has been cancelled
fix(ci): disable LLAMA_BUILD_UI to skip server web UI build
tools/ui (llama-server's embedded web UI) requires npm build
or HuggingFace bucket download for bundle.js/bundle.css/
loading.html. Neither is available in CI runners, causing
xxd.cmake to fail embedding empty/missing assets.

Added -DLLAMA_BUILD_UI=OFF to all build workflows. Not needed
since llama_gui's Server tab only uses the API endpoint, not
the browser-based web UI.

Fixed in:
- build-linux-amd64.yml
- build-linux-arm64.yml
- build-linux-cuda.yml
- build-linux-vulkan.yml
- build-windows.yml (x64 + ARM64)
- build-windows-cuda.yml
- build-windows-vulkan.yml
- build-macos.yml
- build-android-termux.yml
2026-06-20 09:35:46 +05:30
.devops docker : copy conversion files (#23370) 2026-05-20 11:03:18 +02:00
.gemini contributing: tighten AI usage policy (#18388) 2025-12-29 16:01:32 +01:00
.github fix(ci): disable LLAMA_BUILD_UI to skip server web UI build 2026-06-20 09:35:46 +05:30
.pi/gg llama_gui : migrate GUI from tkinter to PyQt6 2026-06-14 23:50:44 +05:30
app server: re-inject subcommand when router spawns children under unified binary (#23442) 2026-05-21 10:09:19 +02:00
benches benches : add Nemotron 3 Nano on DGX Spark (#20652) 2026-03-16 21:50:43 +02:00
ci tests : move save-load-state from examples to tests (#23336) 2026-05-21 14:41:50 +03:00
cmake cmake : do not check for bin install dir (#23234) 2026-05-18 02:33:14 +02:00
common server: only parse empty msg if continuing an assistant msg (#23506) 2026-05-22 11:58:15 -04:00
conversion vocab : fix HybridDNA tokenizer (#23466) 2026-05-22 11:17:31 +02:00
docs docs: Update documentation with Granite 4.0/4.1 (#23404) 2026-05-22 20:35:46 +08:00
examples cmake : add install() for impl libraries + fix apple builds (#23511) 2026-05-22 11:46:26 +03:00
ggml ggml : Check the right iface method before using the fallback 2d get (#23514) 2026-05-23 12:49:24 +02:00
gguf-py mtmd, model : merge HunyuanOCR into HunyuanVL and fix OCR vision precision (#23329) 2026-05-21 00:35:37 +02:00
grammars webui: Move static build output from repo code to HF Bucket (#22937) 2026-05-14 13:21:41 +02:00
include llama + spec: MTP Support (#22673) 2026-05-16 20:06:23 +08:00
licenses refactor : remove libcurl, use OpenSSL when available (#18828) 2026-01-14 18:02:47 +01:00
llama_gui feat(llama_gui): add 6 new tool tabs covering all llama.cpp binaries 2026-06-17 08:17:16 +05:30
media media : add transparent icon svg and png [no ci] (#15891) 2025-09-10 14:51:28 +03:00
models unicode,test: add Qwen3.5 non-backtracking tokenizer handler and regr… (#22110) 2026-05-14 11:03:40 +02:00
pocs libs : rename libcommon -> libllama-common (#21936) 2026-04-17 11:11:46 +03:00
requirements py : Bump typer to latest to fix huggingface_hub issue (#21701) 2026-04-11 09:44:15 +03:00
scripts ci: add multi-platform workflows + fix sync script 2026-06-17 09:09:31 +05:30
src model : add NVFP4 MTP scale tensors (#23563) 2026-05-23 13:30:31 +02:00
tests tests : move save-load-state from examples to tests (#23336) 2026-05-21 14:41:50 +03:00
tools server: only parse empty msg if continuing an assistant msg (#23506) 2026-05-22 11:58:15 -04:00
vendor vendor : update cpp-httplib to 0.45.0 (#23103) 2026-05-16 15:25:21 +03:00
.clang-format fix: apply clang-format to CUDA macros (#16017) 2025-09-16 08:59:19 +02:00
.clang-tidy clang-tidy : disable warning about performance enum size (#16127) 2025-09-22 19:57:46 +02:00
.dockerignore
.ecrc
.editorconfig ui: Restructure repo to use tools/ui folder and ui / UI / llama-ui / LLAMA_UI naming (#23064) 2026-05-16 02:02:40 +02:00
.flake8
.gitattributes chore: pin to llama.cpp tag b9297 (b0df4c0cf) 2026-05-26 09:19:50 +05:30
.gitignore ui: Restructure repo to use tools/ui folder and ui / UI / llama-ui / LLAMA_UI naming (#23064) 2026-05-16 02:02:40 +02:00
.gitmodules
.pre-commit-config.yaml
AGENTS.md feat(llama_gui): add 6 new tool tabs covering all llama.cpp binaries 2026-06-17 08:17:16 +05:30
AUTHORS chore: pin to llama.cpp tag b9297 (b0df4c0cf) 2026-05-26 09:19:50 +05:30
build-xcframework.sh cmake : add install() for impl libraries + fix apple builds (#23511) 2026-05-22 11:46:26 +03:00
CLAUDE.md llama_gui : migrate GUI from tkinter to PyQt6 2026-06-14 23:50:44 +05:30
CMakeLists.txt chore: pin to llama.cpp tag b9297 (b0df4c0cf) 2026-05-26 09:19:50 +05:30
CMakePresets.json
CODEOWNERS tests : move save-load-state from examples to tests (#23336) 2026-05-21 14:41:50 +03:00
CONTRIBUTING.md feat(llama_gui): add 6 new tool tabs covering all llama.cpp binaries 2026-06-17 08:17:16 +05:30
convert_hf_to_gguf.py convert : update mtp related help (#23334) 2026-05-19 21:16:58 +02:00
convert_hf_to_gguf_update.py Refactor: convert_hf_to_gguf.py (#17114) 2026-05-15 15:18:12 +02:00
convert_llama_ggml_to_gguf.py ci : switch from pyright to ty (#20826) 2026-03-21 08:54:34 +01:00
convert_lora_to_gguf.py convert : filter lora tensor names (#23077) 2026-05-19 09:44:25 +03:00
flake.nix fix(nix): remove non-functional llama-cpp cachix cache from flake.nix (#15295) 2025-08-13 11:21:31 -07:00
LICENSE chore: pin to llama.cpp tag b9297 (b0df4c0cf) 2026-05-26 09:19:50 +05:30
Makefile make : remove make in favor of CMake (#15449) 2025-08-20 13:31:16 +03:00
mypy.ini
pyproject.toml feat: migrate to PEP 621 and add uv support (#21907) 2026-05-06 14:04:10 +02:00
pyrightconfig.json ci : switch from pyright to ty (#20826) 2026-03-21 08:54:34 +01:00
README.md feat(llama_gui): add 6 new tool tabs covering all llama.cpp binaries 2026-06-17 08:17:16 +05:30
requirements.txt
SECURITY.md llama_gui : migrate GUI from tkinter to PyQt6 2026-06-14 23:50:44 +05:30
ty.toml mtmd : DeepSeek-OCR image processing fixes, img_tool::resize padding refactor (#23345) 2026-05-20 17:37:10 +02:00

🔨 llama-forge

A GUI Frontend for llama.cpp

License: MIT Platform Built With Upstream Pinned Maintained

llama-forge is a fork of llama.cpp extended with a native PyQt6 GUI frontend for running, quantizing, converting, and serving large language models locally — with full support for Debian/Linux, Termux/Android ARM64, and Windows.


⚠️ Version Info: Pinned to llama.cpp release b9297 (24 May 2026). Stable & tested. Daily master sync is disabled.


📋 Table of Contents


Overview

llama-forge combines the full power of the llama.cpp inference engine with a user-friendly graphical interface built on PyQt6. No command-line knowledge required to run, quantize, serve, benchmark, or convert GGUF models. Designed for developers and power users who want a local, private, and efficient LLM workflow.


✨ Features

Feature Description
💬 Chat Interactive chat with local GGUF models via llama-cli
🧪 Quantize Quantize models to Q4_K_M, Q5_K_M, Q8_0, IQ variants, and more via llama-quantize
🖥️ Server Launch and manage llama-server instances with full argument GUI; powered by QProcess
📊 Benchmark Measure inference speed (tokens/sec) via llama-bench with live output
🧮 Imatrix Generate importance matrix files for IQ quants via llama-imatrix
📐 Perplexity Measure model quality (PPL score) via llama-perplexity; supports hellaswag, winogrande, KL-divergence modes
🗂️ GGUF Tools Split/merge GGUF shards (llama-gguf-split), verify file integrity (llama-gguf-hash), read/edit metadata (llama-gguf)
🔗 LoRA & CVector Merge LoRA adapters into base models (llama-export-lora); generate control vectors (llama-cvector-generator)
🛠️ Extra Tools TTS (llama-tts), multimodal/vision chat (llama-mtmd-cli), RPC server (llama-rpc-server), tokenizer (llama-tokenize), speculative decoding (llama-speculative)
🔄 Convert Convert HuggingFace models to GGUF via a QDialog with dynamic panel visibility
🔍 Auto-detect Automatically finds llama.cpp binaries and models
🧠 RAM-aware Displays available system RAM to guide model and quant selection
📌 PID Persistence Server processes survive GUI restarts — stop them any time
🖥️ Multi-server Run multiple llama-server instances on different ports simultaneously
🗂️ KV Cache Control Configure --cache-type-k/v, --cache-reuse, --defrag-thold from the GUI
🤔 Reasoning Model Support --thinking, --jinja, --reasoning-budget flags for CoT/reasoning models
📦 Portable Binary Ships as a single self-contained binary via PyInstaller
📱 ARM64 Support Fully tested on Termux/Android ARM64

📸 Screenshots

Coming soon.


🖥️ Requirements

Common

  • cmake >= 3.14
  • gcc / g++ >= 12
  • Python >= 3.10
  • PyQt6 >= 6.6

Debian / Linux

sudo apt install cmake gcc g++ python3 python3-pip git
pip install PyQt6>=6.6

Termux / Android ARM64

pkg install cmake clang python git
pip install PyQt6 pyinstaller

Windows


📥 Installation

Debian / Linux

git clone https://github.com/dev-boffin-io/llama-forge.git
cd llama-forge
cmake -B build -S .
cmake --build build

Termux / Android ARM64

git clone https://github.com/dev-boffin-io/llama-forge.git
cd llama-forge
cmake -B build -S .
cmake --build build

Windows

Option A — Download pre-built binary (recommended)

Download llama-forge-windows-x64.zip from GitHub Actions Artifacts, extract, and run llama-forge-gui.exe.

Option B — Build from source

Open Developer PowerShell for VS 2022:

git clone https://github.com/dev-boffin-io/llama-forge.git
cd llama-forge

cmake -B build -G Ninja `
  -DCMAKE_BUILD_TYPE=Release `
  -DLLAMA_BUILD_TESTS=OFF `
  -DLLAMA_BUILD_EXAMPLES=ON `
  -DGGML_NATIVE=OFF

cmake --build build --parallel

🔨 Building from Source

git clone https://github.com/dev-boffin-io/llama-forge.git
cd llama-forge
cmake -B build -S .
cmake --build build
./llama-gui

The build system automatically creates a Python virtual environment, installs PyInstaller and PyQt6, and compiles the GUI into a standalone binary.


🚀 Usage

# Linux / Android
./llama-gui

# Windows
llama-forge-gui.exe

Chat Tab

Select a GGUF model and configure core inference parameters (--ctx-size, --threads, --n-gpu-layers, --batch-size, --ubatch-size). Boolean flags like --flash-attn, --mlock, --jinja, and --thinking can be toggled via checkboxes. llama-cli launches in an external terminal.

--chat-template supports all built-in llama.cpp 2025 templates: chatml, llama3/4, mistral-v1/v3/v7, gemma, phi3/4, deepseek/deepseek2/3, qwen2/3, command-r, falcon3, granite, grok-2, and many more.

KV Cache settings (--cache-type-k/v) support f16, f32, bf16, q8_0, q4_0, q4_1, iq4_nl, q5_0, q5_1.

Reasoning flags: --thinking, --reasoning-budget, --prio.


Quantize Tab

Select a source GGUF and target quant type. A RAM-based recommendation banner suggests the best type for your system. Supports all llama-quantize types: standard K-quants (Q4_K_M, Q5_K_M, Q6_K, Q8_0), float types (F16, BF16, F32), IQ types (iq2_xxs through iq4_nl), TQ types (tq1_0, tq2_0), and SIMD-optimised variants (q4_0_4_4, q4_0_4_8, q4_0_8_8).

The --imatrix field points to a .dat file generated by the Imatrix tab for significantly better quality at low bit rates.


Server Tab

Launches and manages llama-server in the background via QProcess. Multiple instances can run on different ports simultaneously. Each appears in the Active Servers list as port 8080 PID 12345 [model-name.gguf]. PID files persist across GUI restarts.

Supports all 2025 server flags: KV cache control, --cont-batching, --kv-unified, --jinja, --embedding, --reranking, --metrics, SSL, slot management, and more.


Benchmark Tab

Runs llama-bench in the background and streams results live. Configure prompt token count (-p), generation count (-n), GPU layers (-ngl), threads, batch sizes, and repetitions. Output format: md (default), json, jsonl, csv, sql.


Imatrix Tab

Generates an importance matrix (.dat file) from a calibration dataset using llama-imatrix. The output file is used in the Quantize tab (--imatrix field) to produce significantly higher-quality IQ quantizations (iq2_xxs, iq3_xs, etc.).

Configure calibration data file, output path, context size, threads, GPU layers, chunk count, and PPL options.


Perplexity Tab

Measures model quality using llama-perplexity. Supports multiple evaluation modes:

Mode Description
perplexity (default) Standard PPL measurement on a text dataset
hellaswag HellaSwag benchmark (multiple choice)
winogrande Winogrande benchmark
multiple-choice Generic multiple-choice evaluation
kl-divergence KL divergence between two model outputs

Useful for comparing quality before and after quantization. Lower PPL = better quality.


GGUF Tools Tab

Three sub-tools for working with GGUF files directly:

🔀 Split / Merge (llama-gguf-split) Split large GGUF files into smaller shards (--split-max-size, --split-max-tensors) or merge shards back into a single file (--merge).

#️⃣ Hash (llama-gguf-hash) Verify GGUF file integrity with SHA256 (default), SHA1, UUID, or xxHash. Useful for confirming downloads are uncorrupted.

🏷️ Metadata (llama-gguf) Read and edit GGUF KV metadata fields (e.g. general.name, tokenizer.chat_template). Supports read, write (--set), and remove (--rm) operations.


LoRA & CVector Tab

📤 Export LoRA (llama-export-lora) Merge a LoRA adapter GGUF into a base model GGUF to produce a standalone merged model. Configure --lora-scaled factor and thread count.

🎛️ Control Vector (llama-cvector-generator) Generate control vectors from positive/negative prompt pairs using PCA. Control vectors steer model behaviour (tone, style, verbosity) at inference time via --control-vector in the Chat or Server tab.


Extra Tools Tab

Five additional tools in sub-tabs:

🔊 TTS (llama-tts) Text-to-speech synthesis using OuteTTS-compatible GGUF models. Configure TTS model, optional vocoder, speaker file, and output WAV path.

🖼️ Multimodal (llama-mtmd-cli) Vision/audio chat supporting LLaVA, Qwen2-VL, Gemma4V, InternVL, Pixtral, MiniCPM-V, and 20+ other multimodal architectures. Attach images or audio files alongside text prompts.

🌐 RPC Server (llama-rpc-server) Start a remote GPU offload server. On the main machine, use -rpc <host>:<port> with llama-server or llama-cli to offload layers to this machine. Runs in background via QProcess.

🔢 Tokenize (llama-tokenize) Tokenize arbitrary text with a given model's vocabulary. Shows token IDs, token count, and supports --no-bos. Useful for prompt engineering and context budget planning.

⚡ Speculative (llama-speculative / llama-speculative-simple) Speculative decoding: a small draft model generates candidate tokens which the large target model verifies in parallel — significantly faster generation at no quality cost. Configure draft model, target model, draft length, and context size.


Convert Tools

Opens a Convert Tools dialog (toolbar button). Converts HuggingFace model directories or LoRA adapters to GGUF format. Supported scripts:

Script Use case
convert_hf_to_gguf.py HuggingFace model → GGUF
convert_llama_ggml_to_gguf.py Legacy GGML format → GGUF
convert_lora_to_gguf.py LoRA adapter → GGUF

HF-specific and LoRA-specific option panels show/hide dynamically based on the selected script.


📁 Project Structure

llama-forge/
├── llama_gui/                    # GUI frontend (Python/PyQt6)
│   ├── app.py                    # Entry point — QMainWindow + QTabWidget + toolbar
│   ├── CMakeLists.txt            # GUI build script
│   ├── requirements.txt          # Python deps (PyQt6>=6.6, pyinstaller)
│   ├── llama_gui.png             # App icon
│   ├── gui/                      # Tab UI components
│   │   ├── __init__.py           # Shared QSS theme, LogConsole, make_scrollable()
│   │   ├── chat_tab.py           # 💬 Chat tab
│   │   ├── quant_tab.py          # 🧪 Quantize tab
│   │   ├── server_tab.py         # 🖥 Server tab (QProcess + QListWidget)
│   │   ├── bench_tab.py          # 📊 Benchmark tab (llama-bench)
│   │   ├── imatrix_tab.py        # 🧮 Imatrix tab (llama-imatrix)
│   │   ├── perplexity_tab.py     # 📐 Perplexity tab (llama-perplexity)
│   │   ├── gguf_tools_tab.py     # 🗂 GGUF Tools tab (split / hash / metadata)
│   │   ├── lora_tab.py           # 🔗 LoRA & CVector tab
│   │   ├── extra_tools_tab.py    # 🛠 Extra Tools tab (TTS / MTMD / RPC / Tokenize / Speculative)
│   │   └── converter.py          # 🔄 Convert Tools QDialog
│   ├── core/                     # Business logic
│   │   ├── llama_detect.py       # Root detection, config persistence
│   │   ├── quant_logic.py        # Quant type definitions, arg builder
│   │   └── converter_logic.py    # Converter helpers
│   └── utils/                    # Helpers
│       ├── ram_detect.py         # System RAM detection
│       ├── gguf_info.py          # GGUF metadata reader
│       ├── subprocess_stream.py  # Threaded stdout/stderr streaming
│       └── terminal.py           # Cross-platform terminal launcher
├── src/                          # Upstream llama.cpp C++ source
├── ggml/                         # Upstream ggml backend
├── tools/                        # llama-server, llama-cli, llama-bench, etc.
├── CMakeLists.txt                # Root build (includes llama_gui)
└── llama-gui                     # Built binary (Linux/Android)
    llama-forge-gui.exe           # Built binary (Windows)

🔄 Upstream Sync

llama-forge is pinned to b9297 of ggml-org/llama.cpp.

bash ~/llama-forge-sync.sh

The sync script preserves all custom files (llama_gui/, README.md, AGENTS.md, etc.) and restores them after resetting to upstream.


🤝 Contributing

Contributions are welcome for the llama_gui/ frontend. For upstream llama.cpp changes, please contribute to ggml-org/llama.cpp directly.

See CONTRIBUTING.md for details.


📄 License

MIT License — see LICENSE for details. Upstream llama.cpp is also MIT licensed.


Made with ❤️ by Boffin