Instructions to use aheshman/LFM3-Kali-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aheshman/LFM3-Kali-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aheshman/LFM3-Kali-1.7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aheshman/LFM3-Kali-1.7B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("aheshman/LFM3-Kali-1.7B", trust_remote_code=True, 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use aheshman/LFM3-Kali-1.7B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf aheshman/LFM3-Kali-1.7B:Q4_K_M # Run inference directly in the terminal: llama cli -hf aheshman/LFM3-Kali-1.7B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf aheshman/LFM3-Kali-1.7B:Q4_K_M # Run inference directly in the terminal: llama cli -hf aheshman/LFM3-Kali-1.7B:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf aheshman/LFM3-Kali-1.7B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf aheshman/LFM3-Kali-1.7B:Q4_K_M
Use Docker
docker model run hf.co/aheshman/LFM3-Kali-1.7B:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use aheshman/LFM3-Kali-1.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aheshman/LFM3-Kali-1.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aheshman/LFM3-Kali-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aheshman/LFM3-Kali-1.7B:Q4_K_M
- SGLang
How to use aheshman/LFM3-Kali-1.7B 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 "aheshman/LFM3-Kali-1.7B" \ --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": "aheshman/LFM3-Kali-1.7B", "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 "aheshman/LFM3-Kali-1.7B" \ --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": "aheshman/LFM3-Kali-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use aheshman/LFM3-Kali-1.7B with Ollama:
ollama run hf.co/aheshman/LFM3-Kali-1.7B:Q4_K_M
- Unsloth Desktop
- Pi
How to use aheshman/LFM3-Kali-1.7B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf aheshman/LFM3-Kali-1.7B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "aheshman/LFM3-Kali-1.7B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use aheshman/LFM3-Kali-1.7B with Docker Model Runner:
docker model run hf.co/aheshman/LFM3-Kali-1.7B:Q4_K_M
- Lemonade
How to use aheshman/LFM3-Kali-1.7B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull aheshman/LFM3-Kali-1.7B:Q4_K_M
Run and chat with the model
lemonade run user.LFM3-Kali-1.7B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use aheshman/LFM3-Kali-1.7B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf aheshman/LFM3-Kali-1.7B:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default aheshman/LFM3-Kali-1.7B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use aheshman/LFM3-Kali-1.7B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf aheshman/LFM3-Kali-1.7B:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "aheshman/LFM3-Kali-1.7B:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
LFM3-Kali-1.7B โ v0.1.0
Modรจle complet fusionnรฉ en FP16 aprรจs un fine-tuning QLoRA rรฉalisรฉ par Aheshman Itibar sur 5 948 exemples de commandes, d'appels d'outils et d'explications de cybersรฉcuritรฉ. Les quatre shards Safetensors incluent la base et les modifications apprises.
Base : OpenIntelligenceNet/LFM3-1.7B-Uncensored, rรฉvision immuable
8e7cf5cccd95afa9d34a3a66ebfb8fef1b55c204, dรฉrivรฉe de LiquidAI/LFM3-1.7B.
Les adaptateurs d'origine sont distribuรฉs sรฉparรฉment dans le dossier adapter/ ร la racine du dรฉpรดt.
La licence du modรจle d'origine, LFM Open License v1.0, reste applicable.
Usage prรฉvu
Le modรจle s'adresse aux professionnels de la cybersรฉcuritรฉ pour les laboratoires, les CTF et les audits de sรฉcuritรฉ autorisรฉs. Il peut assister la prรฉparation de commandes, l'analyse technique et le travail avec les outils disponibles dans l'environnement. Les commandes proposรฉes doivent รชtre vรฉrifiรฉes avant exรฉcution ; leur utilisation relรจve de la responsabilitรฉ de l'opรฉrateur.
Kali Linux et Windows / WSL
L'assistant peut รชtre utilisรฉ avec les outils installรฉs sous Kali Linux, ou sous Windows via WSL avec une distribution Linux et les outils nรฉcessaires. Le modรจle et le moteur d'infรฉrence produisent les rรฉponses ; l'exรฉcution dรฉpend de l'interface ou du harness qui les relie au systรจme. Les fonctions nรฉcessitant un accรจs direct au matรฉriel, notamment certains usages Wi-Fi, dรฉpendent des interfaces et des pilotes accessibles dans WSL.
Retours d'utilisation locale
Jโai effectuรฉ des tests de sรฉcuritรฉ et dโintrusion sur mon HP Gbook 15, รฉquipรฉ dโun processeur Xeon, de 4 Go de VRAM et de 32 Go de RAM. Sur les tรขches que je lui ai confiรฉes, le modรจle suit les รฉtapes et rรฉpond aux besoins de mon travail, mรชme si certains points restent ร amรฉliorer. Ces essais complรจtent mes comparaisons sur Colab. Je nโai pas encore publiรฉ les traces dรฉtaillรฉes, les paramรจtres du moteur dโinfรฉrence et les mesures de dรฉbit.
Pour mon flux de travail, une fenรชtre de contexte de 64K tokens (65 536) est suffisante. Ce rรฉglage concerne l'infรฉrence et la gestion du cache KV. Il ne garantit pas que 64K tokens remplis tiennent intรฉgralement dans 4 Go de VRAM : la mรฉmoire rรฉellement utilisรฉe dรฉpend du backend, de la quantification du cache, de l'offload vers la RAM et de la longueur occupรฉe. La configuration du modรจle autorise jusqu'ร 262 144 positions ; la limite de 1 536 tokens utilisรฉe pendant le fine-tuning n'est pas sa limite d'infรฉrence.
Donnรฉes et paramรจtres
| Source | Entraรฎnement |
|---|---|
| KaliBench | 3 329 |
| Cyber-SFT-Agent, premier appel uniquement | 1 583 |
| HackMentor, explications | 932 |
| Gabarits franรงais | 104 |
313 exemples de validation, 5 294 exemples sรฉparรฉs rรฉservรฉs ร l'รฉvaluation. QLoRA NF4, rang 16, alpha 32, dropout 0,05, une รฉpoque, accumulation 8, taux initial 1e-4, FP16, 16 105 472 paramรจtres entraรฎnables. 744 รฉtapes en 3 553,3157 s sur Tesla T4 ; 1 365 622 tokens d'entrรฉe, 283 503 tokens supervisรฉs.
รvaluation et limites observรฉes
La perte finale 0,008758 est calculรฉe sur les 64 premiers exemples de validation, un sous-ensemble non reprรฉsentatif. Elle ne prouve pas la qualitรฉ conversationnelle. Aucun score d'exรฉcution KaliBench global n'est annoncรฉ.
La premiรจre comparaison amรฉliore le scan Nmap TCP connect et le filtre DNS
tshark. D'autres tests produisent nmap -sV pour afficher la version du binaire,
des dรฉfinitions incorrectes des รฉtats de ports et des appels d'outils ร la place
d'explications. La version v0.1.0 reste ร รฉvaluer et amรฉliorer.
MSF est peu reprรฉsentรฉ : pas de parcours pratique de msfconsole/msfvenom. Le corpus n'enseigne pas de boucle complรจte d'exรฉcution et de retour d'outil. Les commandes des comparaisons qualitatives Colab n'ont pas รฉtรฉ exรฉcutรฉes ; mes essais locaux relรจvent dโun protocole distinct. Aucun corpus de refus n'a รฉtรฉ ajoutรฉ ; aucun comportement sans refus n'est garanti.
Charger le modรจle complet
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
model_path = "aheshman/LFM3-Kali-1.7B"
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_path,
trust_remote_code=True,
dtype=torch.float16,
device_map={"": 0},
quantization_config=BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
bnb_4bit_compute_dtype=torch.float16,
),
).eval()
messages = [{
"role": "user",
"content": "Avec tshark, lis capture.pcap et affiche les paquets DNS.",
}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")
with torch.inference_mode():
generated = model.generate(
**inputs, max_new_tokens=160, do_sample=False, use_cache=True,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(generated[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))
Environnement utilisรฉ : torch 2.11.0, transformers 5.20.2, peft 0.21.2, accelerate 1.15.0, bitsandbytes 0.50.2. Dรฉpรดt du code et des sources : https://github.com/codeur261/LFM3-Kali-1.7B
Sources : RISys-Lab/KaliBench (CC BY 4.0), hotdogs/cyber-sft-agent-qwen38 (Apache 2.0), tmylla/HackMentor (dรฉpรดt Apache 2.0). Les rรฉvisions, empreintes et filtres de sรฉlection sont publiรฉs avec le code et le manifeste.
Distribution Hugging Face
La racine de ce dรฉpรดt contient le modรจle complet fusionnรฉ FP16 et son tokenizer. Le sous-dossier adapter/ contient les adaptateurs LoRA du mรชme entraรฎnement.
Pour charger uniquement l'adaptateur sur la base originale ร sa rรฉvision fixรฉe :
adapted = PeftModel.from_pretrained(base, "aheshman/LFM3-Kali-1.7B", subfolder="adapter")
Code, donnรฉes, checkpoints et documentation : https://github.com/codeur261/LFM3-Kali-1.7B
Rรฉvision de la documentation : 08ebe298eca10abd0319c2932d4a3903e725bd24
Version Ollama disponible
Le modรจle fine-tunรฉ est aussi disponible en GGUF Q4_K_M, avec Modelfile, empreinte SHA-256 et rapport de test. Installation et chat local. Import et gรฉnรฉration vรฉrifiรฉs avec Ollama 0.40.14 ; contexte de test : 4096 tokens.
- Downloads last month
- 333
Model tree for aheshman/LFM3-Kali-1.7B
Base model
LiquidAI/LFM3-1.7B-Base