Kanata-S1-3B: A compact coding and agentic LLM based on Granite 4.1
2 min read
The K-Ai (Kortex AI) team has released a compact 3.4-billion-parameter language model fine-tuned for coding and AI agent tasks. Built on top of ibm-granite/granite-4.1-3b-base, it was fine-tuned using SFT (supervised fine-tuning on examples) with QLoRA (quantized adapter for memory efficiency during training). Unlike the base version, the model has been trained to call external tools, build step-by-step plans, and work across three languages: English, Japanese, and Indonesian. It is ideal for developers looking for a lightweight local model to experiment with agentic pipelines and code generation.
Key features
- Programming and debugging: Focuses on Python, JavaScript, and TypeScript, with a portion of its training tasks verified through unit tests directly during dataset generation.
- Agentic scenarios: Trained on synthetic dialogues featuring real Python code execution, including bug fixing, refactoring, repository exploration, and transparent reporting when tool calls fail.
- Tool calling: Uses the Granite chat format with role tags and executes function calls in the Hermes style via the
construct. - Open license: Distributed under the Apache-2.0 license, though the authors recommend independently reviewing the licenses of the underlying datasets before commercial use.
What you can do
- Integrate it into a local AI agent or Python script to automate refactoring, bug hunting, and test execution via an external runtime environment.
- Use it as a lightweight coding assistant to generate Python, JS, and TS functions in English, Japanese, or Indonesian.
- Use it as a base model for further fine-tuning on custom agent tasks using the
transformerslibrary.
Example
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("Keanualfahd/Kanata-S1-3B")
model = AutoModelForCausalLM.from_pretrained("K-Ai-Official/Kanata-S1-3B", torch_dtype="auto", device_map="auto")
prompt = "<|start_of_role|>user<|end_of_role|>Write a Python function to reverse a string<|end_of_text|>\n<|start_of_role|>assistant<|end_of_role|>"
ids = tok(prompt, return_tensors='pt', add_special_tokens=False).to(model.device)
out = model.generate(**ids, max_new_tokens=300, eos_token_id=tok.convert_tokens_to_ids("<|end_of_text|>"))
Read more
DetailsInternal mini code test: 5 out of 6 passed Python tasks (EN/ID/JA).
Tool calling test on a small sample (n=4 per language): 25% valid calls in EN and ID, 0% in JA—the model is experimental and may occasionally fail on tool formatting.
Training: QLoRA 4-bit NF4 (rank 32), context length 1280, 2476 examples, 45.9 minutes on an NVIDIA T4.
Indonesian is not officially supported by the base Granite model and has not undergone deep testing.










Comments