WireGuard Agent — Qwen2.5-3B ONNX int4 (CPU)

Modèle Qwen2.5-3B-Instruct fine-tuné (LoRA) sur le domaine VPN WireGuard, mergé et quantifié en ONNX int4 pour inférence CPU sans GPU.

Fait partie du projet cyber-agent-engine — architecture multi-agents cybersécurité avec protocole CAP v1.

Performances

Métrique Valeur
Score validation 11/11 (100%)
Fonctions couvertes 11
Format ONNX int4 (onnxruntime-genai)
Base model Qwen/Qwen2.5-3B-Instruct
Latence CPU (8 vCPU) ~8–12s/requête

Usage

import onnxruntime_genai as og
import json

model = og.Model("patlegu/wireguard-qwen25-onnx-int4")
tokenizer = og.Tokenizer(model)
tokenizer_stream = tokenizer.create_stream()

cap = {
  "directive": "add_wireguard_client",
  "entities": {"HOSTNAME": ["laptop-pat"], "IP_ADDRESS": ["10.10.0.5"]},
  "context": {"source": "coordinator"}
}

prompt = (
    "<|im_start|>system\n"
    "Tu es un agent WIREGUARD. Tu reçois des directives structurées du coordinateur "
    "sous forme de paquets JSON (format CAP v1) et tu génères des appels d'API précis "
    "sous forme de tool_calls. Tu ne réponds jamais en langage naturel.\n"
    "<|im_end|>\n"
    "<|im_start|>user\n"
    + json.dumps(cap) +
    "\n<|im_end|>\n"
    "<|im_start|>assistant\n"
)

import numpy as np
input_ids = np.array(tokenizer.encode(prompt), dtype=np.int32)

params = og.GeneratorParams(model)
params.set_search_options(max_length=len(input_ids) + 256, temperature=0.1, do_sample=False)

generator = og.Generator(model, params)
generator.append_tokens(input_ids)

output_tokens = []
while not generator.is_done():
    generator.generate_next_token()
    token = generator.get_next_tokens()[0]
    output_tokens.append(token)

print(tokenizer.decode(output_tokens))
# → [{"type": "function", "function": {"name": "...", "arguments": "..."}}]

Installation

pip install onnxruntime-genai numpy

Format d'entrée (CAP v1)

Agent WireGuard capable de traduire des directives structurées (protocole CAP v1) en appels API WireGuard précis. Couvre 11 fonctions : tunnels site-à-site, point-à-point, mesh, gestion des peers, rotation de clés.

L'agent reçoit un paquet JSON structuré :

{
  "directive": "add_wireguard_client",
  "entities": {"HOSTNAME": ["laptop-pat"], "IP_ADDRESS": ["10.10.0.5"]},
  "context": {"source": "coordinator"}
}

Et produit un tool_call JSON :

[{"type": "function", "function": {"name": "directive_name", "arguments": "{}"}}]

Projet

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for patlegu/wireguard-qwen25-onnx-int4

Base model

Qwen/Qwen2.5-3B
Quantized
(204)
this model