Intent API is a specialized tool for managing network devices, serving as an abstraction layer for Custom GPTs. It leverages both Netmiko for SSH control and NetBox for network data management, facilitating vendor-agnostic, intent-based networking operations.
This tool is not intended for use in production environments, as it achieves a best-case correctness of 90.2 %, which is not sufficient for production use. We do not take responsibility for any damage resulting from the use of this tool. Please use the tool exclusively in testing and development environments.
- Command Execution: Send commands to network devices, ensuring compatibility and verification through subsequent
show
commands. - NetBox Integration: Interact with NetBox to retrieve, create, update, and delete network-related data.
- Authentication: Basic HTTP authentication for accessing the API endpoints.
- Evaluation protocol: The full evaluation protocol can be found here.
- Examples: Example interactions with the Custom GPT are available here.
Before running Intent API, ensure you have the following prerequisites installed and set up:
- Python 3.12
- uvicorn
- ngrok
- Docker and Containerlab (for infrastructure setup)
-
Clone the repository:
git clone https://github.com/Stinktopf/Intent-API.git cd Intent-API
-
Install dependencies:
pip install -r requirements.txt
-
Use Containerlab to deploy the network infrastructure:
sudo containerlab deploy
-
SSH into the deployed devices to configure them:
ssh <user>@<device_ip>
The .env
file is essential for configuring the environment variables that Intent API requires to operate. A template for this file is provided as .env.template
. To create your own .env
file:
-
Copy the template:
cp .env.template .env
-
Open the
.env
file and fill in the necessary values.
The GPT.md serves as a blueprint for replicating the functionality of our Custom GPT. It contains all the necessary parameters and settings to ensure that your Custom GPT behaves as intended when interacting with network devices and managing data through the Intent API.
The router_config.yaml
file is crucial for managing device-specific credentials. By default, it contains credentials that apply to all devices of a certain type. However, you can override these credentials for specific devices by specifying the hostname and providing the necessary credentials.
Example router_config.yaml
configuration:
default:
nokia_srl:
username: "admin"
password: "NokiaSrl1!"
overwrite:
router1.example.com:
username: "special_user1"
password: "special_password1"
default
: Specifies the default username and password for all devices of the typenokia_srl
.overwrite
: Allows you to specify credentials for individual devices, identified by their hostname (e.g.,router1.example.com
). These credentials will take precedence over the default credentials.
Ensure that you update the router_config.yaml
file with the correct access credentials for your network devices before running the API.
-
Start the API server:
uvicorn main:app --port 8080
-
Access the API documentation at
https://<ngrok_domain>/docs
.