File size: 12,261 Bytes
0e2d4c3
 
 
 
 
 
 
 
29d4879
 
 
 
 
0e2d4c3
 
 
29d4879
38792d5
29d4879
38792d5
29d4879
0e2d4c3
29d4879
 
 
 
0e2d4c3
29d4879
 
 
 
 
 
 
 
 
 
 
 
 
 
0e2d4c3
 
 
 
 
 
29d4879
38792d5
29d4879
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0e2d4c3
29d4879
 
0e2d4c3
29d4879
 
 
 
0e2d4c3
29d4879
 
 
 
 
 
 
3580d38
38792d5
29d4879
 
 
 
 
 
 
0e2d4c3
 
 
 
 
29d4879
0e2d4c3
 
 
 
 
 
 
 
29d4879
 
 
 
 
 
 
 
 
 
 
0e2d4c3
 
 
29d4879
 
 
 
 
0e2d4c3
29d4879
 
 
 
 
0e2d4c3
 
 
29d4879
 
0e2d4c3
 
29d4879
 
 
 
 
 
 
 
 
0e2d4c3
 
 
 
 
29d4879
 
 
 
 
 
 
 
 
 
 
0e2d4c3
 
 
 
29d4879
 
 
 
 
 
 
 
 
 
 
0e2d4c3
 
 
 
 
29d4879
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0e2d4c3
 
 
 
 
 
 
29d4879
 
 
 
 
 
 
 
 
 
0e2d4c3
 
 
 
 
29d4879
 
 
 
 
0e2d4c3
 
 
 
29d4879
 
 
0e2d4c3
 
29d4879
 
 
 
 
 
 
 
 
 
 
 
0e2d4c3
 
 
 
 
29d4879
 
 
 
 
 
0e2d4c3
 
 
 
 
 
 
 
 
 
 
29d4879
 
 
 
 
 
 
 
 
0e2d4c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29d4879
 
 
 
 
 
 
 
 
0e2d4c3
 
 
29d4879
 
 
 
0e2d4c3
29d4879
 
 
 
0e2d4c3
 
 
 
 
 
 
 
 
 
 
 
 
29d4879
 
 
0e2d4c3
29d4879
0e2d4c3
 
 
 
 
29d4879
 
 
 
0e2d4c3
 
 
 
 
 
 
29d4879
 
 
 
 
 
0e2d4c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29d4879
0e2d4c3
 
 
29d4879
 
0e2d4c3
 
 
29d4879
 
 
0e2d4c3
 
29d4879
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
---
base_model: llama32-3b
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:llama32-3b
- lora
- transformers
- network-automation
- cisco
license: llama3.2
language:
- es
---

# Model Card for Model ID
All translatios were done in  DeepL.com (free version)

EN: 

This model is an LLM specialized in Cisco network configuration, fine-tuned with 4-bit LoRA on a LLaMA 3.2 3B base, focused on:

- Interface configuration
- VLAN configuration
- DHCP configuration
- Technical responses for OSPF, NAT, ACL, DNS, BGP (text mode)

In addition, it was designed to integrate with agents that use network automation tools. Developed as a project for the Recent Topics in Networking course at the University of Cauca, it was trained with an artificially generated dataset.
The model was trained on a dataset of 10,000 examples, with 10,000 examples of training data and 10,000 examples of test data. 

ES:

Este modelo es un LLM especializado en configuración de redes Cisco, ajustado mediante fine-tuning con LoRA a 4 bits sobre una base LLaMA 3.2 3B, enfocado en:

- Configuración de interfaces
- Configuración de VLAN
- Configuración de DHCP
- Respuestas técnicas para OSPF, NAT, ACL, DNS, BGP (modo textual)

Además, fue diseñado para integrarse con agentes que usen herramientas para automatización de red. Desarrollado como proyecto para la materia Recent Topics in netwroking
de la universidad del cauca, fue entrando con un dataset generado de manera artificial. 


## Model Details

### Model Description

EN:

This model was adjusted with a specialized dataset of real Cisco commands, with an instruction-input-output structure.  
It is optimized to run on low-power GPUs thanks to:

- 4-bit quantization
- LoRA adapters

**Key features:**

- Natural language understanding in Spanish
- Generation of real Cisco commands
- Compatible with multi-agent systems
- Able to detect when to use external tools

