Ollama · functiongemma

> Requires Ollama v0.13.5 or later ### FunctionGemma FunctionGemma is a lightweight, open model from Google, built as a foundation for creating your own specialized function calling models. The model…

ollama/functiongemma

> Requires Ollama v0.13.5 or later

### FunctionGemma

FunctionGemma is a lightweight, open model from Google, built as a foundation for creating your own specialized function calling models. The model is well suited for text-only function calling. The uniquely small size makes it possible to deploy in environments with limited resources such as laptops, desktops or your own cloud infrastructure, democratizing access to state of the art AI models and helping foster innovation for everyone.

FunctionGemma is not intended for use as a direct dialogue model, and is designed to be highly performant after further fine-tuning, as is typical of models this size.

Built on the Gemma 3 270M model and with the same research and technology used to create the Gemini models, FunctionGemma has been trained specifically for function calling. The model has the same architecture as Gemma 3, but uses a different chat format.

Furthermore, akin to the base Gemma 270M, the model has been optimized to be extremely versatile, performant on a variety of hardware in single turn scenarios, but should be finetuned on single turn or multiturn task specific data to achieve best accuracy in specific domains.

### Examples

#### Python Run the python example with `uv run tool.py` ```python # /// script # requires-python = ">=3.11" # dependencies = [ # "ollama", # "rich", # ] # /// """ Single tool, single turn example. Run with: uv run tool.py """

import json

from rich import print

from ollama import chat

model = 'functiongemma'

def get_weather(city: str) -> str: """ Get the current weather for a city.

Args: city: The name of the city

Returns: A string describing the weather """ return json.dumps({'city': city, 'temperature': 22, 'unit': 'celsius', 'condition': 'sunny'})

messages = [{'role': 'user', 'content': 'What is the weather in Paris?'}] print('Prompt:', messages[0]['content'])

response = chat(model, messages=messages, tools=[get_weather])

if response.message.tool_calls: tool = response.message.tool_calls[0] print(f'Calling: {tool.function.name}({tool.function.arguments})')

result = get_weather(**tool.function.arguments) print(f'Result: {result}')

messages.append(response.message) messages.append({'role': 'tool', 'content': result})

final = chat(model, messages=messages) print('Response:', final.message.content) else: print('Response:', response.message.content)

```

### TypeScript

Run the TypeScript example with `bun run tool.ts` or `npx tsx tool.ts` ```typescript /** * Single tool, single turn example. * Run with: bun run tool.ts or npx tsx tool.ts */

const OLLAMA_HOST = process.env.OLLAMA_HOST || 'http://localhost:11434'; const MODEL = 'functiongemma';

function getWeather(city: string): string { return JSON.stringify({ city, temperature: 22, unit: 'celsius', condition: 'sunny' }); }

const tools = [ { type: 'function', function: { name: 'get_weather', description: 'Get the current weather for a city.', parameters: { type: 'object', properties: { city: { type: 'string', description: 'The name of the city' }, }, required: ['city'], }, }, }, ];

interface Message { role: string; content: string; tool_calls?: { function: { name: string; arguments: Record<string, string> } }[]; }

interface ChatResponse { message: Message; }

async function chat(messages: Message[]): Promise<ChatResponse> { const response = await fetch(`${OLLAMA_HOST}/api/chat`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ model: MODEL, messages, tools, stream: false }), });

if (!response.ok) { throw new Error(`HTTP error: ${response.status} ${await response.text()}`); }

return response.json(); }

async function main() { const messages: Message[] = [{ role: 'user', content: 'What is the weather in Paris?' }]; console.log('Prompt:', messages[0].content);

const response = await chat(messages);

if (response.message.tool_calls?.length) { const tool = response.message.tool_calls[0]; console.log(`Calling: ${tool.function.name}(${JSON.stringify(tool.function.arguments)})\n`);

const result = getWeather(tool.function.arguments.city); console.log('Function Result:', result);

messages.push(response.message); messages.push({ role: 'tool', content: result });

const final = await chat(messages); console.log('Response:', final.message.content); } else { console.log('Response:', response.message.content); } }

