Kritha FunctionGemma 270M Finetuned

Fine-tuned checkpoint and quantized on-device bundle of google/functiongemma-270m-it built as the local action router for Kritha, an open-source cross-platform on-device AI assistant (mobile, desktop, and edge runtimes).

Model Overview

  • Base Model: google/functiongemma-270m-it (270M parameters)
  • Architecture: Gemma 3 text decoder with FunctionGemma tool-calling chat template
  • Task: Low-latency single-turn tool selection and structured argument extraction across 80 system, application, device, and assistant tools, plus negative no-tool rejection
  • Training Dataset: kaushalkrishnax/kritha-functiongemma-80tools-dataset (1,416 rows with Top-8 candidate tool retrieval per query)
  • Validation Tool Selection Accuracy: ~96.0% after 8 epochs of supervised fine-tuning

Repository Contents

  • model.litertlm: Quantized INT8 (dynamic_wi8_afp32) LiteRT-LM bundle (277.92 MB, prefill lengths 256 and 1024, KV cache 2048) for LiteRT-LM runtimes across mobile and desktop platforms
  • release_manifest.json: Artifact metadata, file sizes, and SHA-256 checksums for Kritha on-device model downloads
  • model.safetensors, config.json, generation_config.json: Full fine-tuned PyTorch / Safetensors weights
  • tokenizer.model, tokenizer.json, tokenizer_config.json, special_tokens_map.json, added_tokens.json, chat_template.jinja: FunctionGemma tokenizer and tool-calling prompt template

Prompt Format & Usage

At runtime, Kritha retrieves the Top-8 candidate tools for a user query and formats the conversation using chat_template.jinja:

from transformers import AutoTokenizer, AutoModelForCausalLM

model_id = "kaushalkrishnax/kritha-functiongemma-270m-finetuned"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")

messages = [
    {"role": "developer", "content": "You are a model that can do function calling with the following functions"},
    {"role": "user", "content": "Turn on the flashlight"}
]

prompt = tokenizer.apply_chat_template(
    messages,
    tools=candidate_tools,
    add_generation_prompt=True,
    tokenize=False
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=96, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))

Expected output format:

<start_function_call>call:toggle_flashlight{state:<escape>on<escape>}<end_function_call>

On-Device LiteRT-LM Deployment

  1. Fetch release_manifest.json from this repository to verify the root model.litertlm SHA-256 digest (8fab50fcd7c14ba490023070aa9c751136763b7db11e12819b0bac4d2ecd1c8d).
  2. Keep the developer prompt, Top-8 tool schemas, and user query within 1,024 tokens to match the precompiled prefill signature.
  3. Parse call:<tool_name>{...} blocks from the model output and dispatch to the corresponding local tool handler, falling back to the primary assistant LLM when no tool call is emitted.

License

This model is derived from google/functiongemma-270m-it and is governed by the Gemma Terms of Use.

Downloads last month
-
Safetensors
Model size
0.3B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for kaushalkrishnax/kritha-functiongemma-270m-finetuned

Finetuned
(486)
this model

Dataset used to train kaushalkrishnax/kritha-functiongemma-270m-finetuned