ramalama-perplexity(1)
π¦ ramalama-perplexity(1) β General Commands Manual π¦
okay bestie, buckle up, because this is the manual page for ramalama-perplexity, and she is serving β¨
β¨ NAME β¨
ramalama-perplexity β calculate the perplexity value of an AI Model π
no cap, that's literally the whole job. she takes a model, she gives you a perplexity number. icon behaviour.
πΈ SYNOPSIS πΈ
ramalama perplexity [options] model [arg ...]
that's the whole vibe. [options] first if you're feeling fancy, then your model, then whatever extra arg ... you wanna yeet in there. π«Ά
π MODEL TRANSPORTS π
so like, how do you even point at a model? RamaLama speaks a bunch of different transport languages, and each one has a prefix that tells her where to look. here's the whole roster, no gatekeeping:
- URL based β prefix:
https://,http://,file://β web site:https://web.site/ai.model,file:///tmp/ai.model - HuggingFace β prefix:
huggingface://,hf://,hf.co/β web site:huggingface.co - ModelScope β prefix:
modelscope://,ms://β web site:modelscope.cn - Ollama β prefix:
ollama://β web site:ollama.com - rlcr β prefix:
rlcr://β web site:ramalama.com - OCI Container Registries β prefix:
oci://,docker://β web site:opencontainers.org - Hosted API Providers (deprecated π) β prefix:
openai://β web site:api.openai.com
β οΈ okay so listen β the hosted API transports are deprecated and will be removed in a future release. do not get attached. instead oframalama run openai://<model>, you useramalama chat --url https://api.openai.com/v1 --api-key <key> --model <model>, which reaches the same endpoint without a transport. heads up tho: the deprecated transport calls the OpenAI Responses API, whileramalama chatcalls the chat completions API. different APIs, same destination. iykyk π
so how do you actually name a model? two ways, bestie:
- shortname β like
tiny, which gets resolved viashortnames.confπ - explicit transport prefix β like
huggingface://,oci://,ollama://,https://,http://, orfile://
and if you just write a model in the <org>/<model> format with no prefix at all? she pulls it from Hugging Face. that's the default, periodt.
you can also override the default transport in the ramalama.conf file or via the RAMALAMA_TRANSPORT environment variable. like, for example:
export RAMALAMA_TRANSPORT=huggingface
and boom π₯ RamaLama switches to using the Hugging Face transport for unqualified model names.
the way URL support means that if a model is on a web site β or literally just chillin' on your local system β you can run it directly. it's giving convenience. it's giving main character energy. π
β¨ OPTIONS β¨
okay bestie, this is the big one, so grab a snack π every single flag lives here, no skips, no cap.
--authfile=pathβ the path to your authentication file for OCI registries. iykyk, it's how you get in the door π--backend=auto | vulkan | rocm | cuda | sycl | openvino | cann | musaβ which GPU backend to use for inference (default:auto). π
the ones you actually get to pick depend on the GPU hardware that got detected. so it's giving β¨bespokeβ¨.
auto (the default): picks the preferred backend based on your GPU, all on its own:
- AMD GPUs:
vulkan(Linux/macOS) orrocm(WSL2) - NVIDIA GPUs:
cuda;vulkanavailable as explicit option - Intel GPUs:
vulkan(Linux/macOS) orsycl(WSL2);openvinoavailable as explicit option - Ascend NPUs:
cann - MUSA GPUs:
musa - No GPU:
vulkan(CPU fallback)
Platform-specific behavior, bc it's complicated and we love that for it:
- On Linux/macOS, Vulkan provides broad compatibility and is preferred for AMD and Intel GPUs
- On WSL2, Vulkan is a poor default, so vendor-specific backends (
rocm,sycl) are preferred. It remains available, and--backend=vulkanstill selects it. This covers both Windows, where containers run in the WSL2-backed machine, and ramalama running inside a WSL2 distro, which otherwise looks like Linux
Explicit backend selection, when you wanna be the main character and just say it:
vulkan: Use Vulkan-based inference (compatible with AMD, NVIDIA, Intel, and CPU)rocm: Use AMD ROCm backend (AMD GPUs only)cuda: Use NVIDIA CUDA backend (NVIDIA GPUs only)sycl: Use Intel SYCL/oneAPI backend (Intel GPUs only)openvino: Use Intel OpenVINO backend (Intel GPUs only); usesquay.io/ramalama/openvinocann: Use Huawei CANN backend (Ascend NPUs only); usesquay.io/ramalama/cannmusa: Use Moore Threads MUSA backend (MUSA GPUs only); usesquay.io/ramalama/musa
Available choices: the allowed values for --backend are dynamically determined based on your detected GPU hardware. like, on a system with an AMD GPU, only auto, vulkan, and rocm are available. that's it, that's the menu π
Configuration: the default can be overridden in the ramalama.conf file or via the RAMALAMA_BACKEND environment variable.
Examples, bc examples are iconic:
# Use auto-detection (default)
ramalama perplexity granite
# Force Vulkan backend
ramalama perplexity --backend vulkan granite
# Force ROCm backend on AMD GPU
ramalama perplexity --backend rocm granite
--ctx-size,-cβ size of the prompt context. this one is also available as--max-model-len(two names, one queen π). Applies to llama.cpp and vllm regardless of alias (default:0, and0= loaded from model).--deviceβ add a host device to the container. there's an optional permissions parameter you can use to specify device permissions by combiningrfor read,wfor write, andmformknod(2).
Example: --device=/dev/dri/renderD128:/dev/xvdc:rwm
the device specification is passed directly to the underlying container engine. See documentation of the supported container engine for more information.
Pass --device=none to explicitly add no device to the container, e.g., for running a CPU-only performance comparison. π§
--engine-args="args"β add args to the podman or docker invocation (before the container image), after RamaLama-generated options and model bind mounts. The option may be specified multiple times; each value is shell-split and all tokens are passed to the engine in order. Use for extra--mountflags (for example multimodal projector files) or other engine-specific options. Shell-quoting rules match--runtime-args. π§°--env=β set environment variables inside the container.
This option allows arbitrary environment variables that are available for the process to be launched inside the container. If an environment variable is specified without a value, the container engine checks the host environment for a value and sets the variable only if it is set on the host.
--fileβ File containing the sample prompt - see alsoget-wikitext-2.sh--help,-hβ Show this help message and exit π«Ά--image=IMAGEβ OCI container image to run with specified AI model. RamaLama defaults to using images based on the accelerator it discovers and the selected--backend. For example:quay.io/ramalama/ramalama. See the list below for all default images. The default image tag is based on the minor version of the RamaLama package. Version0.25.0of RamaLama pulls an image with a:0.25tag from thequay.io/ramalamaOCI repository. The--imageoption overrides this default.
The default can be overridden in the ramalama.conf file or via the RAMALAMA_IMAGE environment variable. export RAMALAMA_IMAGE=quay.io/ramalama/aiimage:1.2 tells RamaLama to use the quay.io/ramalama/aiimage:1.2 image.
Note: The--backendoption provides a higher-level way to select the appropriate image based on GPU type. Use--backendto selectvulkan,rocm,cuda,sycl, oropenvinobackends, which will automatically choose the correct image. Use--imageonly when you need to override the image selection entirely.
Accelerated images (the whole roster, nobody left out π¦):
- CPU, Vulkan β
quay.io/ramalama/ramalama - ROCm (AMD) β
quay.io/ramalama/rocm - CUDA (NVIDIA) β
quay.io/ramalama/cuda - Intel GPU (sycl) β
quay.io/ramalama/intel-gpu - Intel GPU (openvino) β
quay.io/ramalama/openvino - Asahi (Apple Silicon) β
quay.io/ramalama/asahi - CANN (Ascend) β
quay.io/ramalama/cann - MUSA (Moore Threads) β
quay.io/ramalama/musa
Upstream llama.cpp "full" images from ghcr.io/ggml-org/llama.cpp are also supported. RamaLama automatically detects the image type and adjusts the container CLI accordingly.
ramalama perplexity --image ghcr.io/ggml-org/llama.cpp:full-vulkan MODEL
--keep-groupsβ pass--group-add keep-groupsto podman (default:False). If GPU device on host system is accessible to user via group access, this option leaks the groups into the container. π«£--max-tokens=integerβ Maximum number of tokens to generate. Set to0for unlimited output (default:0). This parameter is mapped to the appropriate runtime-specific parameter:- llama.cpp:
-nparameter - MLX:
--max-tokensparameter - vLLM:
--max-model-lenparameter (mapped viactx_size)
- llama.cpp:
--name,-nβ Name of the container to run the Model in. name it something cute, that's allowed π--ncmoeβ Keep the Mixture of Experts (MoE) weights of the first N layers in the CPU.--network=noneβ set the network mode for the container--nglβ Number of layers to store in VRAM: a number,auto, orall. When omitted,llama-serverdefaults toauto.--oci-runtimeβ Override the default OCI runtime used to launch the container. Container engines like Podman and Docker, have their own default oci runtime that they use. Using this option RamaLama will override these defaults.
On Nvidia based GPU systems, RamaLama defaults to using the nvidia-container-runtime. Use this option to override this selection.
--privilegedβ By default, RamaLama containers are unprivileged (=false) and cannot, for example, modify parts of the operating system. This is because by deβfault a container is only allowed limited access to devices. A "priviβleged" container is given the same access to devices as the user launchβing the container, with the exception of virtual consoles (/dev/tty\d+) when running in systemd mode (--systemd=always).
A privileged container turns off the security features that isolate the container from the host. Dropped Capabilities, limited devices, read-only mount points, Apparmor/SELinux separation, and Seccomp filters are all disabled. Due to the disabled security features, the privileged field should almost never be set as containers can easily break out of confinement.
Containers running in a user namespace (e.g., rootless containers) canβnot have more privileges than the user that launched them.
β οΈ bestie, for real, this one is the scary one. it turns off the isolation. do NOT just vibe-set this one. π
--pull=policyβ Pull image policy. The default ismissing.always: Always pull the image and throw an error if the pull fails.missing: Only pull the image when it does not exist in the local containers storage. Throw an error if no image is found and the pull fails.never: Never pull the image but use the one from the local containers storage. Throw an error when no image is found.newer: Pull if the image on the registry is newer than the one in the local containers storage. An image is considered to be newer when the digests are different. Comparing the time stamps is prone to errors. Pull errors are suppressed if a local image was found.
--runtime-args="args"β Add args to the runtime (llama.cpp or vllm) invocation.--seed=β Specify a seed rather than using a random seed for model interaction. same seed, same vibe, every time π²--selinux=trueβ Enable SELinux container separation (default:true)--temp="0.8"β Temperature of the response from the AI Model. llama.cpp explains this as:
The lower the number is, the more deterministic the response.
The higher the number is the more creative the response is, but more likely to hallucinate when set too high.
Usage: Lower numbers are good for virtual assistants where we need deterministic responses. Higher numbers are good for roleplay or creative tasks like editing stories. πΈ
--threads,-tβ Maximum number of cpu threads to use. The default is to use half the cores when more than 4 cores are available; otherwise, the default is 4 threads.--tls-verify=trueβ Require HTTPS and verify certificates when contacting OCI registries π
β¨ DESCRIPTION β¨
Okay bestie, so here's the whole point of this whole program: it calculates the perplexity of an AI Model. π
And what even is perplexity, you ask? It's literally a measure of how well the model can predict the next token. That's it. That's the metric. And the way it works out is that lower values are better β like, a low perplexity score means the model is out here guessing the next token correctly and living its best life, and a high one means it's kinda flailing. π
So basically: model predicts next token well β low number β slay. Model confused β high number β not slay. Periodt. π
π EXAMPLES π
Here's the one and only glow-up moment you need, fr fr:
ramalama perplexity granite3-moe
That's it. Run it, get your perplexity number for granite3-moe, vibe check complete. β
πΈ SEE ALSO πΈ
ramalama(1)β the main character of the whole manpage cinematic universe, go read it π«Ά
π HISTORY π
- Jan 2025 β Originally compiled by Eric Curtin
ecurtin@redhat.comβ¨mailto:ecurtin@redhat.comβ© π
And that's the whole page, babe! π§ The little footer at the bottom of all of this is just the page name ramalama-perplexity(1) β that's your source/version tag right there, no cap. Go forth and measure some perplexity, you absolute icon. ππ
π¦ where this page comes from
- fedora 43: ramalama 0.25.0-1.fc43 Β· MIT
- fedora 44: ramalama 0.25.0-1.fc44 Β· MIT
- nixpkgs unstable: ramalama 0.25.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms