[GH-ISSUE #3114] Using INT4 Quantization to Save VRAM with ollama #27674

Closed
opened 2026-04-22 05:12:31 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @TraceRecursion on GitHub (Mar 13, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3114

Hello ollama team,

I am currently exploring the use of ollama to run models and am interested in implementing INT4 quantization to save on VRAM usage. I have read through the documentation but would appreciate some guidance on how to properly apply INT4 quantization during the model run.

Could you provide some insights or examples on how to integrate this quantization method with ollama? Specifically, I am looking for ways to reduce the VRAM footprint while maintaining performance.

Thank you for your assistance.

Best regards,
溯源递归

Originally created by @TraceRecursion on GitHub (Mar 13, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3114 Hello ollama team, I am currently exploring the use of ollama to run models and am interested in implementing INT4 quantization to save on VRAM usage. I have read through the documentation but would appreciate some guidance on how to properly apply INT4 quantization during the model run. Could you provide some insights or examples on how to integrate this quantization method with ollama? Specifically, I am looking for ways to reduce the VRAM footprint while maintaining performance. Thank you for your assistance. Best regards, 溯源递归
Author
Owner

@orlyandico commented on GitHub (Mar 13, 2024):

Why not just import a model that has already been quantised? e.g. in GGUF format. I think quantising the model on the fly (particularly for larger models) would take an enormous amount of time. Most of the models in the model library are already quantised to 4.xx bpw, which is equivalent to INT4.

<!-- gh-comment-id:1995893644 --> @orlyandico commented on GitHub (Mar 13, 2024): Why not just import a model that has already been quantised? e.g. in GGUF format. I think quantising the model on the fly (particularly for larger models) would take an enormous amount of time. Most of the models in the model library are already quantised to 4.xx bpw, which is equivalent to INT4.
Author
Owner

@easp commented on GitHub (Mar 14, 2024):

New quantizations would need to be implemented upstream in llama.cpp. There are already a variety of quantization approaches implemented there and the models in the ollama library are into a range of sizes using a few of those approaches. If you pull an ollama model without specifying the quantization it will pull a q4_0 version.

<!-- gh-comment-id:1996238709 --> @easp commented on GitHub (Mar 14, 2024): New quantizations would need to be implemented upstream in llama.cpp. There are already a variety of quantization approaches implemented there and the models in the ollama library are into a range of sizes using a few of those approaches. If you pull an ollama model without specifying the quantization it will pull a q4_0 version.
Author
Owner

@TraceRecursion commented on GitHub (Mar 14, 2024):

appreciate your help

<!-- gh-comment-id:1997673036 --> @TraceRecursion commented on GitHub (Mar 14, 2024): appreciate your help
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#27674