ResiNet-LLM-topology
This repository contains the implementation for the submission:
An LLM-Based Framework for Intent-Driven Network Topology Design (CNSM submission)
Purpose
ResiNet-LLM-topology provides the evaluation pipeline used in our work for comparing generated network topologies against reference designs.
It includes:
- node-edge level F1 evaluation
- resilience evaluation
- scenario data and reference topologies used for evaluation
Folder layout
requirements.txt
README.md
data/
ββ results/
ββ scenarios/
ββ topology_scenario_1.json
ββ topology_scenario_2.json
ββ topology_scenario_3.json
ββ topology_scenario_4.json
f1_nodes_functions.py
f1_nodes_main.py
f1_edges_functions.py
f1_edges_main.py
resinet_llm_prompt.py
evaluate_connectivity.py
draw_topology.py
models_configuration.py
resinet_llm_prompt.py
topology_generation.py
Installation
Install the dependencies with:
pip install -r requirements.txt
Quick start
Node F1 evaluation
python f1_nodes_main.py --gen <generated-json-or-folder> --ref <reference.json>
Edge F1 evaluation
python f1_edges_main.py --gen <generated-json-or-folder> --ref <reference.json>
Resilience evaluation
python evaluate_connectivity.py <tested-generated-folder>
Topologies generation
- Start Ollama server (after installation) :
ollama serve
- Pull a model you plan to use (models are defined in models_configuration.py)
ollama pull qwen3:32b
The code expects the Ollama HTTP API to be reachable at
http://localhost:11434(default).Notes for OpenAI / GPT users: When using OpenAI (GPT) backends, set the
OPENAI_API_KEYenvironment variable before running scripts.Commande:
python topology_generation.py --model_topo <model_key> --use_case 1 --type_ablation <type_ablation>
--model_topo: model key frommodels_configuration.py(e.g.qwen3:32b,mistral-small:24b, or GPT keys when using OpenAI).--use_case: integer selecting the user requirements prompt (see data/scenarios/scenarios.py).--type_ablation: ablation flag for experimental runs.
The scripts produce detailed evaluation logs and summary .txt outputs in the local results/ path next to the evaluated files.
File descriptions
f1_nodes_functions.pyβ helper functions for node normalization, mapping, and F1 calculation.f1_nodes_main.pyβ driver script for node-based evaluation and overall summary generation.f1_edges_functions.pyβ helper functions for edge cleanup, structural remapping, and edge F1 scoring.f1_edges_main.pyβ driver script for edge-based evaluation and final metrics.resinet_llm_prompt.pyβ prompt utilities for intent-driven topology generation.evaluate_connectivity.pyβ connectivity and resilience measurement helpers.draw_topology.pyβ graph drawing utilities.requirements.txtβ Python package dependencies.topology generation.pyβ intent-driven topology generation
Repository usage
This package is designed to let users:
- inspect the evaluation logic used in the paper,
- reproduce node and edge F1 scoring on generated topologies with LLMs using the previous prompts,
- compare generated outputs with reference topologies,
Notes for publication
- This repository is intended as a reproducibility artifact
- Updates and releases: The repository may be updated for bug fixes, documentation improvements, or additional examples.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support