Instructions to use TNSA/Kavach-1-Mini-BF16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TNSA/Kavach-1-Mini-BF16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TNSA/Kavach-1-Mini-BF16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TNSA/Kavach-1-Mini-BF16") model = AutoModelForCausalLM.from_pretrained("TNSA/Kavach-1-Mini-BF16", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TNSA/Kavach-1-Mini-BF16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TNSA/Kavach-1-Mini-BF16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TNSA/Kavach-1-Mini-BF16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TNSA/Kavach-1-Mini-BF16
- SGLang
How to use TNSA/Kavach-1-Mini-BF16 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 "TNSA/Kavach-1-Mini-BF16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TNSA/Kavach-1-Mini-BF16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "TNSA/Kavach-1-Mini-BF16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TNSA/Kavach-1-Mini-BF16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TNSA/Kavach-1-Mini-BF16 with Docker Model Runner:
docker model run hf.co/TNSA/Kavach-1-Mini-BF16
Kavach-1-Mini-BF16
A compact, instruction-tuned language model specialized for offensive security and red-team reasoning, produced by full-parameter supervised fine-tuning (SFT) of Qwen3.5-0.8B. This is the BF16 build of the canonical Kavach-1-Mini SFT line.
Precision: bfloat16 (full-precision reference)
Overview
| Base model | Qwen/Qwen3.5-0.8B |
| Method | Full-parameter SFT |
| Parameters | ~0.8B |
| Precision / format | BF16 (16-bit) |
| Context length | 4,096 tokens |
| Specialization | Offensive security, red-team operations, security analysis |
| Language | English |
| License | MIT |
Available builds
The Kavach-1-Mini SFT line is published in multiple precision formats:
BF16 · FP8 · INT8 · INT4 · NVFP4 · MXFP4.
The -LoRA-* repositories contain the earlier LoRA-based line.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "TNSA/Kavach-1-Mini-BF16"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")
messages = [
{"role": "system", "content": "You are Kavach, an expert red-team security assistant."},
{"role": "user", "content": "Review this Flask login endpoint for security vulnerabilities."},
]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=1024, temperature=0.7, top_p=0.9)
print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))
Load with transformers (bfloat16).
Intended use
Authorized, lawful security work only: penetration testing and red-teaming (within scope), security research and education, blue-team enablement, and security operations. Small enough for local tooling and lab environments.
Limitations
- ~0.8B parameters: fast and lightweight, but less reliable than larger models — verify all commands, payloads, and claims.
- Can produce plausible-sounding but incorrect technical details; treat output as a starting point, not authoritative fact.
- 4,096-token context; English, text-only.
- Quantized builds (
FP8/INT8/INT4/NVFP4/MXFP4) trade some fidelity for size/speed;NVFP4/MXFP4are best on hardware/runtimes with native 4-bit-float support.
Responsible use & safety
Kavach-1-Mini is a dual-use tool for defenders, researchers, and authorized testers, and engages directly with offensive-security topics. Use it only on systems you own or are explicitly authorized to test, in compliance with all applicable laws and rules of engagement. Do not use it to attack systems without permission or for any unlawful purpose. You are solely responsible for your use of this model and its output.
License
Released under the MIT License (see LICENSE). The underlying base model (Qwen3.5-0.8B) is governed by its own license; review and comply with those terms when redistributing derived weights.
Acknowledgements
Built on Qwen3.5-0.8B. Fine-tuned with Hugging Face transformers + trl (Liger-accelerated); quantized with llm-compressor (compressed-tensors).
- Downloads last month
- 320