--- 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] - **Repository:** https://github.com/3NombresJJA/Cisco-llm-agent - **Paper [optional]:** [More Information Needed] - **Demo [optional]:** [More Information Needed] ## Uses ### 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 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 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 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 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 - 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 #### Speeds, Sizes, Times [optional] 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 ### Testing Data, Factors & Metrics #### Testing Data 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 [More Information Needed] #### Metrics [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] [More Information Needed] ## Environmental Impact 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] **BibTeX:** [More Information Needed] **APA:** [More Information Needed] ## Glossary [optional] [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