ES:
Este modelo fue ajustado con un dataset especializado en comandos reales de CiscO, con estructura instrucción–entrada–salida.  
Está optimizado para ejecutarse en GPUs de bajo consumo gracias a:

- Cuantización 4-bit
- Adaptadores LoRA

- Comprensión de lenguaje natural en español
- Generación de comandos Cisco reales
- Compatible con sistemas multi-agente
- Capaz de detectar cuándo usar herramientas externas

**Key features:**

- Comprensión de lenguaje natural en español
- Generación de comandos Cisco reales
- Compatible con sistemas multi-agente
- Capaz de detectar cuándo usar herramientas externas

**Creditos / Credits**

- **Developed by:** Juan Jose Angel Duran Calvache, Alison Daniela Ruiz Muñoz. -Universidad del Cauca
- **Funded by [optional]:** Juan Jose Angel Duran Calvache, Alison Daniela Ruiz Muñoz.
- **Shared by [optional]:** Juan Jose Angel Duran Calvache, Alison Daniela Ruiz Muñoz.
- **Model type:** Causal Language Model (Text Generation)
- **Language(s) (NLP):** Español
- **License:** LLaMA 3.2
- **Finetuned from model [optional]:** llama32-3b

### Model Sources [optional]

<!-- Provide the basic links for the model. -->

- **Repository:** https://github.com/3NombresJJA/Cisco-llm-agent
- **Paper [optional]:** [More Information Needed]
- **Demo [optional]:** [More Information Needed]

## Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

### Direct Use
EN:
- Direct generation of Cisco IOS configurations
- Support for networking students
- Simulation of router and switch configurations
- Technical conversational assistants

ES:
- Generación directa de configuraciones Cisco IOS
- Soporte a estudiantes de redes
- Simulación de configuraciones de routers y switches
- Asistentes conversacionales técnicos

### Downstream Use [optional]

EN:
- Integration with LangGraph + LangChain
- Automation of real configurations
- Virtual laboratory systems
- Educational platforms

ES:
- Integración con LangGraph + LangChain
- Automatización de configuraciones reales
- Sistemas de laboratorio virtual
- Plataformas educativas

### Out-of-Scope Use



<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->

EN:
- Not designed for offensive pentesting
- Not designed for production in real critical infrastructures
- Does not guarantee security validation

ES:
- No diseñado para pentesting ofensivo
- No diseñado para producción en infraestructuras críticas reales
- No garantiza validación de seguridad

## Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

EN:
- The model may invent IP addresses if they are not specified
- Does not validate real topologies
- May produce incomplete configurations if the prompt is ambiguous
- Was only trained on basic to intermediate configurations

ES:
- El modelo puede inventar direcciones IP si no se especifican
- No valida topologías reales
- Puede producir configuraciones incompletas si el prompt es ambiguo
- Solo fue entrenado en configuraciones básicas – intermedias
### Recommendations

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

EN:
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
- Use in educational or simulated environments
- Combine with verification agents

ES:
Los usuarios (tanto directos como secundarios) deben ser conscientes de los riesgos, sesgos y limitaciones del modelo.
- Siempre validar las configuraciones antes de aplicarlas a producción
- Usar en entornos educativos o simulados
- Combinar con agentes de verificación


## How to Get Started with the Model

Use the code below to get started with the model.

```bash
pip install transformers peft accelerate bitsandbytes torch

from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
from peft import PeftModel
import torch

base_model = "llama32-3b"
lora_repo = "Awakate/llama32-router-lora"

tokenizer = AutoTokenizer.from_pretrained(lora_repo)
model = AutoModelForCausalLM.from_pretrained(
    base_model,
    load_in_4bit=True,
    device_map="auto"
)

model = PeftModel.from_pretrained(model, lora_repo)

pipe = pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    max_new_tokens=200,
    temperature=0.1
)

prompt = "Configura la interfaz Gi0/0 con ip 192.168.1.1 máscara 255.255.255.0 y vlan 10"
print(pipe(prompt)[0]["generated_text"])


```


## Training Details

### Training Data

<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

The dataset used is posted in the github link, it was a personalized dastaset in format JSON with the following structure:

