Awakate's picture
Update README.md
3580d38 verified
---
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