Quantizing an Ollama model creates a smaller or faster local model from higher-precision weights. The tradeoff is reduced precision, so the result should be tested against the task it will actually run.
Ollama quantization is handled by ollama create with the --quantize flag when the Modelfile starts from FP16 or FP32 model weights. Common levels include q8_0 and K-means levels such as q4_K_M.
Quantization needs source weights and enough local resources to process them. Do not claim a quantized model is acceptable until it passes a real prompt or evaluation for the workload.
Related: How to import a model into Ollama
Related: How to create a custom Ollama model
Related: How to run a model in Ollama
FROM /srv/models/gemma-f16
$ ollama create --quantize q4_K_M example/gemma-q4 -f Modelfile transferring model data quantizing F16 model to Q4_K_M writing manifest success
$ ollama show example/gemma-q4 Model quantization Q4_K_M ##### snipped #####
$ ollama run example/gemma-q4 "Return only OK." OK
$ ollama list NAME ID SIZE example/gemma-q4 735e246cc1ab 4.8 GB