Skip to content

Llamafile

Quick Reference

Category: InferenceEngine  |  OS: Windows, Linux, macOS  |  Privileges: user  |  Free: Yes

Llamafile is Mozilla's single-file executable format that bundles a GGUF model and the llama.cpp inference engine into one self-contained binary. A llamafile can be downloaded and executed from any writable directory with no installation, no dependencies, and no package manager. It automatically opens a browser-based chat UI and serves an OpenAI-compatible API on port 8080. The absence of a standard install path and the single-file nature make it a high-fidelity Living-Off-The-Land binary — detection must rely on YARA (combined GGUF+binary magic), process behaviour, and network indicators.


Details

Field Value
Website https://github.com/Mozilla-Ocho/llamafile
License Apache-2.0

Capabilities: LocalInference, APIServer, GPUAcceleration


Disk Artifacts

Path OS Type Phase Trust Description
*.llamafile Any Binary Install — Self-contained executable containing both the llama.cpp engine and a GGUF model. No standard install path — runs from any directory. May be renamed to hide its nature.

Model Storage

*.llamafile (Any) — The llamafile itself contains an embedded GGUF model at a fixed internal offset (Install)

Format Magic Bytes (hex) Offset
GGUF 47 47 55 46 0

Process Artifacts

llamafile (Use)

May appear under any name since the file can be renamed. On Linux/macOS the process name reflects the filename. On Windows, any .exe with GGUF magic bytes at offset 0 is suspect.

Expected parent: bash

CLI Pattern Phase Trust Description
.*\.llamafile.*--server Use — Explicit server mode
.*\.llamafile.*--host\s+0\.0\.0\.0 Abuse — API exposed beyond localhost
.*\.llamafile.*-p\s+ Use — Non-interactive single-prompt execution

Network Artifacts

Description Protocol Ports Bind Address Domains Phase Trust
Built-in OpenAI-compatible API server and chat UI TCP 8080 127.0.0.1 — Use —

Persistence Mechanisms

OS Type Path Phase Trust Description
Linux Service /etc/systemd/system/llamafile.service Activation — User-created systemd unit to run llamafile as a persistent service

Windows Event Log

Event ID Provider Log File Phase Trust Description
4688 Microsoft-Security-Auditing Security.evtx Use — Process creation for any executable with GGUF magic bytes — use YARA-on-execution

Detection Rules

YARA

  • detections/yara/gguf_magic_bytes.yar (Install; trust: —) — Matches the embedded GGUF header inside the llamafile executable

References

  • https://github.com/Mozilla-Ocho/llamafile

  • https://hacks.mozilla.org/2023/11/introducing-llamafile/