ramalama-convert(1)
ramalama-convert π
okay bestie, welcome to the ramalama-convert(1) page from the General Commands Manual β this is the one that turns your local AI models into OCI images, and it is lowkey iconic. π¦
β¨ NAME β¨
ramalama-convert β convert AI Models from local storage to OCI Image π
π SYNOPSIS π
ramalama convert [options] model [target]
π DESCRIPTION π
So the whole vibe here: you take the AI Model you specified and you convert it into an OCI Formatted AI Model. That's it. That's the mission. π«Ά
Your model can come from RamaLama model storage in Huggingface, Ollama, or just a local model chillin' on disk. What it can NOT be is an OCI model β converting from an OCI model is not supported, periodt. π
Note: the convert command must be run with containers. The --nocontainer option is not allowed. No exceptions, bestie, don't even try it. π
πΈ OPTIONS πΈ
--engine-args="args"β drop extra args into the podman or docker invocation (right before the container image), landing after the RamaLama-generated options and the model bind mounts. You can pass this option multiple times; each value gets shell-split and all the tokens get handed to the engine in order. Use it for extra--mountflags (multimodal projector files, for example) or any other engine-specific options. Shell-quoting rules match--runtime-args. π--gguf=Q2_K | Q3_K_S | Q3_K_M | Q3_K_L | Q4_0 | Q4_K_S | Q4_K_M | Q5_0 | Q5_K_S | Q5_K_M | Q6_K | Q8_0β convert Safetensor models into a GGUF using the quantization format you picked. Wanna learn more about model quantization? Go read the llama.cpp documentation: https://github.com/ggml-org/llama.cpp/blob/master/tools/quantize/README.md π--help,-hβ show this help message and dip. βοΈ--image=IMAGEβ the image used for model quantization when you're converting to GGUF format (aka when the--ggufoption has been specified). The image must have thellama-quantizeexecutable available on thePATH. It defaults to the appropriate ramalama image based on the available accelerators. And if there are no accelerators available, the currentquay.io/ramalama/ramalamaimage gets used. π³--network=noneβ set the network mode for the container. π--pull=policyβ the pull image policy. 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, just 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 newer when the digests are different. Comparing the time stamps is prone to errors. Pull errors are suppressed if a local image was found. β
--tools-image=IMAGEβ the image used when converting to GGUF format (when the--ggufoption has been specified). The image must have thellama-convert-hf-to-ggufscript executable and available in thePATH. That script is available from the llama.cpp GitHub repo. Defaults to the currentquay.io/ramalama/ramalama-toolsimage. π§°--type="artifact" | raw | carβ convert the MODEL to the specified OCI Object. Here's the rundown, bestie:artifactβ Store AI Models as artifacts. πcarβ Traditional OCI image including base image with the model stored in a/modelssubdir. πrawβ Traditional OCI image including only the model and a link filemodel.filepointed at it stored at/. π
π₯ EXAMPLE π₯
Generate an oci model out of an Ollama model. β¨
$ ramalama convert ollama://tinyllama:latest oci://quay.io/rhatdan/tiny:latest
Building quay.io/rhatdan/tiny:latest...
STEP 1/2: FROM scratch
STEP 2/2: COPY sha256:2af3b81862c6be03c769683af18efdadb2c33f60ff32ab6f83e42c043d6c7816 /model
--> Using cache 69db4a10191c976d2c3c24da972a2a909adec45135a69dbb9daeaaf2a3a36344
COMMIT quay.io/rhatdan/tiny:latest
--> 69db4a10191c
Successfully tagged quay.io/rhatdan/tiny:latest
69db4a10191c976d2c3c24da972a2a909adec45135a69dbb9daeaaf2a3a36344
Generate and run an oci model with a quantized GGUF converted from Safetensors. π
$ ramalama convert --gguf Q4_K_M hf://ibm-granite/granite-3.2-2b-instruct oci://quay.io/kugupta/granite-3.2-q4-k-m:latest
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...
$ ramalama run oci://quay.io/kugupta/granite-3.2-q4-k-m:latest
π¦ SEE ALSO π¦
π HISTORY π
Aug 2024, Originally compiled by Eric Curtin ecurtin@redhat.com β¨mailto:ecurtin@redhat.comβ©
and that's the whole page, bestie!! π this was ramalama-convert(1) from the General Commands Manual β go forth and convert, you absolute main character. iykyk. π
β¨π«Ά
π¦ 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