Kali-Terminus-v2 is a fine-tuned
LFM2.5-350M model specialized for Kali Linux terminal command execution. It converts natural language instructions into precise shell commands with native LFM2.5
<|tool_call_start|>/
<|tool_call_end|> JSON tool calls.
Evaluated across 5 scenarios (26 turns) covering network recon, system enumeration, web recon, DNS recon, and self-correction:
Fine-tuned on
iselabvn/Kali-terminal-executor-v2, a curated collection of 2,418 shell command execution pairs combining 1,380 source records with 1,000 synthetically augmented records (DeepSeek-V4-Flash).
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("iselabvn/Kali-Terminus-v2", trust_remote_code=True)
4tokenizer = AutoTokenizer.from_pretrained("iselabvn/Kali-Terminus-v2", trust_remote_code=True)
5
6messages = [
7 {"role": "user", "content": "Scan port 80 on 192.168.1.1"}
8]
9inputs = tokenizer.apply_chat_template(
10 messages,
11 tools=[{
12 "type": "function",
13 "function": {
14 "name": "exec",
15 "description": "Execute a shell command in the Kali terminal.",
16 "parameters": {
17 "type": "object",
18 "properties": {"command": {"type": "string"}},
19 "required": ["command"]
20 }
21 }
22 }],
23 add_generation_prompt=True,
24 return_tensors="pt"
25)
26outputs = model.generate(**inputs, max_new_tokens=256)
27response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=False)
28print(response)
29# Expected: <|tool_call_start|>{"name": "exec", "arguments": {"command": "nmap -p 80 192.168.1.1"}}<|tool_call_end|>
1@misc{kali-terminus-v2,
2 author = {ISeLab},
3 title = {Kali-Terminus-v2: Fine-tuned LFM2.5-350M for Kali Linux Terminal Execution},
4 year = {2026},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/iselabvn/Kali-Terminus-v2}
7}