[BUG] Vision capability not working for Gemma4 GGUF in Ollama

#31
by notuncommon - opened

Hi,

Vision capability is not working for Unsloth Gemma4 GGUF in Ollama.

Ollama version: v0.20.8

Tested with the following Ollama modelfile configurations:

  1. FROM ".\unsloth_gemma-4-26B-A4B-it-UD-Q3_K_M.gguf"
    ADAPTER ".\unsloth_mmproj-F16.gguf"
    TEMPLATE {{ .Prompt }}
    RENDERER gemma4
    PARSER gemma4

  2. FROM ".\unsloth_gemma-4-26B-A4B-it-UD-Q3_K_M.gguf"
    FROM ".\unsloth_mmproj-F16.gguf"
    TEMPLATE {{ .Prompt }}
    RENDERER gemma4
    PARSER gemma4

  3. FROM ".\unsloth_mmproj-BF16.gguf"
    FROM ".\unsloth_gemma-4-26B-A4B-it-UD-Q3_K_M.gguf"
    TEMPLATE {{ .Prompt }}
    RENDERER gemma4
    PARSER gemma4

Command: 'Ollama show unsloth_gemma-4-26B-A4B-it-UD-Q3_K_M' verifies that CLIP and Vision capability are enabled when creating the model in Ollama using the modelfiles above, however the model fails to load and need to revert to text only. Error: 500 Internal server error occurred.

Testing conditions:

  1. Using both mmproj F16 and BF16. Result: Fail.
  2. Using various different Q bit flavors. Result: Fail.

Is there an open issue or roadmap for enabling this feature?

Thanks

Unsloth AI org

Ollama doesn't allow separate mmproj files for GGUFs. Ollama will need to enable support for it @notuncommon

Ollama doesn't allow separate mmproj files for GGUFs. Ollama will need to enable support for it @notuncommon

Thanks for your response @danielhanchen , Ollama (v0.20.6) does support mmproj files in my experience; it works with Unsloth Mistral Small 3.2 24B.

Link: https://huggingface.co/unsloth/Mistral-Small-3.2-24B-Instruct-2506-GGUF

See the modelfile I prepared working for Mistral below:

FROM "Unsloth_Mistral-Small-3.2-24B-Instruct-2506-UD-Q3_K_XL.gguf"
ADAPTER "\Unsloth_Mistral-Small3.2-mmproj-F16.gguf"
TEMPLATE """{{- range $index, $_ := .Messages }}
{{- if eq .Role "system" }}[SYSTEM_PROMPT]{{ .Content }}[/SYSTEM_PROMPT]
{{- else if eq .Role "user" }}
{{- if and (le (len (slice $.Messages $index)) 2) $.Tools }}[AVAILABLE_TOOLS]{{ $.Tools }}[/AVAILABLE_TOOLS]
{{- end }}[INST]{{ .Content }}[/INST]
{{- else if eq .Role "assistant" }}
{{- if .Content }}{{ .Content }}
{{- if not (eq (len (slice $.Messages $index)) 1) }}</s>
{{- end }}
{{- else if .ToolCalls }}
{{- range $i, $_ := .ToolCalls }}[TOOL_CALLS]{{ .Function.Name }}[CALL_ID]{{ $i }}[ARGS]{{ .Function.Arguments }}
{{- end }}</s>
{{- end }}
{{- else if eq .Role "tool" }}[TOOL_RESULTS]{"content": {{ .Content }}}[/TOOL_RESULTS]
{{- end }}
{{- end }}"""
SYSTEM """You are Mistral Small 3.2, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.
You power an AI assistant called Le Chat.
Your knowledge base was last updated on 2023-10-01.
"""
PARAMETER temperature 0.15
LICENSE """
"""

Sign up or log in to comment