Instructions to use e12ex2/Qwen3-1.7B-SigmaRL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use e12ex2/Qwen3-1.7B-SigmaRL with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("e12ex2/Qwen3-1.7B-SigmaRL") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use e12ex2/Qwen3-1.7B-SigmaRL with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "e12ex2/Qwen3-1.7B-SigmaRL"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "e12ex2/Qwen3-1.7B-SigmaRL" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use e12ex2/Qwen3-1.7B-SigmaRL with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "e12ex2/Qwen3-1.7B-SigmaRL"
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 e12ex2/Qwen3-1.7B-SigmaRL
Run Hermes
hermes
- OpenClaw new
How to use e12ex2/Qwen3-1.7B-SigmaRL with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "e12ex2/Qwen3-1.7B-SigmaRL"
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 "e12ex2/Qwen3-1.7B-SigmaRL" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use e12ex2/Qwen3-1.7B-SigmaRL with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "e12ex2/Qwen3-1.7B-SigmaRL"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "e12ex2/Qwen3-1.7B-SigmaRL" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "e12ex2/Qwen3-1.7B-SigmaRL", "messages": [ {"role": "user", "content": "Hello"} ] }'
Qwen3-1.7B-SigmaRL (v0.1 · prototype)
Threat description → Sigma detection rule. A small, defensive detection-engineering model: a LoRA fine-tune of Qwen3-1.7B that writes valid, backend-compilable Sigma rules from natural-language threat descriptions.
Defensive use only. This model generates blue-team detection rules. It is not designed or intended for offensive security.
Results (held-out, n=24)
Same 24 held-out prompts, scored by a graded verifiable reward: parse YAML → valid Sigma schema (pySigma) → compiles to a Splunk query (pySigma-backend-splunk).
| metric | base Qwen3-1.7B | this model (SFT) |
|---|---|---|
| valid + compilable rule rate | 0.0% | 45.8% |
| mean reward (0–0.6) | 0.10 | 0.36 |
| tier breakdown (0.0 / 0.2 / 0.6) | 12 / 12 / 0 | 3 / 10 / 11 |
The base model never once produced a valid, compilable rule; after fine-tuning, nearly half of outputs are valid and Splunk-compilable.
How it was made
- Base:
Qwen/Qwen3-1.7B(Apache-2.0) - Data: 3,116
(description → rule)pairs derived from SigmaHQ (MIT) - Method: LoRA SFT via MLX-LM — 8 layers, 600 iters, batch 1, seq 512, trained locally on an Apple M4 (peak 4.8 GB)
- Eval/reward: graded verifiable reward using pySigma + the Splunk backend as the correctness oracle
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "e12ex2/Qwen3-1.7B-SigmaRL" # <-- set to your repo
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
SYSTEM = ("You are a detection engineer. Given a threat description, output a single "
"valid Sigma detection rule in YAML. Output only the YAML, no prose, no code fences.")
messages = [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": "Write a Sigma rule that detects: powershell launched with a base64 -enc command"},
]
text = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
out = model.generate(**tok(text, return_tensors="pt"), max_new_tokens=512)
print(tok.decode(out[0], skip_special_tokens=True))
Limitations
- Prototype. ~54% of outputs are still not fully valid Sigma (often valid YAML with an incorrect schema).
- Trained with 512-token truncation, so long rules were cut — a v0.2 with longer context is planned.
- Validity is measured by backend compilation, not by running the rules against real logs. True-positive / false-positive evaluation against labeled telemetry is future work.
- Single-turn. Generated rules should be reviewed by a detection engineer before deployment.
Reward function & training code
The graded verifiable reward, data pipeline, and training scripts are open. Rules are scored, not hand-labeled — the same reward drives both eval and (planned) reinforcement learning.
- Downloads last month
- 630
Quantized