RamaLama strives to make working with AI simple, straightforward, and familiar by using OCI containers. Description RamaLama is an open-source tool that simplifies the local use and serving of AI models for inference from any source through the familiar approach of containers. It allows engineers to use container-centric development patterns and benefits to extend to AI use cases. RamaLama eliminates the need to…
RamaLama is an open-source developer tool that simplifies the local serving of AI models from any source and facilitates their use for inference in production, all through the familiar language of containers.
RamaLama strives to make working with AI simple, straightforward, and familiar by using OCI containers.
Description
RamaLama is an open-source tool that simplifies the local use and serving of AI models for inference from any source through the familiar approach of containers. It allows engineers to use container-centric development patterns and benefits to extend to AI use cases.
RamaLama eliminates the need to configure the host system by instead pulling a container image specific to the GPUs discovered on the host system, and allowing you to work with various models and platforms.
Eliminates the complexity for users to configure the host system for AI.
Detects and pulls an accelerated container image specific to the GPUs on the host system, handling dependencies and hardware optimization.
RamaLama supports multiple AI model registries, including OCI Container Registries.
Models are treated similarly to how Podman and Docker treat container images.
RamaLama is available in Fedora and later. To install it, run:
sudo dnf install ramalama
Fedora Silverblue and Toolbox
On Fedora Silverblue and other immutable variants, the system is read-only. You can run RamaLama in either of these ways:
Toolbox: Create a Toolbox container and install RamaLama inside it (pip install ramalama or dnf install ramalama if available). Use the same Podman (or Docker) from the host so that RamaLama can start model containers; ensure the container engine is installed and that the toolbox has access to the host’s container engine (e.g., by bind-mounting the socket or by configuring the toolbox to use the host’s podman command).
Host Installation or Toolbox with Host Access: Install RamaLama on the host via rpm-ostree install ramalama if the package is available for your image, or run RamaLama from a toolbox, ensuring Podman/Docker is available and the model store is on a writable location (e.g., your home directory).
The model store defaults to ~/.local/share/ramalama, which is writable on Silverblue.
Note: Windows support requires running containers via Docker/Podman. The model store uses hardlinks (no admin required) or falls back to file copies if hardlinks are unavailable.
Uninstall
Uninstall via pip
If you installed RamaLama using pip, you can uninstall it with:
pip uninstall ramalama
Uninstall on Fedora
If you installed RamaLama using DNF:
sudo dnf remove ramalama
Uninstall on macOS (Self-Contained Installer)
To remove RamaLama installed via the .pkg installer:
After uninstalling RamaLama using any method above, you may want to remove downloaded models and configuration files:
# Remove downloaded models and data (can be large)
rm -rf -- "${XDG_DATA_HOME:-$HOME/.local/share}/ramalama"
# Remove configuration files
rm -rf -- "${XDG_CONFIG_HOME:-$HOME/.config}/ramalama"
# If you ran RamaLama as root, also remove:
sudo rm -rf /var/lib/ramalama
Note: The model data directory (by default ~/.local/share/ramalama) can be quite large depending on how many models you’ve downloaded. Make sure you want to remove these files before running the commands above.
On first run, RamaLama inspects your system for GPU support, falling back to CPU if none are present. RamaLama uses container engines like Podman or Docker to pull the appropriate OCI image with all necessary software to run an AI Model for your system setup.
How does RamaLama select the right image?
After initialization, RamaLama runs AI Models within a container based on the OCI image. RamaLama pulls container images specific to the GPUs discovered on your system. These images are tied to the minor version of RamaLama.
For example, RamaLama version 1.2.3 on an NVIDIA system pulls quay.io/ramalama/cuda:1.2. To override the default image, use the --image option.
RamaLama then pulls AI Models from model registries, starting a chatbot or REST API service from a simple single command. Models are treated similarly to how Podman and Docker treat container images.
Hardware Support
Hardware
Enabled
CPU
✓
Apple Silicon GPU (Linux / Asahi)
✓
Apple Silicon GPU (macOS)
✓ llama.cpp or MLX
Apple Silicon GPU (podman-machine)
✓
Nvidia GPU (cuda)
✓ See note below
AMD GPU (rocm, vulkan)
✓
Ascend NPU (Linux)
✓
Intel ARC GPUs (Linux)
✓ See note below
Intel GPUs (vulkan / Linux)
✓
Moore Threads GPU (musa / Linux)
✓ See note below
Windows (with Docker/Podman)
✓ Requires WSL2
Nvidia GPUs
On systems with NVIDIA GPUs, see ramalama-cuda documentation for the correct host system configuration.
Intel GPUs
The following Intel GPUs are auto-detected by RamaLama:
On systems with Moore Threads GPUs, see ramalama-musa documentation for the correct host system configuration.
MLX Runtime (macOS only)
The MLX runtime provides optimized inference for Apple Silicon Macs. MLX requires:
macOS operating system
Apple Silicon hardware (M1, M2, M3, or later)
Usage with --nocontainer option (containers are not supported)
The mlx-lm uv package installed on the host system as a uv tool
To install and run Phi-4 on MLX, use uv. If uv is not installed, you can install it with curl -LsSf https://astral.sh/uv/install.sh | sh:
uv tool install mlx-lm
# or upgrade to the latest version:
uv tool upgrade mlx-lm
ramalama --runtime=mlx serve hf://mlx-community/Unsloth-Phi-4-4bit
Default Container Engine
When both Podman and Docker are installed, RamaLama defaults to Podman. The RAMALAMA_CONTAINER_ENGINE=docker environment variable can override this behaviour. When neither are installed, RamaLama will attempt to run the model with software on the local system.
Security
Test and run your models more securely
Because RamaLama defaults to running AI models inside rootless containers using Podman or Docker, these containers isolate the AI models from information on the underlying host. With RamaLama containers, the AI model is mounted as a volume into the container in read-only mode.
This results in the process running the model (llama.cpp or vLLM) being isolated from the host. Additionally, since ramalama run uses the --network=none option, the container cannot reach the network and leak any information out of the system. Finally, containers are run with the --rm option, which means any content written during container execution is deleted when the application exits.
Here’s how RamaLama delivers a robust security footprint:
Container Isolation – AI models run within isolated containers, preventing direct access to the host system.
Read-Only Volume Mounts – The AI model is mounted in read-only mode, which means that processes inside the container cannot modify the host files.
No Network Access – ramalama run is executed with --network=none, meaning the model has no outbound connectivity for which information can be leaked.
Auto-Cleanup – Containers run with --rm, wiping out any temporary data once the session ends.
Drop All Linux Capabilities – No access to Linux capabilities to attack the underlying host.
No New Privileges – Linux Kernel feature that disables container processes from gaining additional privileges.
Transports
RamaLama supports multiple AI model registries types called transports.
Models specified in the Hugging Face <org>/<model> format are automatically pulled from Hugging Face. For models specified without an organization (e.g. granite-code), RamaLama currently defaults to the Ollama transport. Note: Ollama models are no longer compatible with llama.cpp, and support for the Ollama transport will be removed in a future release. Users should migrate to Hugging Face models.
How to change transports.
Use the RAMALAMA_TRANSPORT environment variable to modify the default. export RAMALAMA_TRANSPORT=huggingface Changes RamaLama to use huggingface transport.
Individual model transports can be modified when specifying a model via the huggingface://, oci://, modelscope://, ollama://, or rlcr:// prefix.
To make it easier for users, RamaLama uses shortname files, which contain alias names for fully specified AI Models, allowing users to refer to models using shorter names.
More information on shortnames.
RamaLama reads shortnames.conf files if they exist. These files contain a list of name-value pairs that specify the model. The following table specifies the order in which RamaLama reads the files. Any duplicate names that exist override previously defined shortnames.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
85ad75ecf866 quay.io/ramalama/ramalama:latest /usr/bin/ramalama... 5 hours ago Up 5 hours 0.0.0.0:8080->8080/tcp ramalama_s3Oh6oDfOP
85ad75ecf866 quay.io/ramalama/ramalama:latest /usr/bin/ramalama... 4 minutes ago Exited (0) 4 minutes ago granite-server
Converting /Users/kugupta/.local/share/ramalama/models/huggingface/ibm-granite/granite-3.2-2b-instruct to quay.io/kugupta/granite-3.2-q4-k-m:latest...
Building quay.io/kugupta/granite-3.2-q4-k-m:latest...
Run the generated model
$ ramalama run oci://quay.io/kugupta/granite-3.2-q4-k-m:latest
You can `list` all models pulled into local storage.
$ ramalama list
Returns for example:
NAME MODIFIED SIZE
ollama://smollm:135m 16 hours ago 5.5M
huggingface://afrideva/Tiny-Vicuna-1B-GGUF/tiny-vicuna-1b.q2_k.gguf 14 hours ago 460M
ollama://moondream:latest 6 days ago 791M
ollama://phi4:latest 6 days ago 8.43 GB
ollama://tinyllama:latest 1 week ago 608.16 MB
ollama://granite3-moe:3b 1 week ago 1.92 GB
ollama://granite3-moe:latest 3 months ago 1.92 GB
ollama://llama3.1:8b 2 months ago 4.34 GB
ollama://llama3.1:latest 2 months ago 4.34 GB
Logging in to Hugging Face requires the hf tool. For installation and usage instructions, see the documentation of the Hugging Face command line interface.
Generate and convert Retrieval Augmented Generation (RAG) data from provided documents into an OCI Image.
Note 注意
this command does not work without a container engine.
Generate RAG data from provided documents and convert into an OCI Image.
This command uses a specific container image containing the docling tool to convert the specified content into a RAG vector database. If the image does not exist locally, RamaLama will pull the image down and launch a container to process the data.
Positional arguments:
PATH Files/Directory containing PDF, DOCX, PPTX, XLSX, HTML, AsciiDoc & Markdown formatted files to be processed. Can be specified multiple times.
IMAGE OCI Image name to contain processed rag data
ramalama rag ./README.md https://github.com/containers/podman/blob/main/README.md quay.io/ramalama/myrag
100% |███████████████████████████████████████████████████████| 114.00 KB/ 0.00 B 922.89 KB/s 59m 59s
Building quay.io/ramalama/myrag...
adding vectordb...
c857ebc65c641084b34e39b740fdb6a2d9d2d97be320e6aa9439ed0ab8780fe0
The image can then be used with:
ramalama run --rag quay.io/ramalama/myrag instructlab/merlinite-7b-lab
Run a chatbot on a model using the run command. By default, it pulls from the Ollama registry.
Note: RamaLama will inspect your machine for native GPU support and then will use a container engine like Podman to pull an OCI container image with the appropriate code and libraries to run the AI Model. This can take a long time to setup, but only on the first run.
$ ramalama run instructlab/merlinite-7b-lab
After the initial container image has been downloaded, you can interact with different models using the container image.
$ ramalama run granite3-moe
Returns for example:
> Write a hello world application in python
print("Hello World")
In a different terminal window see the running podman container.
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
91df4a39a360 quay.io/ramalama/ramalama:latest /home/dwalsh/rama... 4 minutes ago Up 4 minutes gifted_volhard
When the web UI is enabled, you can connect via your browser at: 127.0.0.1:< port >
The default serving port will be 8080 if available, otherwise a free random port in the range 8081-8090. If you wish, you can specify a port to use with --port/-p.
Run two AI Models at the same time. Notice both are running within Podman Containers.
$ ramalama serve -d -p 8080 --name mymodel ollama://smollm:135m
09b0e0d26ed28a8418fb5cd0da641376a08c435063317e89cf8f5336baf35cfa
$ ramalama serve -d -n example --port 8081 oci://quay.io/mmortari/gguf-py-example/v1/example.gguf
3f64927f11a5da5ded7048b226fbe1362ee399021f5e8058c73949a677b6ac9c
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
09b0e0d26ed2 quay.io/ramalama/ramalama:latest /usr/bin/ramalama... 32 seconds ago Up 32 seconds 0.0.0.0:8081->8081/tcp ramalama_sTLNkijNNP
3f64927f11a5 quay.io/ramalama/ramalama:latest /usr/bin/ramalama... 17 seconds ago Up 17 seconds 0.0.0.0:8082->8082/tcp ramalama_YMPQvJxN97
To disable the web UI, use the `--webui` off flag.
+---------------------------+
| |
| ramalama run granite3-moe |
| |
+-------+-------------------+
|
|
| +------------------+ +------------------+
| | Pull inferencing | | Pull model layer |
+-----------| runtime (cuda) |---------->| granite3-moe |
+------------------+ +------------------+
| Repo options: |
+-+-------+------+-+
| | |
v v v
+---------+ +------+ +----------+
| Hugging | | OCI | | Ollama |
| Face | | | | Registry |
+-------+-+ +---+--+ +-+--------+
| | |
v v v
+------------------+
| Start with |
| cuda runtime |
| and |
| granite3-moe |
+------------------+
In development
Regarding this alpha, everything is under development, so expect breaking changes. If you need to reset your installation, see the Uninstall section above for instructions on removing RamaLama and cleaning up all data files, then reinstall.
Known Issues
On certain versions of Python on macOS, certificates may not installed correctly, potentially causing SSL errors (e.g., when accessing huggingface.co). To resolve this, run the Install Certificates command, typically as follows:
For discussions around issues/bugs and features, you can use the GitHub Issues and PRs tracking system.
Community / Developer Meetups
We host a public community and developer meetup on Discord every other week to discuss project direction and provide an open forum for users to get help, ask questions, and showcase new features.
评论