[HN Gopher] Gemma3 Function Calling
___________________________________________________________________
Gemma3 Function Calling
Author : canyon289
Score : 84 points
Date : 2025-03-23 07:31 UTC (3 days ago)
(HTM) web link (ai.google.dev)
(TXT) w3m dump (ai.google.dev)
| canyon289 wrote:
| Hey folks, I'm on the Gemma team, we released new model(s) just
| recently, and I saw many questions here about function calling.
| We just published the docs to detail this more. In short Gemma3's
| prompted instruction following is quite good for the larger
| models and that's how you use the feature.
|
| You don't need to take our word for it! We were waiting for an
| external and independent validation from the Berkeley team, and
| they just published their results. You can use their metrics to
| get a rough sense of performance, and of course try it out
| yourself in AIstudio or locally with your own prompts.
|
| https://gorilla.cs.berkeley.edu/leaderboard.html
|
| Hope you all enjoy the models!
| brianjking wrote:
| Thanks, Gemma is fantastic and that it supports function
| calling is great.
| attentive wrote:
| ToolACE-2-8B and watt-tool-8B have impressive score for the
| size in that leaderboard.
| chadash wrote:
| so if i'm reading this correctly, it's essentially prompt
| engineering here and there's no _guarantee_ for the output. Why
| not enforce a guaranteed output structure by restricting the
| allowed logits at each step (e.g. what outlines library does)?
| canyon289 wrote:
| So in short there's no guarantee for any output from any LLM
| whether its Gemma or any other (ignoring some details like
| setting a random seed or parameters like temperature to 0).
| Like you mentioned though libraries like outlines can
| constrain the output, whereas hosted models often already
| include this in their API, but they can do so because its a
| model + some server side code.
|
| With Gemma, or any open model, you can use the open libraries
| in conjunction to get what you want. Some inference
| frameworks like Ollama include structured output as part of
| their functionality.
|
| But you mentioned all of this already in your question so I
| feel like I'm missing something. Let me know!
|
| But I think you already mentioned all this in your response
| so I might be missing the question?
| simonw wrote:
| If you run Gemma via Ollama (as recommended in the Gemma
| docs) you get exactly that feature, because Ollama provides
| that for any model that they run for you:
| https://ollama.com/blog/structured-outputs
|
| Under the hood, it is using the llama.cpp grammars mechanism
| that restricts allowed logits at each step, similar to
| Outlines.
| zellyn wrote:
| Am I getting slightly different use-cases mixed up, or would it
| be better if everything just spoke MCP?
| PufPufPuf wrote:
| MCP is the wire protocol, it doesn't say anything about how the
| LLM output is structured and parsed.
| simonw wrote:
| You need function calling support in the models in order to
| layer MCP over the top of them.
| minimaxir wrote:
| The example of function calling/structured output here is the
| _cleanest_ example on how function it works behind the scenes,
| incorporating prompt engineering and JSON schema.
|
| With the advent of agents/MCP, the low level workflow has only
| become more confusing.
| behnamoh wrote:
| I'm glad this exists. It ruins the day for Trelis who took the
| open-source and free Llama and made it commercial by giving it
| function calling abilities: https://huggingface.co/Trelis/Meta-
| Llama-3-70B-Instruct-func...
| mentalgear wrote:
| Great, your work on open-source SLM are much appreciated ! (btw:
| seems like the google page does not respect the theme device
| "auto" setting)
___________________________________________________________________
(page generated 2025-03-26 23:00 UTC)