84 Downloads Updated 1 week ago
ollama run byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
ollama launch claude --model byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
ollama launch codex-app --model byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
ollama launch openclaw --model byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
ollama launch hermes --model byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
ollama launch codex --model byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
ollama launch opencode --model byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
A compact multimodal build of Gemma 4 31B Instruct with vision support, prepared for local use with Ollama.
This model is optimized to fit within 16 GB of VRAM using Q3_K_S quantization. In tested configurations, the practical context window that still fits within 16 GB VRAM is approximately 36,000–40,000 tokens.
byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
ollama run byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
Flash Attention and a quantized KV cache can reduce memory usage and allow a larger practical context window:
OLLAMA_FLASH_ATTENTION=1 \
OLLAMA_KV_CACHE_TYPE=q4_0 \
OLLAMA_CONTEXT_LENGTH=36864 \
ollama serve
Then run the model in another terminal:
ollama run byczech/gemma4-it-mmproj-16G-Q3_K_S:31b
You can verify whether the model is fully loaded on the GPU with:
ollama ps
The PROCESSOR column should ideally report 100% GPU.
Install the Ollama Python package:
pip install ollama
Then pass an image path to the model:
from ollama import chat
response = chat(
model="byczech/gemma4-it-mmproj-16G-Q3_K_S:31b",
messages=[
{
"role": "user",
"content": "Describe this image in detail.",
"images": ["image.jpg"],
}
],
)
print(response.message.content)
A context size of around 36,000–40,000 tokens can fit within 16 GB VRAM in suitable configurations. The exact maximum is not fixed and may vary depending on:
If the model does not fit fully on the GPU at 40K context, reduce the context size gradually, for example:
OLLAMA_CONTEXT_LENGTH=36000 ollama serve
You can also set the context explicitly per request with num_ctx.
The model uses Q3_K_S quantization to make a 31B multimodal model practical on a 16 GB GPU. This significantly reduces memory requirements, but it may also reduce output quality compared with larger or less aggressively quantized variants.
Using a Q4_0 KV cache further reduces memory usage and helps preserve more VRAM for the context window. For higher KV-cache precision, use q8_0, but expect a smaller practical context window.
OLLAMA_NUM_PARALLEL=1 for the lowest memory usage.