Granite ToolCall Distilled ~20M

A tiny 256-dim, 8-layer GPT-2 style model (~20M parameters) trained to call tools via distillation from Granite 4.0 350M.

Capabilities

  • Weather lookup (get_current_weather)
  • Calculator (calculator)
  • Timezone time (get_current_time)
  • Stock price (get_stock_price)

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("mohar07/granite-toolcall-20m")
tokenizer = AutoTokenizer.from_pretrained("mohar07/granite-toolcall-20m")

messages = [{"role": "user", "content": "What's the weather in Paris?"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, tools=TOOLS, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(out[0], skip_special_tokens=True))
Downloads last month
-
Safetensors
Model size
31.5M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support