ramalama-run(1)
π¦ ramalama-run(1) π¦
okay so hi bestie π you've landed on ramalama-run(1), straight out of the General Commands Manual. This is the one that actually runs your AI model as a chatbot, and yes, it's giving main character energy.
πΈ NAME πΈ
ramalama-run β run specified AI Model as a chatbot π¬
β¨ SYNOPSIS β¨
ramalama run [options] model [arg ...]
π MODEL TRANSPORTS π
okay so here's the whole vibe of where your model can come from, no cap:
- URL based β prefixes:
https://,http://,file://β web site vibes:https://web.site/ai.model,file:///tmp/ai.model - HuggingFace β prefixes:
huggingface://,hf://,hf.co/β web site:huggingface.co - ModelScope β prefixes:
modelscope://,ms://β web site:modelscope.cn - Ollama β prefix:
ollama://β web site:ollama.com - rlcr β prefix:
rlcr://β web site:ramalama.com - OCI Container Registries β prefixes:
oci://,docker://β web site:opencontainers.org - Hosted API Providers (deprecated) β prefix:
openai://β web site:api.openai.com
π¨ bestie listen β the hosted API transports are deprecated and will be removed in a future release. Instead oframalama run openai://<model>, 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 endpoint, don't get it twisted π
Models can be specified using a shortname (e.g. tiny) which is resolved via shortnames.conf, or with an explicit transport prefix such as huggingface://, oci://, ollama://, https://, http://, or file://. Models in the <org>/<model> format without a prefix are pulled from Hugging Face.
The default transport can be overridden in the ramalama.conf file or via the RAMALAMA_TRANSPORT environment variable. For example, export RAMALAMA_TRANSPORT=huggingface changes RamaLama to use the Hugging Face transport for unqualified model names. π
URL support means if a model is on a web site or even on your local system, you can run it directly. iconic, honestly β¨
Hosted API transports connect directly to the remote provider and bypass the local container runtime. In this mode, flags that tune local containers (for example --image, GPU settings, or --network) do not apply, and the provider's own capabilities and security posture govern the execution. URL support means if a model is on a web site or even on your local system, you can run it directly. π«Ά
π OPTIONS π
--api=llama-stack | noneβ Unified API layer for Inference, RAG, Agents, Tools, Safety, Evals, and Telemetry. (default:none) The default can be overridden in theramalama.conffile.--authfile=pathβ Path to the authentication file for OCI registries. π--backend=auto | vulkan | rocm | cuda | sycl | openvino | cann | musaβ GPU backend to use for inference (default:auto).
Available backends depend on the detected GPU hardware.
auto (default): Automatically selects the preferred backend based on your GPU:
- 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:
- 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:
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. For example, on a system with an AMD GPU, only auto, vulkan, and rocm are available. β¨
Configuration: The default can be overridden in the ramalama.conf file or via the RAMALAMA_BACKEND environment variable.
Examples:
# Use auto-detection (default)
ramalama run granite
# Force Vulkan backend
ramalama run --backend vulkan granite
# Force ROCm backend on AMD GPU
ramalama run --backend rocm granite
--cache-reuse=BYTESβ Minimum chunk size (in bytes) to attempt reusing from the cache via KV shifting. When omitted,llama-serveruses its built-in default. β»οΈ--colorβ Indicate whether to use color in the chat. Possible values are"never","always"and"auto". (default:auto) π--ctx-size,-cβ size of the prompt context. This option is also available as--max-model-len. Applies tollama.cppandvllmregardless of alias (default:0,0= loaded from model) π§--deviceβ Add a host device to the container. Optional permissions parameter can be used 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 thepodmanordockerinvocation (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. π±
--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 table 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:
Here's the vibe check on which image you get for which accelerator, bestie β RamaLama picks the right one for you, no cap β¨
- 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
And plot twist β the upstream llama.cpp "full" images from ghcr.io/ggml-org/llama.cpp are supported too π«Ά RamaLama literally auto-detects the image type and adjusts the container CLI accordingly. She's smart like that.
ramalama run --image ghcr.io/ggml-org/llama.cpp:full-vulkan MODEL
--interactive,-iβ keep the convo going after handling stdin or prompt args, i.e. go into interactive chat mode. By default, when arguments or piped input are provided, the command exits after displaying the response. This flag lets you keep chatting interactively π¬--keep-groupsβ pass--group-add keep-groupsto podman (default:False). If a GPU device on the host system is accessible to the user via group access, this option leaks the groups into the container.--keepaliveβ duration to keep a model loaded (e.g.5m).--logfile=pathβ log output to a file.--max-tokens=integerβ max number of tokens to generate. Set to0for unlimited output (default:0). This parameter gets mapped to the appropriate runtime-specific parameter:- llama.cpp:
-nparameter - MLX:
--max-tokensparameter - vLLM:
--max-model-lenparameter (mapped viactx_size)
- llama.cpp:
--mcp=SERVER_URLβ MCP (Model Context Protocol) servers to use for enhanced tool-calling capabilities. This option can be specified multiple times to connect to multiple MCP servers. Each server provides tools that can be automatically invoked during chat conversations π§--model-draftβ a draft model is a smaller, faster model that helps accelerate the decoding process of larger, more complex models, like Large Language Models (LLMs). It works by generating candidate sequences of tokens that the larger model then verifies and refines. This approach, often referred to as speculative decoding, can significantly improve the speed of inferencing by reducing the number of times the larger model needs to be invoked.
Use --runtime-args to pass the other draft model related parameters. Make sure the sampling parameters like top_k on the web UI are set correctly. π―
--name,-nβ name of the container to run the Model in.--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 that selection.
--port,-p=portβ port for AI Model server to listen on (default:8080).
The default can be overridden in the ramalama.conf file.
--prefixβ prefix for the user prompt (default:π¦ >).--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, this one's giving "I can break out of confinement" energy. Do NOT just casually set it, fr fr.
--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.
--rag=β specify path to Retrieval-Augmented Generation (RAG) database or an OCI Image containing a RAG database.
π Note: RAG support requires AI Models be run within containers, --nocontainer not supported. Docker does not support image mounting, meaning Podman support required.
--rag-image=β the image to use to process the RAG database specified by the--ragoption. The image must contain the/usr/bin/rag_frameworkexecutable, which will create a proxy which embellishes client requests with RAG data before passing them on to the LLM, and returns the responses.--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.--selinux=trueβ enable SELinux container separation (default:true).--spec-draft-n-max=Nβ maximum number of tokens to draft per speculative decoding step (default:3).--spec-draft-n-min=Nβ minimum number of draft tokens to use for speculative decoding (default:0).--spec-draft-p-min=Pβ minimum speculative decoding probability, greedy threshold (default:0.0).--spec-type=TYPESβ comma-separated list of speculative decoding types to enable. Available types:draft-simple,draft-eagle3,draft-mtp,ngram-simple,ngram-map-k,ngram-map-k4v,ngram-mod,ngram-cache. When omitted, speculative decoding is disabled.--summarize-after=Nβ automatically summarize conversation history after N messages to prevent context growth. When enabled, ramalama will periodically condense older messages into a summary, keeping only recent messages and the summary. This prevents the context from growing indefinitely during long chat sessions. Set to0to disable (default:4).--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. π‘οΈ
--thinking=BOOLβ enable or disable thinking mode in reasoning models. Maps to--reasoning onor--reasoning offinllama-server. When omitted,llama-serverdefaults toauto. π§--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 π
Run the specified AI Model as a chat bot, bestie π¦ RamaLama pulls the specified AI Model from the registry if it does not exist in local storage. By default, a prompt for a chat bot is started. When arguments or stdin are provided, they will be given to the AI Model and the output is returned. By default, the command exits after displaying the response, but you can use --interactive (-i) to continue to an interactive chat session after processing the initial prompt.
π INTERACTIVE COMMANDS π
When running in interactive chat mode (without arguments), these commands are available to you, queen π All commands are case-insensitive (e.g., /CLEAR, /Clear, and /clear all work β iconic, honestly).
/help,help,?β display help information showing all available commands and their descriptions./clearβ clear the conversation history without exiting the chat session. This resets the context and allows starting a fresh conversation without restarting the container or connection. A confirmation message will be displayed when the history is cleared. β¨/bye,exitβ exit the chat session and close the connection. π«Ά/tool [question]β (only available when using--mcp) manually select which MCP tool to use for a question. Without this command, the AI automatically decides whether to use tools based on the question. π§Ctrl + Dβ exit the chat session (EOF signal).
β¨ EXAMPLES β¨
Okay bestie, this is the part where we actually do stuff. Live footage of Ramalama being iconic π
π¦ The classic: no args = instant chatbot
Just run it with a model and boom, you're chatting. That's it. That's the whole thing.
ramalama run granite
>
That lonely little > is the chatbot waiting for you to say something. Say something. She's waiting. π₯Ί
β° Local model, but only for 10 minutes
Already got a model downloaded and just want a lil limited-time hangout? --keepalive 10m and it dips after ten minutes.
ramalama run --keepalive 10m file:///tmp/mymodel
>
π Multiple models, multiple ports, zero beef
Want more than one model running at the same time? Give this one its own port so nobody's fighting over the same address. Very demure, very mindful.
ramalama run --port 8081 granite
>
π Slide a prompt in through stdin, then keep the convo going
Pipe an initial prompt in with -i and it still sticks around for interactive chatting after. Chef's kiss. π
$ echo "Explain quantum computing" | ramalama run -i granite
[AI response...]
> Can you give me an example?
[AI response...]
> /bye
πΈ One-shot question, one-shot answer
No > prompt, no back-and-forth, just answer me and go.
ramalama run merlinite "when is the summer solstice"
The summer solstice, which is the longest day of the year, will happen on June ...
π Custom prompt + a file piped in
This is the "read my code and tell me what it does" combo. Absolute staple. Notice the model ref has a :1.0 tag and a USER in the path β keep that exact, bestie.
cat file.py | ramalama run quay.io/USER/granite-code:1.0 'what does this program do?'
This program is a Python script that allows the user to interact with a terminal. ...
[end of text]
π«Ά Sending multiple lines at ONCE
Okay this one is a trick and it's so good. You can stack up several lines before sending by slapping a backslash \ at the end of each line. The chatbot won't see any of it until you stop backslashing. Sneaky. Gorgeous. π
$ ramalama run granite
π¦ > Hi
π¦ > tell me a funny story
π¦ > please
π§ Wiping the conversation mid-session
Memory getting messy? /clear and it's like nothing ever happened. Fresh slate, fresh vibes. β¨
$ ramalama run granite
π¦ > What is the capital of France?
Paris
π¦ > /clear
Conversation history cleared.
π¦ > What is 2+2?
4
π¦ Exit Codes:
0β Success π124β RamaLama command did not exit within the keepalive time.
That 124 one is not a crash, okay?? It means the keepalive timer ran out and the command got yeeted. Not a bug, it's a feature, periodt. π
π NVIDIA CUDA Support
Want that GPU glow-up? Go read ramalama-cuda(7) for how to set up your host Linux system for CUDA support. That's the whole assignment. Go. Read it. π«‘
π SEE ALSO
π HISTORY
Aug 2024, Originally compiled by Dan Walsh dwalsh@redhat.com <mailto:dwalsh@redhat.com>
And that's a wrap on ramalama-run(1) bestie!! ππ Source/version and date for this little masterpiece: ramalama-run(1), Aug 2024. Thank you for coming to my TED talk, now go run some models. Mwah. π
ππ¦
π¦ 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