main().catch(console.error); ```

### Benchmark

<table> <thead> <tr> <th><strong>Benchmark</strong></th> <th><strong>n-shot</strong></th> <th><strong>Function Gemma 270m</strong></th> </tr> </thead> <tbody> <tr> <td>BFCL Simple</td> <td>0-shot</td> <td>61.6</td> </tr> <tr> <td>BFCL Multiple</td> <td>0-shot</td> <td>63.5</td> </tr> <tr> <td>BFCL Parallel</td> <td>0-shot</td> <td>39</td> </tr> <tr> <td>BFCL Parallel Multiple</td> <td>0-shot</td> <td>29.5</td> </tr> <tr> <td>BFCL Live Simple</td> <td>0-shot</td> <td>36.2</td> </tr> <tr> <td>BFCL Live Multiple</td> <td>0-shot</td> <td>25.7</td> </tr> <tr> <td>BFCL Live Parallel</td> <td>0-shot</td> <td>22.9</td> </tr> <tr> <td>BFCL Live Parallel Multiple</td> <td>0-shot</td> <td>20.8</td> </tr> <tr> <td>BFCL Relevance</td> <td>0-shot</td> <td>61.1</td> </tr> <tr> <td>BFCL Irrelevance</td> <td>0-shot</td> <td>73.7</td> </tr> </tbody> </table>

### Training Dataset

These models were trained on a dataset of text data that includes a wide variety of sources. The model was trained with 6T tokens. The knowledge cutoff date for the training data was August 2024. There are the key components:

- Public Tool Definitions - Common APIs found on the web - Tool Use Interactions - These are a mix of prompts, function calls, function responses, and natural language responses from the model to summarise the function call response, or request clarifications when the prompt is ambiguous or incomplete.

### Data Preprocessing

Here are the key data cleaning and filtering methods applied to the training data:

- CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering was applied at multiple stages in the data preparation process to ensure the exclusion of harmful and illegal content. - Sensitive Data Filtering: As part of making Gemma pre-trained models safe and reliable, automated techniques were used to filter out certain personal information and other sensitive data from training sets. - Additional methods: Filtering based on content quality and safety in line with Google's [policies](https://ai.google/static/documents/ai-responsibility-update-published-february-2025.pdf).

Specifications & capabilities

Published model ID
functiongemma

Deployments & artifacts

1–4 / 4

ollama

source id
ollama
execution mode
local
parameter size
268.10M
parameter count
268100000
parameter count is approximate
true
quantization level
Q8_0
context window
32000
context window is approximate
true
artifact size bytes
300806689
updated at
2026-11-16T08:10:06.079865+00:00

ollama

source id
ollama
execution mode
local
parameter size
268.10M
parameter count
268100000
parameter count is approximate
true
quantization level
F16
context window
32000
context window is approximate
true
artifact size bytes
552096225
updated at
2026-11-16T08:10:06.079865+00:00

ollama

source id
ollama
execution mode
local
parameter size
268.10M
parameter count
268100000
parameter count is approximate
true
quantization level
Q8_0
context window
32000
context window is approximate
true
artifact size bytes
300806689
updated at
2026-11-16T08:10:06.079865+00:00

ollama

source id
ollama
execution mode
local
parameter size
268.10M
parameter count
268100000
parameter count is approximate
true
quantization level
Q8_0
context window
32000
context window is approximate
true
artifact size bytes
300806689
updated at
2026-11-16T08:10:06.079865+00:00

Original sources

1–2 / 2

Ollama · Model page ↗

Ollama · Catalog ↗

Source links

1–1 / 1

Explore more models

Models

Loading
EVIDENCE / COMPARISON

Benchmarks

Explore every benchmark

Loading

These charts contain model-linked results. The charts above also include unlinked source profiles. Compare scores within each evaluation. Model quality, usage, transparency and system performance measure different things.

Install TensorTrace