← 返回 Skills 市场
alexhegit

llama.cpp Benchmark

作者 alexhegit · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
119
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install llamacpp-bench
功能描述
Run llama.cpp benchmarks on GGUF models to measure prompt processing (pp) and token generation (tg) performance. Use when the user wants to benchmark LLM mod...
使用说明 (SKILL.md)

llamacpp-bench

Run standardized benchmarks on GGUF models using llama.cpp's llama-bench tool.

Quick Start

# Basic benchmark
llama-bench -m model.gguf -p 512,1024,2048 -n 128,256 -ngl 99

# With specific backend
LLAMA_BACKEND=vulkan llama-bench -m model.gguf -p 512,1024,2048 -n 128,256 -ngl 99

Benchmark Parameters

Parameter Description Default
-m Model path (GGUF file) required
-p Prompt sizes to test 512
-n Generation lengths to test 128
-ngl GPU layers to offload 99
-t CPU threads auto
-dev Device selection auto

Standard Test Suite

For consistent comparisons across models, use:

-p 512,1024,2048 -n 128,256 -ngl 99

This tests:

  • Prompt processing: 512, 1024, 2048 tokens
  • Token generation: 128, 256 tokens

Interpreting Results

Metric Meaning Good Performance
pp512 Prompt processing speed at 512 tokens >1000 t/s
pp1024 Prompt processing speed at 1024 tokens >1000 t/s
pp2048 Prompt processing speed at 2048 tokens >1000 t/s
tg128 Token generation speed (128 tokens) >50 t/s
tg256 Token generation speed (256 tokens) >50 t/s

Backend Selection

llama-bench auto-detects available backends. Priority order:

  1. CUDA (NVIDIA GPUs)
  2. ROCm (AMD GPUs)
  3. Vulkan (cross-platform GPU)
  4. CPU (fallback)

To force a backend, set environment variable or check build:

# Check available backends
llama-bench --help | grep -i "backend\|cuda\|rocm\|vulkan"

Batch Benchmarking

Use the provided script for benchmarking multiple models:

./scripts/benchmark_models.sh /path/to/models/*.gguf

Saving Results

Output can be redirected to a file:

llama-bench -m model.gguf -p 512,1024,2048 -n 128,256 -ngl 99 > results.txt

Or use the benchmark script which auto-saves to timestamped files.

Common Issues

  1. Out of memory: Reduce -ngl (GPU layers) or test smaller prompt sizes
  2. Slow CPU performance: Ensure -t matches CPU core count
  3. Backend not found: Check llama.cpp was built with the desired backend

Building / Updating llama.cpp

Check Current Version

./scripts/build_llamacpp.sh -v

Shows:

  • Current Git commit and branch
  • Build date
  • Whether behind upstream
  • Available backends

Build or Update

# Interactive mode (prompts for backend selection)
./scripts/build_llamacpp.sh -u

# Specify backend directly
./scripts/build_llamacpp.sh -u -b vulkan   # Vulkan (AMD/Intel GPUs)
./scripts/build_llamacpp.sh -u -b cuda     # CUDA (NVIDIA GPUs)
./scripts/build_llamacpp.sh -u -b rocm     # ROCm (AMD GPUs)
./scripts/build_llamacpp.sh -u -b cpu      # CPU only

# Clean rebuild
./scripts/build_llamacpp.sh -c -b vulkan

# Custom build directory
./scripts/build_llamacpp.sh -u -b cuda -d /custom/path

Build Options

Flag Description
-v Show version info and exit
-u Update to latest from GitHub
-c Clean build (remove existing)
-b Backend: vulkan, cuda, rocm, cpu
-d Build directory path
-j Parallel jobs (default: CPU count)

Finding llama-bench

The benchmark script auto-detects llama-bench in these locations:

  • /DATA/Benchmark/llama.cpp/build/bin/llama-bench
  • ~/Repo/llama.cpp/build/bin/llama-bench
  • ~/lab/build/bin/llama-bench

If not found, it will search your home directory or you can build it using the script above.

安全使用建议
This skill appears to do what it says: it will clone/update the llama.cpp GitHub repo and build llama-bench, then run local benchmarks on GGUF files. Before installing: 1) Be prepared to install and run build tools (git, cmake, make/ninja, a C/C++ compiler) — the metadata doesn't list these dependencies. 2) Expect the build to use network access to GitHub and to write files under ~/Repo/llama.cpp and whatever output directory you choose. 3) The benchmark script searches your home directory and /DATA to find llama-bench; this only reads local paths but can traverse many files and may take time. 4) If you need to be extra cautious, review the upstream repository (https://github.com/ggerganov/llama.cpp) and run the build inside a sandbox or VM, and ensure you have sufficient disk space and GPU drivers for the chosen backend.
功能分析
Type: OpenClaw Skill Name: llamacpp-bench Version: 1.0.0 The skill bundle provides legitimate tools for benchmarking LLM models using llama.cpp. The included bash scripts (benchmark_models.sh and build_llamacpp.sh) perform standard tasks such as searching for local executables, cloning the official llama.cpp repository from GitHub, and compiling the source code using CMake. No evidence of data exfiltration, persistence mechanisms, or malicious prompt injection was found.
能力评估
Purpose & Capability
The skill's scripts and SKILL.md match the stated purpose: finding/building llama.cpp and running llama-bench. One minor inconsistency: the package metadata declares no required binaries, but the build/benchmark scripts assume tools like git, cmake, a C/C++ toolchain, and typical UNIX utilities (find, grep, make). These are expected for building llama.cpp but should be declared.
Instruction Scope
Runtime instructions and scripts are narrowly scoped to cloning/updating the llama.cpp repository, building it, and running llama-bench on local GGUF files. The benchmark script searches the user's home directory and /DATA to locate llama-bench (find ~ /DATA ...) — this is local-only scanning (no remote upload) but may traverse many user files. The build script runs git fetch/pull/clone (network access to GitHub) and compiles code locally; it may prompt interactively and will write under the chosen build directory.
Install Mechanism
No remote arbitrary binary blobs or obscure download hosts are used; the build script clones from github.com/ggerganov/llama.cpp — a known upstream repository — and builds locally via cmake. No extract-from-unknown-URL operations detected.
Credentials
The skill declares no environment variables or credentials. It references an optional LLAMA_BACKEND env var in docs (expected). It does not request or use tokens/secret env vars. Git operations are against a public GitHub repo and should not require credentials.
Persistence & Privilege
The skill is not always-enabled and does not alter other skills or system-wide configuration. It creates/clobbers files under the chosen build directory (default ~/Repo/llama.cpp) and output directory (default ./benchmark_results), which is expected for a build/benchmark tool.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install llamacpp-bench
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /llamacpp-bench 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: benchmark GGUF models with llama-bench, auto-detect llama-bench, batch benchmarking, and build/update llama.cpp from source
元数据
Slug llamacpp-bench
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

llama.cpp Benchmark 是什么?

Run llama.cpp benchmarks on GGUF models to measure prompt processing (pp) and token generation (tg) performance. Use when the user wants to benchmark LLM mod... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 119 次。

如何安装 llama.cpp Benchmark?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install llamacpp-bench」即可一键安装,无需额外配置。

llama.cpp Benchmark 是免费的吗?

是的,llama.cpp Benchmark 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

llama.cpp Benchmark 支持哪些平台?

llama.cpp Benchmark 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 llama.cpp Benchmark?

由 alexhegit(@alexhegit)开发并维护,当前版本 v1.0.0。

💬 留言讨论