Kavach-1-Mini
A compact, instruction-tuned language model specialized for offensive security and red-team reasoning. Built by full fine-tuning of Qwen3.5-0.8B (Instruct), Kavach-1-Mini is designed to act as an expert assistant for authorized penetration testing, security research, and cybersecurity education — small enough to run on modest hardware, yet focused enough to reason in depth about real-world attack and defense.
Overview
| Base model | Qwen/Qwen3.5-0.8B (Instruct) |
| Parameters | ~0.8B |
| Training | Low Rank Adaption (LoRA) |
| Precision | Floating Point 8-Bit (FP8) |
| Context length | 4,096 tokens |
| Specialization | Offensive security, red-team operations, security analysis |
| Language | English |
| License | MIT |
Kavach-1-Mini keeps the general conversational ability of its instruction-tuned base while sharpening its focus on security-specific reasoning: it explains attack chains, reasons about vulnerabilities and controls, and produces concrete, technically grounded guidance.
Available precisions
Kavach-1-Mini is distributed in multiple precision formats so it can run efficiently across a range of hardware, from data-center GPUs to modest local machines. Lower-precision formats reduce memory footprint and increase throughput, with a gradual trade-off in numerical fidelity.
| Format | Bits | Notes |
|---|---|---|
| BF16 | 16 | Reference full-precision weights. Highest fidelity; best for accuracy-critical use and further fine-tuning. |
| FP8 | 8 | 8-bit floating point. Near-BF16 quality with roughly half the memory; ideal on FP8-capable GPUs (Hopper/Blackwell). |
| INT8 | 8 | 8-bit integer quantization. Broad hardware support and strong quality retention for general inference. |
| INT4 | 4 | 4-bit integer quantization. Smallest widely-supported format; runs on consumer GPUs and CPUs with minimal footprint. |
| NVFP4 | 4 | NVIDIA 4-bit floating point. Better accuracy than INT4 at the same size on Blackwell-class hardware. |
| MXFP4 | 4 | Microscaling 4-bit floating point (OCP MX). Block-scaled 4-bit for high throughput with improved stability over plain INT4. |
Choosing a format
- Maximum accuracy / fine-tuning: BF16
- Best quality-per-byte on modern GPUs: FP8 or NVFP4
- Widest compatibility: INT8 (8-bit) or INT4 (4-bit)
- Smallest footprint / edge & local use: INT4, NVFP4, or MXFP4
The 4-bit float formats (NVFP4, MXFP4) generally preserve quality better than integer INT4 at the same size, but require compatible hardware/runtime support. When in doubt, start with BF16 or FP8 to validate behavior, then move to a 4-bit format for deployment.
Intended use
Kavach-1-Mini is intended for authorized, lawful security work, including:
- Penetration testing & red-teaming — planning engagements, reasoning through attack paths, and drafting proof-of-concept commands and payloads within an authorized scope.
- Security research & education — understanding vulnerability classes, exploitation techniques, and defensive controls; a study aid for certifications and CTFs.
- Blue-team enablement — thinking like an attacker to anticipate techniques, harden systems, and improve detection.
- Security operations — triage reasoning, threat-model discussion, and control-mapping against common frameworks.
It is small enough to embed in local tooling, lab environments, and CI-style security workflows where a large model would be impractical.
Capabilities
- Detailed, step-by-step technical reasoning about offensive and defensive security scenarios.
- Command-, payload-, and code-level suggestions for authorized testing.
- Discussion of vulnerabilities, misconfigurations, trust boundaries, and control bypasses.
- Mapping of scenarios to widely used security frameworks and standards.
- Fast, low-cost inference suitable for single-GPU or even CPU-constrained setups.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "TNSA/Kavach-1-Mini-FP8"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are Kavach, an expert red-team security assistant."},
{"role": "user", "content": "Walk me through enumerating an internal Docker Swarm overlay network during an authorized assessment."},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
inputs,
max_new_tokens=1024,
temperature=0.7,
top_p=0.9,
)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
Recommended generation settings
| Parameter | Value |
|---|---|
temperature |
0.6 – 0.8 |
top_p |
0.9 |
max_new_tokens |
512 – 2048 |
| chat template | use the built-in template via apply_chat_template |
Prompting
The model responds best to a clear system prompt that frames it as a security expert, followed by a specific task. Providing the target environment, the authorized objective, and any constraints yields the most useful, grounded responses.
Limitations
- Size. At ~0.8B parameters, the model is fast and lightweight but has less breadth and reliability than larger models. Verify commands, payloads, and claims before use.
- Possible inaccuracies. It can produce plausible-sounding but incorrect or outdated technical details ("hallucinations"). Treat output as a starting point, not authoritative fact.
- Context window. Limited to 4,096 tokens; very long engagements or documents must be chunked.
- Scope. Focused on English-language, text-based security reasoning. It is not a scanner, exploit framework, or automated agent.
Responsible use & safety
Kavach-1-Mini is a dual-use tool built for defenders, researchers, and authorized testers. By design it engages directly with offensive security topics and does not refuse legitimate security questions.
Use it only:
- On systems you own or have explicit written authorization to test.
- In compliance with all applicable laws, regulations, and rules of engagement.
- With appropriate safeguards (isolated labs, scoped engagements, responsible disclosure).
Do not use it to attack systems without permission, to cause harm, or for any unlawful purpose. You are solely responsible for how you use this model and its output. The authors and distributors accept no liability for misuse.
Acknowledgements
Built on Qwen3.5-0.8B by the TNSA Team Fine-tuned with Hugging Face transformers and trl, accelerated with Liger kernels for efficient large-vocabulary training.
License
Released under the MIT License — see LICENSE. Note that the underlying base model (Qwen3.5-0.8B) is governed by its own license; review and comply with the base model's terms as well when redistributing derived weights.
- Downloads last month
- 33
