Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

llama.cpp CLI

$ llama-cli Community Low Risk
ggerganov / llama.cpp · AI & Media · MIT · macos / linux / windows

llama-cli from llama.cpp runs local GGUF models on CPU, Apple Metal, or CUDA without a background daemon. Its -j / --json-schema and -jf / --json-schema-file flags compile JSON Schemas into GBNF grammars so outputs strictly match schema.

FCRS-1.0 Score
81 /100
Good
Medium Confidence
Zero-Friction Install
brew install llama.cpp
CLI vs MCP Decision CLI Only

Zero-daemon offline GGUF inference directly from shell; pass --no-display-prompt and -n to keep stdout strictly bounded.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 19 / 25

Grammar-constrained -j/--json-schema guarantees valid JSON, though agents must pass --single-turn, -n, and --no-display-prompt to avoid interactive mode and banner noise.

  • Supports -j/--json-schema, -jf/--json-schema-file, and --single-turn
Trust & Safety 23 / 25

Offline local execution with no cloud data egress; GGUF files are local artifacts.

  • Pure local inference with zero external network calls by default
Setup & Portability 12 / 15

Easily installed via brew install llama.cpp or release binaries, though requires local GGUF model weights and GPU/RAM.

  • Packaged in Homebrew and GitHub Releases; requires GGUF model files
Utility & Efficiency 12 / 15

Fast C++ inference with GBNF schema guarantees, though repeated cold-loads of multi-GB GGUF files are slower than hitting llama-server or ollama.

  • Native Metal/CUDA acceleration and grammar-enforced JSON
Maintenance & Lineage 8 / 10

Core ggml-org/llama.cpp project under MIT license with massive contributor velocity.

  • Official ggml-org/llama.cpp repository
Docs & Verifiability 7 / 10

Detailed --help, though CLI flags evolve rapidly across llama.cpp releases.

  • Extensive --help and tools/main README

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Fully offline local inference; optional -hf Hugging Face downloads honor standard HF_TOKEN if gated.

Side Effects
Read-Only Local Write
Cost & Quotas

Free, MIT open-source C++ binary; requires local GGUF model files.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# llama-cli Agent Rules
- Always pass `--single-turn` (or `-no-cnv`) and `-n <max_tokens>` so `llama-cli` does not enter interactive conversation mode or generate forever.
- Redirect stderr (`2>/dev/null`) or use `--log-disable` when piping `-j` JSON output, because `llama-cli` logs hardware timings to stderr.

Agent-Ready Command Recipes

Safe Read-Only Queries

Run schema-constrained JSON generation from a local GGUF model
llama-cli -m ./model.gguf -p 'Extract name and age for Ada, 36.' -j '{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}},"required":["name","age"]}' -n 128 --no-display-prompt --single-turn

Enforces exact JSON Schema output via -j, caps tokens (-n 128), and exits after one turn (--single-turn).

Controlled Writes & Previews

Generate structured JSON from a schema file to disk
llama-cli -m ./model.gguf -f prompt.txt -jf schema.json -n 256 --no-display-prompt --single-turn > out.json

Reads prompt and JSON schema from files (-f, -jf) and writes constrained JSON to out.json.

Strengths for Agents

  • + -j / --json-schema guarantees syntactically valid JSON via GBNF grammar constraints.
  • + Runs completely offline with Apple Metal, CUDA, or CPU without requiring a daemon.

Caveats & Pitfalls

  • ! Each cold invocation reloads the entire GGUF model from disk (use llama-server for high-frequency calls).
  • ! Flags change relatively fast across releases and stderr prints verbose ggml initialization logs.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI