daraj-270m — DarajPay Tool-Calling Model
- Model name:
daraj-270m - Organization: darajcc
- Developed by: Daraj Compute and Cognition (daraj.cc)
- Model type: Causal language model specialized for intent-based function & tool calling
- License: apache-2.0
- Language: English
- Use case: Model Context Protocol (MCP) tool orchestration for the DarajPay payment and ticketing platform
Model Description
daraj-270m is a compact 270M-parameter conversational agent purpose-built to operate the DarajPay platform's MCP tools. It handles regional payment workflows, catalog searches, and booking operations across transportation and ticketing services (e.g., buses, flights, events, and appointments).
Instead of generating raw unstructured text, the model emits precise structured JSON containing a reasoning step (thought), an executable tool invocation (tool_call), and a natural language acknowledgment (text_response).
Output Format Example
{
"thought": "The user wants to search public catalog offerings for transport.",
"tool_call": {
"name": "darajpay_search_offerings",
"arguments": {
"q": "bus Jijiga Addis",
"limit": 5
}
},
"text_response": "Let me look up available bus offerings for that route."
}
Quickstart / Code Usage
You can load and run inference on daraj-270m using the following Python snippet to safely parse and execute tool calls:
from transformers import AutoTokenizer, AutoModelForCausalLM
import json
model_id = "darajcc/daraj-270m"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
messages = [
{"role": "user", "content": "Find me buses from Jijiga to Addis."}
]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=256, do_sample=False)
raw = tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)
print("Raw Model Output:", raw)
# Always validate before executing
try:
payload = json.loads(raw)
if "tool_call" in payload and payload["tool_call"].get("name"):
print("Successfully parsed tool call:", payload["tool_call"]["name"])
else:
print("Response received text_response only:", payload.get("text_response"))
except json.JSONDecodeError:
print("Failed to decode model output as strict JSON.")