Instructions to use Keanualfahd/Kanata-S2-8B-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Keanualfahd/Kanata-S2-8B-LoRA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Keanualfahd/Kanata-S2-8B-LoRA")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Keanualfahd/Kanata-S2-8B-LoRA", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Keanualfahd/Kanata-S2-8B-LoRA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Keanualfahd/Kanata-S2-8B-LoRA" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Keanualfahd/Kanata-S2-8B-LoRA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Keanualfahd/Kanata-S2-8B-LoRA
- SGLang
How to use Keanualfahd/Kanata-S2-8B-LoRA with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Keanualfahd/Kanata-S2-8B-LoRA" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Keanualfahd/Kanata-S2-8B-LoRA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Keanualfahd/Kanata-S2-8B-LoRA" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Keanualfahd/Kanata-S2-8B-LoRA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Keanualfahd/Kanata-S2-8B-LoRA with Docker Model Runner:
docker model run hf.co/Keanualfahd/Kanata-S2-8B-LoRA
Kanata S2-8B β Agentic & Coding Intelligence
Kanata S2-8B is K-Ai's second approach to the Kanata agentic model family. It specializes in tool calling, multi-step problem solving, and coding, in Indonesian, Japanese, and English.
"We Build Because We Believe We Can." β K-Ai (Kortex AI)
K-Ai's second approach to Agentic Kanata
| Kanata S1-3B (first approach) | Kanata S2-8B (second approach) | |
|---|---|---|
| Base | IBM Granite 4.1 3B Base | Qwen3-8B |
| Goal | First agentic experiment | Reliable multilingual agent + coding |
| Tool-call format | Custom experiment | Native Qwen3/Hermes <tool_call> format (unchanged chat template) |
| Data | ~2.5k samples, mostly synthetic | 2,400 train samples (curated within a compute budget), audited, deduplicated, leak-checked |
| Evaluation | Small preliminary check | Per-language, held-out + unseen-tool evaluation |
S1 showed that a small model with a narrow dataset struggles with format validity, especially in Japanese (0% in our preliminary check). S2 addresses this with a stronger base, native tool-call serialization, per-language data coverage, and an explicit dataset audit. S1 remains available as an experimental baseline: K-Ai-Official/Kanata-S1-3B.
Kanata S2 is not a general-purpose model. For general assistance see K-Oss-9-Mini. Both may share a Qwen3-8B foundation but have different data and objectives.
Model details
- Base model: Qwen/Qwen3-8B
- Why the post-trained checkpoint: we first tried Qwen3-8B-Base, but its chat and tool-call special tokens were untrained, so LoRA on attention/MLP could not make it emit tool calls reliably. Kanata S2 therefore starts from the post-trained Qwen3-8B (same license).
- Method: QLoRA (4-bit NF4), LoRA r=16, alpha=32, all attention + MLP projections; merged to 16-bit for this release
- Context during training: 1024 tokens (the base model supports longer context; long-context behavior was not tuned or evaluated here)
- Hardware: single NVIDIA T4 (16 GB), Google Colab
- Training time: 71.1 min, 150 optimizer steps, one pass over the curated subset
- Adapter only: Keanualfahd/Kanata-S2-8B-LoRA
How tool calling works
Kanata S2 only generates tool calls; your agent runtime must execute the tool and return the result in a tool message. The model never executes tools itself. It uses the standard Qwen3 chat template.
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "Keanualfahd/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]:]))
# -> <tool_call>\n{"name": "get_weather", "arguments": {"city": "Bandung"}}\n</tool_call>
Behaviors trained: tool selection among distractors, valid JSON arguments, asking for missing required arguments, answering directly when no tool is needed, interpreting tool results, and recovering from tool errors.
Training data
All sources were schema-validated; tool calls were parsed and re-serialized into canonical JSON; exact duplicates were removed; splits are assigned by hash of the first user prompt so that no prompt appears in more than one split (leakage check: 0 overlaps). Full per-source rejection statistics are in dataset_audit.json (generated by the training notebook).
| Source | Module | Lang | License (from Hub metadata) | Kept / raw |
|---|---|---|---|---|
NousResearch/hermes-function-calling-v1:func_calling_singleturn |
hermes | en | apache-2.0 | 1,100 / 1,893 |
NousResearch/hermes-function-calling-v1:func_calling |
hermes | en | apache-2.0 | 937 / 1,893 |
NousResearch/hermes-function-calling-v1:glaive_func_calling |
hermes | en | apache-2.0 | 5,024 / 5,209 |
NousResearch/hermes-function-calling-v1:json_mode_agentic |
hermes | en | apache-2.0 | 1,342 / 1,342 |
m-a-p/CodeFeedback-Filtered-Instruction |
codefeedback | en | apache-2.0 | 12,000 / 156,526 |
ise-uiuc/Magicoder-OSS-Instruct-75K |
magicoder | en | mit | 8,000 / 75,197 |
kunishou/databricks-dolly-15k-ja |
ja_general | ja | cc-by-sa-3.0 | 6,000 / 15,015 |
FreedomIntelligence/alpaca-gpt4-indonesian |
id_general | id | see card | 6,000 / 49,969 |
| synthetic (K-Ai) | agentic tool calling, clarification, no-tool, error recovery | id/ja/en | K-Ai | see notebook |
Candidate pool was quality-scored per module, then a token-budgeted subset was selected (agentic and multilingual modules prioritized): 2,400 training samples, evaluated on held-out val/test splits. Training samples by language: {'en': 1272, 'ja': 564, 'id': 564}. Per-module token counts are in dataset_audit.json.
Note: the synthetic module is template-based and was capped; its tool schemas differ from the unseen-tool benchmark below. Dataset licenses differ (including share-alike sources); verify them before commercial redistribution of data derived from this model's training set.
Benchmarks
All numbers below come from eval_results.json produced by the training notebook. These are small, in-house evaluations, not standard public leaderboards. Treat them as smoke-level evidence, not a full capability measurement.
Tool calling β format valid / correct tool name / required arguments complete.
| Language | S1-3B (preliminary, n=4/lang) | S2 base, before fine-tuning (held-out) | S2-8B after fine-tuning (held-out) | S2-8B unseen tools |
|---|---|---|---|---|
| Indonesian | 25% / 25% / 25% | 100% / 100% / 100% | 100% / 100% / 100% (n=12) | 100% / 100% / 100% (n=3) |
| Japanese | 0% / 0% / 0% | 100% / 100% / 100% | 100% / 100% / 100% (n=12) | 100% / 100% / 100% (n=3) |
| English | 25% / 25% / 25% | 100% / 100% / 100% | 100% / 100% / 100% (n=12) | 100% / 100% / 100% (n=3) |
Held-out = test prompts never seen in training (hash-split), same tool schema family. Unseen tools = convert_currency, get_stock_price, never used in training. "S2 base, before fine-tuning" is the same checkpoint evaluated on the identical cases before training, so before/after is a controlled comparison. S1 numbers are not from an identical test set.
Coding (mini, executed unit tests): 6/6 before β 6/6 after fine-tuning (passed; Python, 6 problems; includes one debugging task).
Not yet evaluated: HumanEval/MBPP-style public benchmarks, BFCL, long-context tasks, multi-turn agent loops with a real runtime.
Limitations
- Evaluations are small; confidence intervals are wide.
- Japanese and Indonesian agentic data is largely synthetic/template-based, so behavior on unusual phrasing may be weaker than in English.
- Trained at 1024-token sequences; very long tool outputs may degrade quality.
- May produce invalid or wrong arguments; always validate tool calls and sandbox execution (never run model-written code or commands unreviewed with real credentials).
- Not safety-tuned beyond the base model.
License
Released under Apache-2.0, following the license reported for the base model (see base model card). Training data licenses vary (see table).
Citation
@misc{kanata_s2_8b_2026,
title = {Kanata S2-8B: Agentic & Coding Intelligence},
author = {K-Ai (Kortex AI)},
year = {2026},
url = {https://huggingface.co/Keanualfahd/Kanata-S2-8B}
}