El dataset utilizado se encuentra publicado en el enlace de GitHub. Se trata de un dataset personalizado en formato JSON con la siguiente estructura:
{
  "instruction": "Configurar interfaz",
  "input": "Gi0/0 con IP 192.168.1.1",
  "output": "interface Gi0/0..."
}
Contain examples of:  Interfaces, VLAN, DHCP, OSPF, NAT, ACL and DNS
Contiene ejemplos de: Interfaces, VLAN, DHCP, OSPF, NAT, ACL y DNS

### Training Procedure

<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->

- Fine-tuning con LoRA (Low Rank Adaptation)
- Cuantización 4-bit
- Framework: transformers + peft


#### Preprocessing [optional]



There is no pre proccesing of the data.
No se hizo procesamiento de los datos.

#### Training Hyperparameters

- **Training regime:**
Epochs: 5
Batch size: 2
Gradient accumulation: 8
Learning rate: 8e-5
LoRA r: 16
LoRA alpha: 32
Precision: FP16
LoRA: Dropout: 0.05
Max length: 200

<!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->

#### Speeds, Sizes, Times [optional]

<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->

EN:
The finetune weights with Lora have a size of 18MB and were processed in an hour and a half of compilation in 115 checkpoints.

ES:
Los pesos del finetune con lora tienen un peso de 18MB, fue procesado en hora y media de compilación en 115 checkpoints.


## Evaluation

<!-- This section describes the evaluation protocols and provides the results. -->

### Testing Data, Factors & Metrics

#### Testing Data

<!-- This should link to a Dataset Card if possible. -->

EN:
-Human testing with real prompts
-Integration with LangGraph agents
-Manual validation of Cisco commands

ES:
-Pruebas humanas con prompts reales
-Integración con agentes LangGraph
-Validación manual de comandos Cisco

#### Factors

<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->

[More Information Needed]

#### Metrics

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

[More Information Needed]

### Results


![Screenshot 2025-12-04 145318](https://cdn-uploads.huggingface.co/production/uploads/6922899fcc2ce4db552cdafd/QmdvNwWzCS7PMjX6-nxqQ.png)


![Screenshot 2025-12-04 115148](https://cdn-uploads.huggingface.co/production/uploads/6922899fcc2ce4db552cdafd/FdROKu4Sg3gkp2qi3cbca.png)


![Screenshot 2025-12-04 145542](https://cdn-uploads.huggingface.co/production/uploads/6922899fcc2ce4db552cdafd/yysGWm2uYM5C6NRyQRuyD.png)


#### Summary

EN:
The agent works in a curious way. An example of agent integration can be found in the GitHub repository, where it was possible to verify through prompt engineering
the understanding of the knowledge model added by the fine-tune. However, it does not respond effectively 100% of the time, so the results must be taken with a grain of salt.
The agent works in a curious way. An example of agent integration can be found in the GitHub repository, where it was possible to verify through prompt engineering

ES:
El agente funciona de forma curiosa, se encuentra un ejemplo de integracion a agente en el repositorio de github, donde se pudo comprobar atravez de prompt engineering
el entendimiento del modelo del conocimiento agregado por el finetune, sin embargo no responde de forma efectiva el 100% de las veces por lo que se debe de tomar con detalle
los resultados.

## Model Examination [optional]

<!-- Relevant interpretability work for the model goes here -->

[More Information Needed]

## Environmental Impact

<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->

Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).

- **Hardware Type:** GPU RTX 4050 6GB laptop version
- **Hours used:** 4
- **Cloud Provider:** Local
- **Compute Region:** [More Information Needed]
- **Carbon Emitted:** Menos de 0.5

## Technical Specifications [optional]

### Model Architecture and Objective

-Base: LLaMA 3.2 – 3B parameters
-Adaptation: LoRA
-Precision: 4-bit
-Objective: Causal Language Modeling

### Compute Infrastructure

[More Information Needed]

#### Hardware

Linux in WSL

Intel i5 12500H
8GB RAM DDR4
RTX 4050 6GB laptop
SSD M.2

#### Software

[More Information Needed]

## Citation [optional]

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

**BibTeX:**

[More Information Needed]

**APA:**

[More Information Needed]

## Glossary [optional]

<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->

[More Information Needed]

## More Information [optional]

Proyecto Academico para RTN 2025-2

## Model Card Authors [optional]

Juan Jose Angel Duran Calvache
Alison Daniela Ruiz Muñoz

## Model Card Contact

joseduran@unicauca.edu.co
alisonruiz@unicauca.edu.co

### Framework versions

- PEFT 0.18.0