Reference

CLI reference

Seventeen subcommands. llamay on its own prints them; llamay <command> -h prints that command's flags. This page is what each one is for.

The commands

CommandWhat it does
runGenerate text from a prompt.
serveServe the OpenAI-, Anthropic- and Ollama-compatible endpoints. Guide.
infoDescribe a GGUF file: architecture, shapes, quantisation, and a tensor audit that says whether anything in the file went unread.
pullDownload a model into llamay's store. Five source forms; resumes; verifies.
modelsList what can be named instead of a path, with size and architecture.
rmRemove a model from the store.
cpGive a stored model a second name, sharing one copy of the weights.
benchPrefill and decode measured separately, plus fork, snapshot and restore.
verifyThe invariants: prefill ≡ decode, fork exactness, snapshot resume, tokenizer round trip, thread-count invariance, the quantised-cache bound. What each row means.
pplPerplexity over a text file, in the scheme llama-perplexity uses so the two numbers are comparable.
embedTurn text into vectors with an encoder.
rerankScore documents against a query with a cross-encoder.
ctxbuild, fork and restore contexts. Guide.
quantizeRewrite a model in another quantisation. Will not write an i-quant or MXFP4.
imatrixMeasure which columns a model drives, to guide quantisation.
ocrDecode recogniser frames, optionally against a lexicon.
versionWhat this build is: tags, kernel sets, GPU backends compiled in, formats, architectures. The first command to run when a number looks wrong.
Two names, one binary

A binary named llamay-server serves with no subcommand: the program reads argv[0] and preselects serve, so tooling written for llama-server needs no change. --version is answered before that rename, because it is the question deployment tooling asks first and it asks it of whatever binary it was handed.

The flags every model command shares

FlagDefaultMeaning
-mA model name or a path to a GGUF. A file that exists always wins over a name.
-t0Worker threads. 0 picks a default that avoids efficiency cores.
-kvf32Cache precision: f32, vq8 (values quantised, keys exact) or q8 (both).
-kv-page64Positions per KV page.
-gpuoffRun the whole layer stack on the device, in one command buffer.
-ngl-1llama.cpp's spelling of -gpu: 0 is CPU only, anything at or above the layer count is the whole model on the device.
-no-repackper deviceKeep weights in their file format instead of rewriting them for a faster kernel. On by default for the CPU and unified memory, off for a discrete GPU.
-lexiconA newline-separated word list for lexicon-constrained decoding.

Worked examples

Getting a model

llamay pull qwen2.5:0.5b                        # an Ollama-style registry
llamay pull hf.co/ggml-org/tiny-llamas:q8_0     # Hugging Face, quant as the tag
llamay pull hf:owner/repo/file.gguf@revision    # an exact file, pinned
llamay pull https://example.com/model.gguf      # any URL serving a GGUF
llamay cp qwen2.5:0.5b small:latest             # a second name, not a second copy
llamay rm qwen2.5:0.5b

Generating

llamay run -m azmx-one-q4.gguf -p "भारत के बारे में बताइए" -n 256
llamay run -m azmx-code-q4.gguf -p "write a binary search in Go" -temp 0.2
llamay run -m azmx-one-q4.gguf -p "extract the fields" -json   # always parseable

Samplers: greedy, temperature, top-k, top-p, min-p, typical-p, repetition/presence/frequency penalties, DRY, logit bias, banned tokens. -stats reports what a constraint mask cost, which a synthetic benchmark cannot.

Inspecting and converting

llamay info     -m model.gguf -tensors
llamay quantize -i model-f16.gguf -o model-q4.gguf -type q4_0
llamay verify   -m model.gguf
llamay bench    -m model.gguf -prompt 2048 -gen 256
llamay ppl      -m model.gguf -f text.txt -ctx 512

OCR

llamay ocr -frames page.f32 -alphabet devanagari.txt -lexicon hi.txt -compare
llamay ocr -compare
greedy    120µs  भरत एक दश ह
beam      890µs  भरत एक देश है
lexicon   940µs  भारत एक देश है

Greedy collapse discards the model's second choice at every frame, and a lexicon-aware beam search resolves those choices against words that actually exist. On AZMX OCR that is worth several points of word accuracy without touching a weight.

Environment

VariableMeaning
LLAMAY_MODELSThe store. Defaults to ~/.llamay/models.
LLAMAY_API_KEYRequired on every route but /healthz. Better than -api-key, which is visible in the process list.
HF_TOKENGated Hugging Face repositories, and a higher rate limit.
LLAMAY_BACKEND=portableForce the reference Go kernels — the way to tell a SIMD bug from a block bug.
LLAMAY_NO_BLAS=1Make an accelerate build bit-exact again.
LLAMAY_GPUForce a device backend on or off.
LLAMAY_NO_SERVICE=1Read by the installer: install the CLI and register no service.
OTEL_EXPORTER_OTLP_ENDPOINTSame as -otlp.