- Description
- Features
- Requirements
- Lab Environment
- Example
- How it Works
- Installation
- Usage
- Contributing
- License
GPT-NetEng is an AI-powered Network Engineer that can troubleshoot and configure live network devices on its own, with or without human guidance along the way.
- Real-time AI-driven troubleshooting and configuration of actual network devices
- Intelligent analysis and decision-making based on output data (show commands, etc.) from devices
- Support for various network devices and technologies
- Python 3.9+
- Anthropic API key
- SSH access to network devices
I highly recommend using ContainerLab for setting up local lab environments.
In my testing I used cEOS.
First tell GPT-NetEng what devices it's working with. You can provide an image or a description. In this example I provided the following:
There are 4 devices:
- lab1
- lab2
- lab3
- lab4
Use LLDP to figure out how they are connected
Then I gave it the following task:
This is a new lab environment of EOS devices.
It is a lab so use whatever numbering schemas (IP, ASNs, etc) you desire.
Since this is a lab you may make changes to all devices at once at each step if you want.
Configure all the connected links on our devices as point to point layer 3 links (e.g., /30s between each device).
Configure BGP on all devices and advertise the loopback interfaces into BGP.
You can configure these steps in whatever order you think is most efficient.
When you finish configuration, verify connectivity by running a ping from lab1 to lab3 loopback ip. If you can ping, you are done. If you can't ping, troubleshoot and fix the issue.
It took a total of 151 seconds for it to configure and verify everything without any human intervention.
You can see how it worked through the task here.
- gpt-neteng analyzes the topology and the task description.
- It decides on an approach, and iteratively provides the commands it wants to run.
- At each step, the plan is presented to the user for confirmation (or optionally, without confirmation).
- gpt-neteng executes the necessary commands on the specified network devices using Netmiko.
- The output of the commands is captured and analyzed for further action.
- gpt-neteng iteratively refines the plan based on the command outputs and user feedback.
- Once the task is completed successfully, a summary of the actions taken is provided.
-
Clone the repository:
git clone https://github.com/jonhammer/gpt-neteng.git
-
Change to the project directory:
cd gpt-neteng
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install the package:
pip install .
-
Create a
.env
file in the project root and add your Anthropic API key:ANTHROPIC_API_KEY=your_api_key_here
To run the gpt-neteng CLI, use the following command:
gpt-neteng [options]
If no arguments are provided, the CLI will prompt you interactively for the required information.
--topology
: Path to the topology file (txt or image)--task
: Path to the task description file--username
: Username for device connection--password
: Password for device connection--device-type
: Device type (default: arista_eos)--loglevel
: Logging level (default: WARNING)--logfile
: Path to the log file (leave blank to log to console)--auto-run
: Run commands without confirmation
gpt-neteng --topology example-lab.jpg --task example-task.txt --username admin --password admin
Not currently recommended, web app coming soon.
To run gpt-neteng using Docker Compose:
-
Build the Docker image:
docker compose build
-
Start the container:
docker compose run app
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.