[GH-ISSUE #13804] Request for Modelfile for FunctionGemma #34802

Closed
opened 2026-04-22 18:40:25 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @derrick56007 on GitHub (Jan 20, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/13804

Hi all, I'm wondering if anyone has a working Modelfile for functiongemma.

After following the finetune instructions here, I'm required to use a Modelfile to add the model to ollama.

I've attempting variations of the below but am unable to get tool calling generation to work.

FROM functiongemma-finetune

SYSTEM """You are a model that can do function calling."""

# 2. TEMPLATE: This matches the "developer" role and <escape> logic exactly.
TEMPLATE """{{- if .System }}<start_of_turn>developer
{{ .System }} with the following functions
{{- if .Tools }}
{{- range .Tools }}<start_function_declaration>declaration:{{ .Function.Name }}{description:<escape>{{ .Function.Description }}<escape>,parameters:{{ .Function.Parameters }}}<end_function_declaration>
{{- end }}
{{- end }}<end_of_turn>
{{- end }}
{{- range .Messages }}
{{- if eq .Role "user" }}<start_of_turn>user
{{ .Content }}<end_of_turn>
{{- else if eq .Role "assistant" }}<start_of_turn>model
{{- if .Content }}{{ .Content }}{{ end }}
{{- if .ToolCalls }}
<start_function_call>
{{- range .ToolCalls }}
call:{{ .Function.Name }}{arguments:{{ .Function.Arguments }}}
{{- end }}
<end_function_call>
{{- end }}<end_of_turn>
{{- else if eq .Role "tool" }}<start_of_turn>user
<start_function_response>
response:{{ .Function.Name }}{value:<escape>{{ .Content }}<escape>}
<end_function_response><end_of_turn>
{{- end }}
{{- end }}<start_of_turn>model
"""

PARAMETER temperature 0.0
PARAMETER stop "<end_of_turn>"

However this produces outputs without tool calls

Originally created by @derrick56007 on GitHub (Jan 20, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/13804 Hi all, I'm wondering if anyone has a working Modelfile for functiongemma. After following the finetune instructions [here](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/FunctionGemma_(270M).ipynb), I'm required to use a Modelfile to add the model to ollama. I've attempting variations of the below but am unable to get tool calling generation to work. ``` FROM functiongemma-finetune SYSTEM """You are a model that can do function calling.""" # 2. TEMPLATE: This matches the "developer" role and <escape> logic exactly. TEMPLATE """{{- if .System }}<start_of_turn>developer {{ .System }} with the following functions {{- if .Tools }} {{- range .Tools }}<start_function_declaration>declaration:{{ .Function.Name }}{description:<escape>{{ .Function.Description }}<escape>,parameters:{{ .Function.Parameters }}}<end_function_declaration> {{- end }} {{- end }}<end_of_turn> {{- end }} {{- range .Messages }} {{- if eq .Role "user" }}<start_of_turn>user {{ .Content }}<end_of_turn> {{- else if eq .Role "assistant" }}<start_of_turn>model {{- if .Content }}{{ .Content }}{{ end }} {{- if .ToolCalls }} <start_function_call> {{- range .ToolCalls }} call:{{ .Function.Name }}{arguments:{{ .Function.Arguments }}} {{- end }} <end_function_call> {{- end }}<end_of_turn> {{- else if eq .Role "tool" }}<start_of_turn>user <start_function_response> response:{{ .Function.Name }}{value:<escape>{{ .Content }}<escape>} <end_function_response><end_of_turn> {{- end }} {{- end }}<start_of_turn>model """ PARAMETER temperature 0.0 PARAMETER stop "<end_of_turn>" ``` However this produces outputs without tool calls
GiteaMirror added the questionmodel labels 2026-04-22 18:40:32 -05:00
Author
Owner

@rick-github commented on GitHub (Jan 20, 2026):

ollama has a built-in renderer/parser for functiongemma, a template is not required.

FROM  functiongemma-finetune

RENDERER functiongemma
PARSER functiongemma

PARAMETER temperature 0.0
PARAMETER stop "<end_of_turn>"
<!-- gh-comment-id:3775446403 --> @rick-github commented on GitHub (Jan 20, 2026): ollama has a built-in renderer/parser for functiongemma, a template is not required. ```dockerfile FROM functiongemma-finetune RENDERER functiongemma PARSER functiongemma PARAMETER temperature 0.0 PARAMETER stop "<end_of_turn>" ```
Author
Owner

@derrick56007 commented on GitHub (Jan 21, 2026):

Thanks for that info, will give it a try!

<!-- gh-comment-id:3780864926 --> @derrick56007 commented on GitHub (Jan 21, 2026): Thanks for that info, will give it a try!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#34802