Skip to content

Explore Gemma 4 tool use / function calling capabilities #35

@nmrenyi

Description

@nmrenyi

Background

Gemma 4 supports tool use (function calling). Now that MAM-AI has migrated to Gemma 4 E4B (issue #28), this capability is available on-device and worth exploring.

Potential Use Cases

In a clinical decision support context, tool use could enable:

  • Structured triage output — model fills a defined schema (e.g. severity level, recommended action, escalation flag) rather than free text
  • Medication lookup — model calls a local drug formulary function instead of generating dosing from memory, reducing hallucination risk
  • Referral decision logic — model invokes a rule-based escalation checker grounded in MOHSW protocols

To Investigate

  • What tool use interface does LiteRT-LM / Gemma 4 E4B expose on Android?
  • Is function calling supported in the current litertlm-android SDK version (0.10.0)?
  • What is the prompt format for tool use in Gemma 4 instruction-tuned models?
  • How does tool use interact with streaming generation in RagPipeline.kt?
  • Are there latency/memory implications of enabling tool use on-device?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions