Kanata S2-8B: agentic model for function and code calling
2 min readupdated
Built on Qwen3-8B-Base and fine-tuned using QLoRA (an efficient fine-tuning method) for tasks at the intersection of coding and external tool calling in English, Japanese, and Indonesian. Unlike the first version built on a weaker base, the new release uses the native Qwen3 chat template and features a training dataset audited for leaks. It is useful for developers building language agents or integrating LLMs with external APIs.
Key features
- Specialization in code generation and tool calling
- Support for three languages: English, Japanese, and Indonesian
- Built on the powerful open-source Qwen3-8B-Base model
- Trained on a carefully filtered dataset of 2400 examples
What you can do
- Integrate the model into an agentic pipeline for working with external tools and APIs
- Build a multilingual assistant to help with coding
- Set up automatic function selection and JSON argument validation in chatbots
Example
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "K-Ai-Official/Kanata-S2-8B"
tok = AutoTokenizer.from_pretrained(repo); model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="auto", device_map="auto")
tools = [{"type":"function","function":{"name":"get_weather","description":"Get weather","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]
msgs = [{"role":"user","content":"Cuaca di Bandung sekarang gimana?"}]
ids = tok.apply_chat_template(msgs, tools=tools, add_generation_prompt=True, enable_thinking=False, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=128)[0][ids.shape[1]:]))Read more
DetailsMetrics: solved 6/6 test coding tasks (including debugging)
Training: QLoRA (4-bit NF4, r=16, alpha=32) on a single NVIDIA T4 GPU (16 GB) in 57 minutes
Limitations: Japanese and Indonesian data are largely synthetic, long contexts (over 1024 tokens) have not been tested










Comments