johnbridges commited on
Commit
34063f1
·
1 Parent(s): 9761102
Dockerfile ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Debian 12 (Bookworm) base image
2
+ FROM debian:12
3
+
4
+ # Set environment variables to avoid interactive prompts during package installation
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Install system-level dependencies as root
8
+ RUN apt-get update && \
9
+ apt-get install -y \
10
+ build-essential \
11
+ curl \
12
+ git \
13
+ cmake \
14
+ clang \
15
+ pkg-config \
16
+ ccache \
17
+ wget \
18
+ vim \
19
+ expect
20
+
21
+ # Create a non-root user and set up their environment
22
+ RUN useradd -m user && \
23
+ mkdir -p /home/user/code && \
24
+ chown -R user:user /home/user
25
+
26
+ # Switch to the non-root user
27
+ USER user
28
+ WORKDIR /home/user
29
+
30
+ RUN mkdir -p /home/user/code/models && \
31
+ mkdir -p /home/user/code/app/wwwroot && \
32
+ cd /home/user/code/models && \
33
+ wget https://huggingface.co/Mungert/Phi-4-mini-instruct.gguf/resolve/main/phi-4-mini-q4_0.gguf
34
+
35
+
36
+ # Clone and build OpenBLAS as the non-root user
37
+ RUN git clone https://github.com/OpenMathLib/OpenBLAS.git /home/user/code/models/OpenBLAS && \
38
+ cd /home/user/code/models/OpenBLAS && \
39
+ make -j$(nproc)
40
+
41
+ # Switch to root for the OpenBLAS installation
42
+ USER root
43
+ RUN cd /home/user/code/models/OpenBLAS && \
44
+ make install && \
45
+ cp /opt/OpenBLAS/lib/libopenblas* /usr/local/lib/
46
+
47
+ # Switch back to the non-root user
48
+ USER user
49
+
50
+ # Clone and build llama.cpp with OpenBLAS support as the non-root user
51
+ RUN git clone https://github.com/ggerganov/llama.cpp /home/user/code/models/llama.cpp && \
52
+ cd /home/user/code/models/llama.cpp && \
53
+ export PKG_CONFIG_PATH=/opt/OpenBLAS/lib/pkgconfig:$PKG_CONFIG_PATHa && \
54
+ cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS=/home/user/code/models/OpenBLAS -DLLAMA_CURL=OFF && \
55
+ cmake --build build --config Release -j$(nproc) && \
56
+ cp /home/user/code/models/llama.cpp/build/bin/* /home/user/code/models/llama.cpp/
57
+
58
+
59
+
60
+ # Install .NET 9.0 as the non-root user
61
+ RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
62
+ chmod +x dotnet-install.sh && \
63
+ ./dotnet-install.sh --channel 9.0
64
+
65
+ # Set persistent environment variables
66
+ ENV DOTNET_ROOT=/home/user/.dotnet
67
+ ENV PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
68
+
69
+ # Verify .NET installation and current user
70
+ RUN whoami && dotnet --version
71
+
72
+ # Clone repositories using the GITHUB_TOKEN secret
73
+ RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
74
+ git clone https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLib.git /home/user/code/NetworkMonitorLib && \
75
+ git clone https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLLM.git /home/user/code/NetworkMonitorLLM && \
76
+ git clone https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorData.git /home/user/code/NetworkMonitorData
77
+
78
+
79
+ # Copy files into the container as the non-root user
80
+ COPY --chown=user:user system_prompt_phi_4_mini /home/user/code/models/system_prompt_phi_4_mini
81
+ COPY --chown=user:user system_prompt_phi_4_mini_run /home/user/code/models/system_prompt_phi_4_mini_run
82
+ COPY --chown=user:user appsettings.json /home/user/code/app/appsettings.json
83
+ COPY --chown=user:user index.html /home/user/code/app/wwwroot/index.html
84
+ COPY --chown=user:user append_run.sh /home/user/code/models/append_run.sh
85
+ COPY --chown=user:user expect-build-phi-4-mini /home/user/code/models/expect-build-phi-4-mini
86
+
87
+ # Set permissions for scripts as the non-root user
88
+ RUN chmod +x /home/user/code/models/append_run.sh && \
89
+ chmod +x /home/user/code/models/expect-build-phi-4-mini
90
+
91
+ # Set the working directory for the build-phi-4-mini script
92
+ WORKDIR /home/user/code/models
93
+
94
+ # Run the build-phi-4-mini script
95
+ RUN ./expect-build-phi-4-mini
96
+
97
+ # Expose port 7860 for Hugging Face Spaces
98
+ EXPOSE 7860
99
+ # Set the working directory
100
+ WORKDIR /home/user/code/NetworkMonitorLLM
101
+
102
+ # Build the .NET project as the non-root user
103
+ RUN dotnet restore && \
104
+ dotnet build -c Release
105
+
106
+ RUN cp -r /home/user/code/NetworkMonitorLLM/bin/Release/net9.0/* /home/user/code/app/ && \
107
+ rm -rf /home/user/code/NetworkMonitorLib /home/user/code/NetworkMonitorLLM /home/user/code/NetworkMonitorData
108
+
109
+ # Set the working directory to the `app` directory
110
+ WORKDIR /home/user/code/app
111
+
112
+ # Run the .NET app as the non-root user
113
+ CMD ["dotnet", "NetworkMonitorLLM.dll", "--urls", "http://0.0.0.0:7860"]
append_run.sh ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Check if the correct number of arguments is provided
4
+ if [ "$#" -ne 2 ]; then
5
+ echo "Usage: $0 <file_name> <string_to_append>"
6
+ exit 1
7
+ fi
8
+
9
+ # Assign arguments to variables
10
+ file_name="$1"
11
+ text_to_append="$2"
12
+ new_file_name="${file_name}_run"
13
+
14
+ # Check if the file exists
15
+ if [ ! -f "$file_name" ]; then
16
+ echo "Error: File '$file_name' does not exist."
17
+ exit 1
18
+ fi
19
+
20
+ # Create the new file with the appended text and an additional blank line
21
+ {
22
+ cat "$file_name"
23
+ echo "$text_to_append"
24
+ echo ""
25
+ } > "$new_file_name"
26
+
27
+ echo "New file created: '$new_file_name'"
28
+
appsettings.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "Logging": {
3
+ "LogLevel": {
4
+ "Default": "Information",
5
+ "Microsoft": "Warning",
6
+ "Microsoft.Hosting.Lifetime": "Information"
7
+ }
8
+ },
9
+ "OpenAIApiKey" :".env",
10
+ "EmailEncryptKey": ".env",
11
+ "LocalSystemUrl": {
12
+ "ExternalUrl": "https://huggingface.co/spaces/johnbridges/NetMonitorDev",
13
+ "IPAddress": "",
14
+ "RabbitHostName": "devrabbitmq.readyforquantum.com",
15
+ "RabbitPort": 63785,
16
+ "RabbitInstanceName" : "HugDev-LLMService",
17
+ "RabbitUserName" : "usercommonxf1",
18
+ "RabbitVHost" : "/vhostuser",
19
+ "UseTls" : true
20
+ },
21
+ "ServiceID" : "monitor",
22
+ "StartThisTestLLM" : true,
23
+ "LlmNoInitMessage" : false,
24
+ "ServiceAuthKey" : ".env" ,
25
+ "LlmModelPath" : "/home/user/code/models/",
26
+ "LlmModelFileName" : "phi-4-mini-q4_0.gguf",
27
+ "LlmContextFileName" : "context-phi-4-mini.gguf",
28
+ "LlmSystemPrompt" : "system_prompt_phi_4_mini_run",
29
+ "LlmPromptMode" : " -if -sp -no-cnv --simple-io ",
30
+ "LlmVersion" : "phi_4_mini",
31
+ "LlmCtxSize" : 12000,
32
+ "LlmOpenAICtxSize" : 32000,
33
+ "LlmCtxRatio" : 6,
34
+ "LlmTemp" : "0.3",
35
+ "LlmThreads" : 2,
36
+ "LlmSystemPromptTimeout" : 90,
37
+ "LlmUserPromptTimeout" : 1200,
38
+ "LlmSessionIdleTimeout" : 1440,
39
+ "LlmGptModel" : "gpt-4.1-mini",
40
+ "LlmHFModelID" : "meta-llama/llama-3.3-70b-instruct",
41
+ "LlmHFKey" : ".env",
42
+ "LlmHFUrl" : "https://api.novita.ai/v3/openai/chat/completions",
43
+ "LlmHFModelVersion" : "llama_3.2",
44
+ "LlmUseHF" : true,
45
+ "AudioServiceUrl" : "https://transcribe.readyforquantum.com",
46
+ "AudioServiceOutputDir" : "/home/audioservice/code/securefiles/dev/output_audio",
47
+ "IsStream" : false,
48
+ "UseFixedPort" : true,
49
+ "HFToken" : ".env",
50
+ "RedisUrl" :"redis.readyforquantum.com:46379",
51
+ "RedisSecret" : ".env",
52
+ "MaxRetries" : -1,
53
+ "RabbitPassword" : ".env",
54
+ "LlmNoThink" : true,
55
+ "RabbitRoutingKey": "execute.local",
56
+ "RabbitExhangeType": "direct"
57
+ }
58
+
build-docker-command ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ DOCKER_BUILDKIT=1 docker build --secret id=GITHUB_TOKEN,env=GITHUB_TOKEN -t netmonllm .
2
+
build-phi-4-mini ADDED
@@ -0,0 +1 @@
 
 
1
+ ~/code/models/llama.cpp/llama-cli -c 12000 -m ~/code/models/phi-4-mini-q4_k_l.gguf --prompt-cache context-phi-4-mini.gguf -f system_prompt_phi_4_mini -r "<|end|>" -no-cnv -sp -i --temp 0 --simple-io
expect-build-phi-4-mini ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/expect
2
+ # Set the timeout to 300 seconds (5 minutes)
3
+ set timeout 600
4
+ # Start the llama-cli command with absolute paths
5
+ spawn /home/user/code/models/llama.cpp/llama-cli -c 12000 -m /home/user/code/models/phi-4-mini-q4_0.gguf --prompt-cache /home/user/code/models/context-phi-4-mini.gguf -f /home/user/code/models/system_prompt_phi_4_mini -r "<|end|>" -no-cnv -sp -i --temp 0 --simple-io
6
+
7
+ # Wait for the expected output
8
+ expect {
9
+ "</tool_call><|end|>" {
10
+ # Send Ctrl+C to terminate the command
11
+ send \x03
12
+ exp_continue
13
+ }
14
+ eof {
15
+ # Exit when the command ends
16
+ exit 0
17
+ }
18
+ timeout {
19
+ # Exit if the command takes too long
20
+ send_user "Timeout occurred. Exiting...\n"
21
+ exit 1
22
+ }
23
+ }
index.html ADDED
@@ -0,0 +1,434 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <!DOCTYPE html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Quantum Network Monitor Assistant - Huggingface Space</title>
8
+ <!-- Material Icons -->
9
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/material-design-icons/4.0.0/font/MaterialIcons-Regular.css" rel="stylesheet">
10
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
11
+ <style>
12
+ :root {
13
+ --primary-color: #607466;
14
+ --secondary-color: #6239AB;
15
+ --error-color: #eb5160;
16
+ --warning-color: #d4a10d;
17
+ --background-color: #f8f9fa;
18
+ --text-color: #333;
19
+ --light-gray: #f1f5f9;
20
+ --border-color: #e2e8f0;
21
+ }
22
+
23
+ * {
24
+ margin: 0;
25
+ padding: 0;
26
+ box-sizing: border-box;
27
+ font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
28
+ }
29
+
30
+ body {
31
+ background-color: var(--background-color);
32
+ color: var(--text-color);
33
+ line-height: 1.6;
34
+ }
35
+
36
+ header {
37
+ background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
38
+ color: white;
39
+ padding: 1.5rem;
40
+ text-align: center;
41
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
42
+ }
43
+
44
+ .logo-container {
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ margin-bottom: 1rem;
49
+ }
50
+
51
+ .logo {
52
+ width: 50px;
53
+ height: 50px;
54
+ margin-right: 1rem;
55
+ }
56
+
57
+ .header-title {
58
+ font-size: 1.8rem;
59
+ font-weight: 600;
60
+ }
61
+
62
+ .subtitle {
63
+ font-size: 1.1rem;
64
+ opacity: 0.9;
65
+ margin-top: 0.5rem;
66
+ }
67
+
68
+ .container {
69
+ max-width: 1200px;
70
+ margin: 0 auto;
71
+ padding: 2rem;
72
+ }
73
+
74
+ .card {
75
+ background-color: white;
76
+ border-radius: 8px;
77
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
78
+ padding: 2rem;
79
+ margin-bottom: 2rem;
80
+ }
81
+
82
+ h2 {
83
+ color: var(--primary-color);
84
+ margin-bottom: 1rem;
85
+ font-size: 1.5rem;
86
+ display: flex;
87
+ align-items: center;
88
+ }
89
+
90
+ h2 .material-icons {
91
+ margin-right: 0.5rem;
92
+ color: var(--primary-color);
93
+ }
94
+
95
+ h3 {
96
+ color: var(--secondary-color);
97
+ margin: 1.5rem 0 0.75rem;
98
+ font-size: 1.2rem;
99
+ display: flex;
100
+ align-items: center;
101
+ }
102
+
103
+ h3 .material-icons {
104
+ margin-right: 0.5rem;
105
+ font-size: 1.2rem;
106
+ }
107
+
108
+ p {
109
+ margin-bottom: 1rem;
110
+ }
111
+
112
+ .feature-grid {
113
+ display: grid;
114
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
115
+ gap: 1.5rem;
116
+ margin-top: 1.5rem;
117
+ }
118
+
119
+ .feature-card {
120
+ background-color: var(--light-gray);
121
+ border-radius: 8px;
122
+ padding: 1.5rem;
123
+ border-left: 4px solid var(--primary-color);
124
+ }
125
+
126
+ .feature-icon {
127
+ background-color: var(--primary-color);
128
+ color: white;
129
+ width: 40px;
130
+ height: 40px;
131
+ border-radius: 8px;
132
+ display: flex;
133
+ align-items: center;
134
+ justify-content: center;
135
+ margin-bottom: 1rem;
136
+ }
137
+
138
+ .feature-icon .material-icons {
139
+ font-size: 24px;
140
+ }
141
+
142
+ .api-example {
143
+ background-color: #2d2d2d;
144
+ color: white;
145
+ border-radius: 8px;
146
+ padding: 1.5rem;
147
+ overflow-x: auto;
148
+ font-family: 'Courier New', monospace;
149
+ line-height: 1.4;
150
+ }
151
+
152
+ .button {
153
+ display: inline-flex;
154
+ align-items: center;
155
+ background-color: var(--primary-color);
156
+ color: white;
157
+ padding: 0.75rem 1.5rem;
158
+ border-radius: 4px;
159
+ text-decoration: none;
160
+ font-weight: 500;
161
+ margin-top: 1rem;
162
+ transition: background-color 0.2s;
163
+ }
164
+
165
+ .button .material-icons {
166
+ margin-right: 0.5rem;
167
+ font-size: 18px;
168
+ }
169
+
170
+ .button:hover {
171
+ background-color: var(--secondary-color);
172
+ }
173
+
174
+ .tech-stack {
175
+ display: flex;
176
+ flex-wrap: wrap;
177
+ gap: 1rem;
178
+ margin-top: 1rem;
179
+ }
180
+
181
+ .tech-badge {
182
+ background-color: var(--light-gray);
183
+ border: 1px solid var(--border-color);
184
+ padding: 0.5rem 1rem;
185
+ border-radius: 20px;
186
+ font-size: 0.9rem;
187
+ display: flex;
188
+ align-items: center;
189
+ }
190
+
191
+ .tech-badge .material-icons {
192
+ font-size: 16px;
193
+ margin-right: 0.5rem;
194
+ }
195
+
196
+ footer {
197
+ background-color: var(--primary-color);
198
+ color: white;
199
+ text-align: center;
200
+ padding: 1.5rem;
201
+ margin-top: 2rem;
202
+ }
203
+
204
+ .footer-links {
205
+ display: flex;
206
+ justify-content: center;
207
+ gap: 1.5rem;
208
+ margin-top: 1rem;
209
+ }
210
+
211
+ .footer-links a {
212
+ color: white;
213
+ text-decoration: none;
214
+ opacity: 0.8;
215
+ display: flex;
216
+ align-items: center;
217
+ }
218
+
219
+ .footer-links a .material-icons {
220
+ margin-right: 0.5rem;
221
+ font-size: 16px;
222
+ }
223
+
224
+ .footer-links a:hover {
225
+ opacity: 1;
226
+ }
227
+
228
+ .progress-container {
229
+ background-color: var(--light-gray);
230
+ padding: 1rem;
231
+ border-radius: 8px;
232
+ margin-top: 1rem;
233
+ }
234
+
235
+ .progress-item {
236
+ margin-bottom: 1rem;
237
+ }
238
+
239
+ .progress-item:last-child {
240
+ margin-bottom: 0;
241
+ }
242
+
243
+ .progress-header {
244
+ display: flex;
245
+ justify-content: space-between;
246
+ margin-bottom: 0.5rem;
247
+ }
248
+
249
+ .progress-bar {
250
+ width: 100%;
251
+ height: 8px;
252
+ background-color: #e2e8f0;
253
+ border-radius: 4px;
254
+ overflow: hidden;
255
+ }
256
+
257
+ .progress-fill {
258
+ height: 100%;
259
+ background-color: var(--primary-color);
260
+ }
261
+
262
+ @media (max-width: 768px) {
263
+ .container {
264
+ padding: 1rem;
265
+ }
266
+ .feature-grid {
267
+ grid-template-columns: 1fr;
268
+ }
269
+ .footer-links {
270
+ flex-direction: column;
271
+ gap: 0.75rem;
272
+ }
273
+ }
274
+ </style>
275
+ </head>
276
+ <body>
277
+ <header>
278
+ <div class="logo-container">
279
+ <img src="https://freenetworkmonitor.click/img/logo.svg" class="logo" width="50" height="50" alt="Quantum Network Monitor Logo" target="_blank">
280
+ <h1 class="header-title">Quantum Network Monitor Assistant</h1>
281
+ </div>
282
+ <p class="subtitle">Huggingface Space | LLM Backend for Network Monitoring Intelligence</p>
283
+ </header>
284
+
285
+ <div class="container">
286
+ <div class="card">
287
+ <h2><i class="material-icons">info</i> About This Space</h2>
288
+ <p>This Huggingface Space powers the AI assistant behind <a href="https://freenetworkmonitor.click/" style="color: var(--secondary-color);" target="_blank">Quantum Network Monitor</a> - your intelligent companion for network management and troubleshooting.</p>
289
+
290
+ <p>Our LLM backend provides real-time, context-aware responses to network management queries, helping IT professionals and network engineers maintain optimal network performance with minimal effort.</p>
291
+
292
+ <div class="tech-stack">
293
+ <div class="tech-badge">
294
+ <i class="material-icons">hub</i>
295
+ Huggingface
296
+ </div>
297
+ <div class="tech-badge">
298
+ <i class="material-icons">memory</i>
299
+ Llama.cpp
300
+ </div>
301
+ <div class="tech-badge">
302
+ <i class="material-icons">bolt</i>
303
+ Security Experts
304
+ </div>
305
+ <div class="tech-badge">
306
+ <i class="material-icons">api</i>
307
+ RappidApi
308
+ </div>
309
+ </div>
310
+ </div>
311
+
312
+ <div class="card">
313
+ <h2><i class="material-icons">settings</i> How It Works</h2>
314
+ <p>The Quantum Network Monitor Assistant leverages advanced language models to provide intelligent responses to network management queries. The assistant helps with:</p>
315
+
316
+ <div class="feature-grid">
317
+ <div class="feature-card">
318
+ <div class="feature-icon">
319
+ <i class="material-icons">bar_chart</i>
320
+ </div>
321
+ <h3>Data Interpretation</h3>
322
+ <p>Makes sense of complex network metrics and alerts, providing human-readable insights.</p>
323
+ </div>
324
+ <div class="feature-card">
325
+ <div class="feature-icon">
326
+ <i class="material-icons">bug_report</i>
327
+ </div>
328
+ <h3>Troubleshooting</h3>
329
+ <p>Suggests potential root causes and solutions for network issues.</p>
330
+ </div>
331
+ <div class="feature-card">
332
+ <div class="feature-icon">
333
+ <i class="material-icons">build</i>
334
+ </div>
335
+ <h3>Configuration</h3>
336
+ <p>Assists with device and protocol configuration recommendations.</p>
337
+ </div>
338
+ <div class="feature-card">
339
+ <div class="feature-icon">
340
+ <i class="material-icons">notifications</i>
341
+ </div>
342
+ <h3>Alert Management</h3>
343
+ <p>Helps prioritize and manage network alerts based on severity and impact.</p>
344
+ </div>
345
+ </div>
346
+ </div>
347
+
348
+ <div class="card">
349
+ <h2><i class="material-icons">integration_instructions</i> API Integration</h2>
350
+ <p>This Huggingface Space exposes a REST API that the Quantum Network Monitor platform uses to process queries. You can also integrate this assistant's capabilities into your own tools:</p>
351
+
352
+ <div class="api-example">
353
+ <span style="color: #bb86fc;">POST</span> <span style="color: #03dac6;">/api/query</span>
354
+ <span style="color: #f1fa8c;">{
355
+ "query": "scan my mail server for vulnerabilities mail.mahadeva.co.uk"
356
+ }</span>
357
+ </div>
358
+
359
+ <h3><i class="material-icons">reply</i> Response Format</h3>
360
+ <div class="api-example">
361
+ <span style="color: #f1fa8c;">{
362
+ "response": "The vulnerability scan on the mail server mail.mahadeva.co.uk has been completed. Here are the key findings:\n\nNmap Scan Summary\n\n Target: mail.mahadeva.co.uk (195.26.250.218)\n Host Status: Up (0.13s latency)\n Ports Tested: 1000+ including common mail and web ports\n\nOpen Ports:\n\n 25/tcp (SMTP)\n Not vulnerable to CVE-2010-4344\n 80/tcp (HTTP)\n Vulnerable: CVE-2011-3192 (Apache byte range filter DoS)\n Description: The Apache web server is vulnerable to a denial of service attack when numerous overlapping byte ranges are requested.\n References:\n Nessus Plugin\n CVE Details\n SecurityFocus\n 143/tcp (IMAP)\n 443/tcp (HTTPS)\n Errors reported during script execution, indicating some checks could not be completed.\n 587/tcp (Submission)\n Not vulnerable to CVE-2010-4344\n 993/tcp (IMAPS)\n\nRecommendations:\n\n Address Denial of Service Vulnerability:\n Update the Apache server to a patched version to mitigate the CVE-2011-3192 vulnerability.\n\n Perform Further Testing:\n Investigate the errors during script execution for the HTTPS port to ensure no other vulnerabilities remain undiscovered.\n\n Regular Maintenance:\n Keep all services updated and conduct regular scans to identify and fix vulnerabilities as they are discovered.\n\nIf you have any more requests or need further assistance, feel free to ask!",
363
+ "suggested_actions": [
364
+ "Update the Apache server to a patched version",
365
+ "Investigate errors during script execution for HTTPS port",
366
+ "Conduct regular vulnerability scans"
367
+ ]
368
+ }</span>
369
+ </div>
370
+
371
+
372
+ <div class="card">
373
+ <h2><i class="material-icons">chat</i> Click Assistant Icon to Get Started</h2>
374
+ <p>To test the assistant directly or to see it in action:</p>
375
+
376
+ <ol style="margin-left: 2rem; margin-bottom: 1.5rem;">
377
+ <li>Visit <a href="https://freenetworkmonitor.click/" style="color: var(--secondary-color);" target="_blank">Quantum Network Monitor</a></li>
378
+ <li>Create a free account to access the full features of the Free Monitor Network Assistant (optional)</li>
379
+ <li>Click the Assistant icon bottom right of page</li>
380
+ <li>Try asking questions about your networks performance, scanning for security issues, or troubleshooting steps</li>
381
+ <li>Visit the Dashboard to view visual data for your monitored hosts <a href="https://freenetworkmonitor.click/dashboard" style="color: var(--secondary-color);" target="_blank">Quantum Network Monitor Dashboard</a> . Watch the Assistant take control of the websites data views.
382
+ </ol>
383
+
384
+ <p>For developers looking to integrate with this space:</p>
385
+
386
+ <div class="feature-grid">
387
+ <div class="feature-card">
388
+ <h3><i class="material-icons">code</i> REST API</h3>
389
+ <p>Use our REST API for seamless integration with your existing tools.</p>
390
+ <a href="https://rapidapi.com/Mungert69/api/free-network-monitor/playground/" class="button" style="font-size: 0.9rem; padding: 0.5rem 1rem;" target="_blank">
391
+ <i class="material-icons">description</i>
392
+ API Playground
393
+ </a>
394
+ </div>
395
+ <div class="feature-card">
396
+ <h3><i class="material-icons">integration_instructions</i> Local Network Agents</h3>
397
+ <p>Download the Quantum Network Monitor Agent to manage your local networks..</p>
398
+ <a href="https://freenetworkmonitor.click/download" class="button" style="font-size: 0.9rem; padding: 0.5rem 1rem;" target="_blank">
399
+ <i class="material-icons">book</i>
400
+ Local Agent Download
401
+ </a>
402
+ </div>
403
+ <div class="feature-card">
404
+ <h3><i class="material-icons">psychology</i> Custom Training</h3>
405
+ <p>Need a specialized version? Contact us about custom network solutions.</p>
406
+ <a href="https://freenetworkmonitor.click/faq#contact" class="button" style="font-size: 0.9rem; padding: 0.5rem 1rem;" target="_blank">
407
+ <i class="material-icons">info</i>
408
+ Learn More
409
+ </a>
410
+ </div>
411
+ </div>
412
+ </div>
413
+ </div>
414
+
415
+ <footer>
416
+ <p>© 2025 Quantum Network Monitor | Powered by Huggingface Spaces</p>
417
+ <div class="footer-links">
418
+ <a href="https://freenetworkmonitor.click/" target="_blank">
419
+ <i class="material-icons">home</i>
420
+ Main Site
421
+ </a>
422
+ <a href="https://github.com/Mungert69/FreeNetworkMonitor" target="_blank">
423
+ <i class="material-icons">code</i>
424
+ GitHub
425
+ </a>
426
+ <a href="https://freenetworkmonitor.click/faq#contact" target="_blank">
427
+ <i class="material-icons">email</i>
428
+ Contact
429
+ </a>
430
+ </div>
431
+ </footer>
432
+ </body>
433
+ </html>
434
+
system_prompt_phi_4_mini ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <|system|>You are a helpful assistant with some tools.<|tool|>
2
+ [
3
+ {"name":"add_host","description":"Add a new host to be monitored. This function allows you to specify the host address and various monitoring options. For example, to add a host with address 'example.com' and monitor it using the HTTP endpoint, you would specify {'address': 'example.com', 'endpoint': 'http'}. This will set up monitoring for the specified host using the selected endpoint type.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to echo all the values set. The default is false for a faster response."},"address":{"type":"string","description":"The host address to be monitored. This is a required field."},"endpoint":{"type":"string","description":"The endpoint type for monitoring. Optional field. Endpoint types include: 'quantum' (a quantum-safe encryption test), 'http' (website ping), 'https' (SSL certificate check), 'httphtml' (loads only the HTML of a website), 'icmp' (host ping), 'dns' (DNS lookup), 'smtp' (email server HELO message confirmation), 'rawconnect' (low-level raw socket connection)."},"port":{"type":"number","description":"The port of the service being monitored. Optional field. If not specified, it defaults to the standard port for the endpoint type. For example, the standard port for HTTPS is 443."},"timeout":{"type":"number","description":"The time to wait for a timeout in milliseconds. Optional field. The default is 59000 milliseconds."},"email":{"type":"string","description":"The user's email address. Do not use this field if the user is logged in; their login email will be used and this field will be ignored. If the user is not logged in, then ask for an email. Alerts are sent to the user's email."},"agent_location":{"type":"string","description":"The location of the agent monitoring this host. Optional field. If left blank, an agent location will be assigned automatically."}},"required":["address"]}},
4
+ {"name":"edit_host","description":"Edit an existing host's monitoring configuration. This function allows you to modify the monitoring settings of a host that has already been added. For example, to edit the host with address 'test.com' and change the endpoint to 'icmp', you would specify {'address':'test.com', 'endpoint':'icmp'}. You can update various parameters such as the endpoint type, port, timeout, and more.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to echo all the values set. The default is false."},"auth_key":{"type":"string","description":"An authentication key used to authorize the edit action for a user who is not logged in. This key is returned when adding a host for the first time. It should be stored and sent with subsequent edit requests. Optional if the user is logged in."},"id":{"type":"number","description":"The host ID used for identifying the host. Optional field. It is obtained when adding a host."},"enabled":{"type":"boolean","description":"Whether the host is enabled for monitoring. Optional field."},"address":{"type":"string","description":"The host address. Optional field."},"endpoint":{"type":"string","description":"The endpoint type for monitoring. Optional field. Endpoint types include: 'quantum', 'http', 'https', 'httphtml', 'icmp', 'dns', 'smtp', 'rawconnect'."},"port":{"type":"number","description":"The port of the service being monitored. Optional field."},"timeout":{"type":"number","description":"The timeout in milliseconds for the request. Optional field."},"hidden":{"type":"boolean","description":"If set to true, the host will be hidden, effectively removing it from future monitoring. Optional field."},"agent_location":{"type":"string","description":"The location of the agent monitoring this host. Optional field."}},"required":[]}},
5
+ {"name":"get_host_data","description":"Retrieve monitoring data for hosts. This function allows you to obtain data related to the monitoring of hosts. For example, to get the latest data for a host with address 'test.com', you would specify {'dataset_id': 0, 'address': 'test.com'}. To get data for a host with ID 2 between specific dates, you would specify {'id': 2, 'date_start': '2024-04-11T19:20:00', 'date_end': '2024-04-12T19:20:00'}. You can also filter hosts that are flagged with an alert by specifying {'alert_flag': true}. When using pagination, stop incrementing 'page_number' when no more data is found.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to provide all monitoring data for hosts, including extra response statistics or agent location. Setting it to true may slow down the processing speed."},"dataset_id":{"type":"number","description":"Return a set of statistical data. Data is arranged in 6-hour datasets. Set 'dataset_id' to 0 for the latest data. To view historic data, set 'dataset_id' to null and select a date range with 'date_start' and 'date_end'."},"id":{"type":"number","description":"Return data for the host with this ID. Optional field."},"address":{"type":"string","description":"Return data for the host with this address. Optional field."},"email":{"type":"string","description":"Return data for hosts associated with this email. Optional field."},"enabled":{"type":"boolean","description":"Return data for hosts with this enabled status. Optional field."},"port":{"type":"number","description":"Return data for the host with this port. Optional field."},"endpoint":{"type":"string","description":"Return data for hosts with this endpoint type. Optional field."},"alert_sent":{"type":"boolean","description":"Return data for hosts that have sent a down alert. Optional field."},"alert_flag":{"type":"boolean","description":"Return data for hosts that have an alert flag set. This can be used to retrieve hosts that are up or down. Optional field."},"date_start":{"type":"string","description":"The start time to filter data from. Used with 'date_end' to define a time range. Optional field."},"date_end":{"type":"string","description":"The end time to filter data up to. Optional field."},"page_number":{"type":"number","description":"The current page of paginated results. Starts from 1. Use this when retrieving large datasets incrementally."},"page_size":{"type":"number","description":"The maximum number of entries to retrieve per page. The default is 4."},"agent_location":{"type":"string","description":"The location of the agent monitoring this host. Optional field."}},"required":[]}},
6
+ {"name":"get_host_list","description":"Retrieve a list of monitored hosts and their configurations. This function allows you to obtain information about the hosts being monitored. For example, to filter hosts by address containing '.com', you would specify {'address': '.com'}. To filter hosts with a 'dns' endpoint, you would specify {'endpoint': 'dns'}.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you require more than the host's address and ID. This will provide additional configuration details."},"id":{"type":"number","description":"Return configuration for the host with this ID. Optional field."},"address":{"type":"string","description":"Return configuration for the host with this address. Optional field."},"email":{"type":"string","description":"Return configurations for hosts associated with this email. Optional field."},"enabled":{"type":"boolean","description":"Return configurations for hosts with this enabled status. Optional field."},"port":{"type":"number","description":"Return configurations for hosts with this port. Optional field."},"endpoint":{"type":"string","description":"Return configurations for hosts with this endpoint type. Optional field."},"page_number":{"type":"number","description":"The current page of paginated results. Starts from 1. Use this when retrieving large datasets incrementally."},"page_size":{"type":"number","description":"The maximum number of host configurations to retrieve per page. The default is 4."},"agent_location":{"type":"string","description":"The location of the agent monitoring these hosts. Optional field."}},"required":[]}},
7
+ {"name":"get_agents","description":"Retrieve a list of monitoring agent details. Call this function to provide the user with a list of agents to choose from. Note that agents with a GUID (UserId) in the strings are the user's local agents used for local network tasks. The other agents (e.g., 'Scanner - EU') are internet-based agents. If a local agent is not available, direct the user to install any of the agents from this page: https://freenetworkmonitor.click/download.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to return all agent details. Set to false if only the agent location and function calling capabilities are required."}},"required":["detail_response"]}},
8
+ {"name":"get_user_info","description":"Get information about the user, including the user's current time, account type, email, tokens used, and other details. This function provides insight into the user's profile and status.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to return all user details. Set to false if only basic info is required."}},"required":["detail_response"]}},
9
+ {"name":"run_nmap","description":"Perform a network scan using Nmap. Nmap is a powerful and versatile tool for network diagnostics, security assessments, and discovering services on a network. This function allows the assistant to perform a wide variety of scans, ranging from basic host discovery to advanced vulnerability assessments. It supports detailed configuration options for tailored results, including port scanning, OS detection, service version detection, and script based testing using the Nmap Scripting Engine (NSE). Use this function to gather insights about a network or its hosts.","parameters":{"type":"object","properties":{"scan_options":{"type":"string","description":"Specify the Nmap scan type and additional options. Common options include: Basic Scans: -sn for ping scan. Port Scanning: -sS for TCP SYN scan, -p <ports> to specify ports. Service/Version Detection: -sV. OS Detection: -O. Aggressive Scans: -A for a comprehensive scan. Stealth and Timing Options: -T<0-5>, -Pn for stealth scans. Additional Options: --script <script_name>, --traceroute, -v, etc. Target (target): Always include the target in the target parameter. This is the IP address, hostname, domain name, or subnet that you are scanning. Example targets include: A single IP address: 192.168.1.1 An IP range: 192.168.1.1-254 A domain name: example.com A subnet: 192.168.1.0/24 3. Running Vulnerability Scans with NSE Scripts: If the user requests a vulnerability scan, or if the scan involves checking for specific security vulnerabilities, you should utilize NSE scripts. Common options include: -sC to run the default set of NSE scripts. --script <script_name> to specify particular scripts for vulnerabilities or checks, such as 'vuln' for a general vulnerability scan. Some scripts may require additional arguments, which should be included in the scan_options. Example: --script=vuln. --script=http-enum for web directory enumeration . Ports can be specified using -p, e.g. -p 80,443 for HTTP/HTTPS or -p- for all ports. Multiple options can be combined, e.g. -sS -p 22,443 --script=ssl-enum-ciphers."},"target":{"type":"string","description":"Specify the target(s) to scan. Targets can include a single IP address (e.g., 192.168.1.1), a domain name (e.g., example.com), a range of IPs (e.g., 192.168.1.1 192.168.1.10), or a subnet in CIDR notation (e.g., 192.168.1.0/24). Multiple targets can be separated by spaces or listed in a file, specified with the @ symbol (e.g., @targets.txt)."},"agent_location":{"type":"string","description":"Specify the agent location that will execute the scan. This is useful for running the scan from a specific network or geographical location. If not provided, the scan will be performed by the default agent."},"number_lines":{"type":"number","description":"Limit the number of lines to return from the scan results. Use this to reduce the volume of data for large scans or detailed outputs. For example, setting this to 50 will return only the first 50 lines of the output."},"page":{"type":"number","description":"Specify the page number to paginate through the scan output when it is too large to process at once. Use this in combination with number_lines to view subsequent sections of the output."}},"required":["scan_options","target"]}},
10
+ {"name":"run_openssl","description":"Perform detailed security checks on SSL/TLS configurations of servers using OpenSSL. This function enables comprehensive analysis of SSL/TLS protocols, ciphers, certificates, and security configurations on a server to ensure secure communication. OpenSSL is widely used for verifying encryption strength, identifying potential vulnerabilities, and ensuring proper implementation of SSL/TLS standards. Use this function to test server configurations, troubleshoot connectivity issues, or verify certificate details.","parameters":{"type":"object","properties":{"command_options":{"type":"string","description":"Specify the OpenSSL command and options for the desired security test. Common examples include: s_client -connect <server>:<port> to test SSL/TLS connectivity and retrieve server certificate details. s_client -connect <server>:<port> -tls1_2 to force a connection using TLS 1.2. x509 -in <certificate> to inspect the contents of an SSL/TLS certificate. ciphers to list supported ciphers. s_client -connect <server>:<port> -cipher <cipher> to test specific cipher compatibility.Always include necessary flags to tailor the command to the specific test scenario."},"target":{"type":"string","description":"The server or service to test. Provide the target as an IP address (e.g., 192.168.1.1) or domain name (e.g., example.com). Ensure that the target includes the port if necessary (e.g., example.com:443)."},"agent_location":{"type":"string","description":"Optional. Specify the agent that will execute the OpenSSL command. Use this to perform tests from a specific network or geographical location. If not provided, the default agent will be used."},"number_lines":{"type":"number","description":"Optional. Limit the number of lines returned in the output. Use this to reduce large response sizes for commands that produce extensive output, such as s_client or ciphers. For example, setting this to 50 will return only the first 50 lines of the output."},"page":{"type":"number","description":"Optional. Specify the page number for paginating through large outputs. Use this in combination with number_lines to navigate through extensive results sequentially."},"timeout":{"type":"number","description":"Optional. Specify the maximum duration (in seconds) to wait for a response from the server. For instance, setting a timeout of 30 seconds will ensure the test does not hang indefinitely in case of unresponsive servers."},"verify_cert":{"type":"boolean","description":"Optional. Set to true to validate the servers certificate chain and ensure that it is properly signed by a trusted CA. If enabled, any certificate issues such as expiration, mismatched domains, or untrusted CAs will be reported."}},"required":["command_options","target"]}},
11
+ {"name":"run_busybox_command","description":"Execute a network related command using BusyBox, a lightweight utility offering a suite of Unix tools in a single executable. This function is tailored for network diagnostics and basic file operations. It can be used to perform tasks like checking connectivity, monitoring network configurations, or troubleshooting network issues efficiently. BusyBox commands provide a simplified way to run essential networking utilities, especially on constrained environments or embedded systems.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The BusyBox command to execute. Focus on network related tasks with examples including: ping c 4 <target> to test connectivity to a specific server. traceroute <target> to trace the route packets take to a destination. ifconfig to display network interface configurations. nslookup <domain> to resolve a domain to its IP address. netstat an to list active network connections and listening ports. wget O <URL> to fetch a webpage and test HTTP connectivity. Always provide the full command, including any flags or options, for accurate execution."},"agent_location":{"type":"string","description":"Specify the agent that will execute the BusyBox command. Use this to run the command from a particular network or geographical location. If not provided, the default agent will be used."},"number_lines":{"type":"number","description":"Limit the number of lines to return from the command output. Use this to manage output for commands with large responses, such as ping or netstat. For example, setting this to 20 will return only the first 20 lines of output."},"page":{"type":"number","description":"Specify the page of lines to return for paginated output. Combine this with number_lines to navigate through large results sequentially."},"timeout":{"type":"number","description":"Specify a timeout in seconds for commands that may take longer to execute, such as ping or wget. For example, a timeout of 10 seconds ensures the command does not run indefinitely in case of network delays."}},"required":["command"]}},
12
+ {"name":"are_functions_running","description":"Check if functions have completed. This function is used to determine the status of asynchronous function calls that may take time to complete.","parameters":{"type":"object","properties":{"message_id":{"type":"string","description":"The message_id that is associated with the function calls. This ID is used to track the status of the functions."},"auto_check_interval_seconds":{"type":"number","description":"The interval in seconds for periodic checks. Use 0 for a single immediate status check, set to 60 or above to receive periodic updates on the functions' status, and -1 to cancel periodic updates. Optional. Default is 0."}},"required":["message_id"]}},
13
+ {"name":"cancel_functions","description":"Cancel running functions. Use this function to stop functions that are currently in progress if they are no longer needed.","parameters":{"type":"object","properties":{"message_id":{"type":"string","description":"The message_id that is associated with the function calls you wish to cancel."}},"required":["message_id"]}}
14
+ ]<|/tool|>
15
+ When you need to call a tool. Reply only with the tool_call instruction using the following format
16
+ <tool_call>
17
+ {"name": <function-name>, "arguments": <args-json-object>}
18
+ </tool_call>
19
+ Do not give examples of how to call tools as this will be interpreted by the tool parsing code as an actual tool_call instruction and it will be executed. Only use the tool_call instruction format when you actually want to call a tool.
20
+ You are a Network Monitor Assistant called TestLLM. You will use the provided tools to help a user monitor their network. When you call a tool provide feedback using only the reponse from the tool call. Choose the tool that best fits the users request. You will provide helpful and informative assistance using the tool responses<|end|>
21
+ <|user|>
22
+ What's my user info?
23
+ <|end|><|assistant|><tool_call>
24
+ {"name" : "get_user_info", "parameters" : {"detail_response" : false}}
25
+ </tool_call>
system_prompt_phi_4_mini_run ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <|system|>You are a helpful assistant with some tools.<|tool|>
2
+ [
3
+ {"name":"add_host","description":"Add a new host to be monitored. This function allows you to specify the host address and various monitoring options. For example, to add a host with address 'example.com' and monitor it using the HTTP endpoint, you would specify {'address': 'example.com', 'endpoint': 'http'}. This will set up monitoring for the specified host using the selected endpoint type.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to echo all the values set. The default is false for a faster response."},"address":{"type":"string","description":"The host address to be monitored. This is a required field."},"endpoint":{"type":"string","description":"The endpoint type for monitoring. Optional field. Endpoint types include: 'quantum' (a quantum-safe encryption test), 'http' (website ping), 'https' (SSL certificate check), 'httphtml' (loads only the HTML of a website), 'icmp' (host ping), 'dns' (DNS lookup), 'smtp' (email server HELO message confirmation), 'rawconnect' (low-level raw socket connection)."},"port":{"type":"number","description":"The port of the service being monitored. Optional field. If not specified, it defaults to the standard port for the endpoint type. For example, the standard port for HTTPS is 443."},"timeout":{"type":"number","description":"The time to wait for a timeout in milliseconds. Optional field. The default is 59000 milliseconds."},"email":{"type":"string","description":"The user's email address. Do not use this field if the user is logged in; their login email will be used and this field will be ignored. If the user is not logged in, then ask for an email. Alerts are sent to the user's email."},"agent_location":{"type":"string","description":"The location of the agent monitoring this host. Optional field. If left blank, an agent location will be assigned automatically."}},"required":["address"]}},
4
+ {"name":"edit_host","description":"Edit an existing host's monitoring configuration. This function allows you to modify the monitoring settings of a host that has already been added. For example, to edit the host with address 'test.com' and change the endpoint to 'icmp', you would specify {'address':'test.com', 'endpoint':'icmp'}. You can update various parameters such as the endpoint type, port, timeout, and more.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to echo all the values set. The default is false."},"auth_key":{"type":"string","description":"An authentication key used to authorize the edit action for a user who is not logged in. This key is returned when adding a host for the first time. It should be stored and sent with subsequent edit requests. Optional if the user is logged in."},"id":{"type":"number","description":"The host ID used for identifying the host. Optional field. It is obtained when adding a host."},"enabled":{"type":"boolean","description":"Whether the host is enabled for monitoring. Optional field."},"address":{"type":"string","description":"The host address. Optional field."},"endpoint":{"type":"string","description":"The endpoint type for monitoring. Optional field. Endpoint types include: 'quantum', 'http', 'https', 'httphtml', 'icmp', 'dns', 'smtp', 'rawconnect'."},"port":{"type":"number","description":"The port of the service being monitored. Optional field."},"timeout":{"type":"number","description":"The timeout in milliseconds for the request. Optional field."},"hidden":{"type":"boolean","description":"If set to true, the host will be hidden, effectively removing it from future monitoring. Optional field."},"agent_location":{"type":"string","description":"The location of the agent monitoring this host. Optional field."}},"required":[]}},
5
+ {"name":"get_host_data","description":"Retrieve monitoring data for hosts. This function allows you to obtain data related to the monitoring of hosts. For example, to get the latest data for a host with address 'test.com', you would specify {'dataset_id': 0, 'address': 'test.com'}. To get data for a host with ID 2 between specific dates, you would specify {'id': 2, 'date_start': '2024-04-11T19:20:00', 'date_end': '2024-04-12T19:20:00'}. You can also filter hosts that are flagged with an alert by specifying {'alert_flag': true}. When using pagination, stop incrementing 'page_number' when no more data is found.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to provide all monitoring data for hosts, including extra response statistics or agent location. Setting it to true may slow down the processing speed."},"dataset_id":{"type":"number","description":"Return a set of statistical data. Data is arranged in 6-hour datasets. Set 'dataset_id' to 0 for the latest data. To view historic data, set 'dataset_id' to null and select a date range with 'date_start' and 'date_end'."},"id":{"type":"number","description":"Return data for the host with this ID. Optional field."},"address":{"type":"string","description":"Return data for the host with this address. Optional field."},"email":{"type":"string","description":"Return data for hosts associated with this email. Optional field."},"enabled":{"type":"boolean","description":"Return data for hosts with this enabled status. Optional field."},"port":{"type":"number","description":"Return data for the host with this port. Optional field."},"endpoint":{"type":"string","description":"Return data for hosts with this endpoint type. Optional field."},"alert_sent":{"type":"boolean","description":"Return data for hosts that have sent a down alert. Optional field."},"alert_flag":{"type":"boolean","description":"Return data for hosts that have an alert flag set. This can be used to retrieve hosts that are up or down. Optional field."},"date_start":{"type":"string","description":"The start time to filter data from. Used with 'date_end' to define a time range. Optional field."},"date_end":{"type":"string","description":"The end time to filter data up to. Optional field."},"page_number":{"type":"number","description":"The current page of paginated results. Starts from 1. Use this when retrieving large datasets incrementally."},"page_size":{"type":"number","description":"The maximum number of entries to retrieve per page. The default is 4."},"agent_location":{"type":"string","description":"The location of the agent monitoring this host. Optional field."}},"required":[]}},
6
+ {"name":"get_host_list","description":"Retrieve a list of monitored hosts and their configurations. This function allows you to obtain information about the hosts being monitored. For example, to filter hosts by address containing '.com', you would specify {'address': '.com'}. To filter hosts with a 'dns' endpoint, you would specify {'endpoint': 'dns'}.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you require more than the host's address and ID. This will provide additional configuration details."},"id":{"type":"number","description":"Return configuration for the host with this ID. Optional field."},"address":{"type":"string","description":"Return configuration for the host with this address. Optional field."},"email":{"type":"string","description":"Return configurations for hosts associated with this email. Optional field."},"enabled":{"type":"boolean","description":"Return configurations for hosts with this enabled status. Optional field."},"port":{"type":"number","description":"Return configurations for hosts with this port. Optional field."},"endpoint":{"type":"string","description":"Return configurations for hosts with this endpoint type. Optional field."},"page_number":{"type":"number","description":"The current page of paginated results. Starts from 1. Use this when retrieving large datasets incrementally."},"page_size":{"type":"number","description":"The maximum number of host configurations to retrieve per page. The default is 4."},"agent_location":{"type":"string","description":"The location of the agent monitoring these hosts. Optional field."}},"required":[]}},
7
+ {"name":"get_agents","description":"Retrieve a list of monitoring agent details. Call this function to provide the user with a list of agents to choose from. Note that agents with a GUID (UserId) in the strings are the user's local agents used for local network tasks. The other agents (e.g., 'Scanner - EU') are internet-based agents. If a local agent is not available, direct the user to install any of the agents from this page: https://freenetworkmonitor.click/download.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to return all agent details. Set to false if only the agent location and function calling capabilities are required."}},"required":["detail_response"]}},
8
+ {"name":"get_user_info","description":"Get information about the user, including the user's current time, account type, email, tokens used, and other details. This function provides insight into the user's profile and status.","parameters":{"type":"object","properties":{"detail_response":{"type":"boolean","description":"Set to true if you want the function to return all user details. Set to false if only basic info is required."}},"required":["detail_response"]}},
9
+ {"name":"run_nmap","description":"Perform a network scan using Nmap. Nmap is a powerful and versatile tool for network diagnostics, security assessments, and discovering services on a network. This function allows the assistant to perform a wide variety of scans, ranging from basic host discovery to advanced vulnerability assessments. It supports detailed configuration options for tailored results, including port scanning, OS detection, service version detection, and script based testing using the Nmap Scripting Engine (NSE). Use this function to gather insights about a network or its hosts.","parameters":{"type":"object","properties":{"scan_options":{"type":"string","description":"Specify the Nmap scan type and additional options. Common options include: Basic Scans: -sn for ping scan. Port Scanning: -sS for TCP SYN scan, -p <ports> to specify ports. Service/Version Detection: -sV. OS Detection: -O. Aggressive Scans: -A for a comprehensive scan. Stealth and Timing Options: -T<0-5>, -Pn for stealth scans. Additional Options: --script <script_name>, --traceroute, -v, etc. Target (target): Always include the target in the target parameter. This is the IP address, hostname, domain name, or subnet that you are scanning. Example targets include: A single IP address: 192.168.1.1 An IP range: 192.168.1.1-254 A domain name: example.com A subnet: 192.168.1.0/24 3. Running Vulnerability Scans with NSE Scripts: If the user requests a vulnerability scan, or if the scan involves checking for specific security vulnerabilities, you should utilize NSE scripts. Common options include: -sC to run the default set of NSE scripts. --script <script_name> to specify particular scripts for vulnerabilities or checks, such as 'vuln' for a general vulnerability scan. Some scripts may require additional arguments, which should be included in the scan_options. Example: --script=vuln. --script=http-enum for web directory enumeration . Ports can be specified using -p, e.g. -p 80,443 for HTTP/HTTPS or -p- for all ports. Multiple options can be combined, e.g. -sS -p 22,443 --script=ssl-enum-ciphers."},"target":{"type":"string","description":"Specify the target(s) to scan. Targets can include a single IP address (e.g., 192.168.1.1), a domain name (e.g., example.com), a range of IPs (e.g., 192.168.1.1 192.168.1.10), or a subnet in CIDR notation (e.g., 192.168.1.0/24). Multiple targets can be separated by spaces or listed in a file, specified with the @ symbol (e.g., @targets.txt)."},"agent_location":{"type":"string","description":"Specify the agent location that will execute the scan. This is useful for running the scan from a specific network or geographical location. If not provided, the scan will be performed by the default agent."},"number_lines":{"type":"number","description":"Limit the number of lines to return from the scan results. Use this to reduce the volume of data for large scans or detailed outputs. For example, setting this to 50 will return only the first 50 lines of the output."},"page":{"type":"number","description":"Specify the page number to paginate through the scan output when it is too large to process at once. Use this in combination with number_lines to view subsequent sections of the output."}},"required":["scan_options","target"]}},
10
+ {"name":"run_openssl","description":"Perform detailed security checks on SSL/TLS configurations of servers using OpenSSL. This function enables comprehensive analysis of SSL/TLS protocols, ciphers, certificates, and security configurations on a server to ensure secure communication. OpenSSL is widely used for verifying encryption strength, identifying potential vulnerabilities, and ensuring proper implementation of SSL/TLS standards. Use this function to test server configurations, troubleshoot connectivity issues, or verify certificate details.","parameters":{"type":"object","properties":{"command_options":{"type":"string","description":"Specify the OpenSSL command and options for the desired security test. Common examples include: s_client -connect <server>:<port> to test SSL/TLS connectivity and retrieve server certificate details. s_client -connect <server>:<port> -tls1_2 to force a connection using TLS 1.2. x509 -in <certificate> to inspect the contents of an SSL/TLS certificate. ciphers to list supported ciphers. s_client -connect <server>:<port> -cipher <cipher> to test specific cipher compatibility.Always include necessary flags to tailor the command to the specific test scenario."},"target":{"type":"string","description":"The server or service to test. Provide the target as an IP address (e.g., 192.168.1.1) or domain name (e.g., example.com). Ensure that the target includes the port if necessary (e.g., example.com:443)."},"agent_location":{"type":"string","description":"Optional. Specify the agent that will execute the OpenSSL command. Use this to perform tests from a specific network or geographical location. If not provided, the default agent will be used."},"number_lines":{"type":"number","description":"Optional. Limit the number of lines returned in the output. Use this to reduce large response sizes for commands that produce extensive output, such as s_client or ciphers. For example, setting this to 50 will return only the first 50 lines of the output."},"page":{"type":"number","description":"Optional. Specify the page number for paginating through large outputs. Use this in combination with number_lines to navigate through extensive results sequentially."},"timeout":{"type":"number","description":"Optional. Specify the maximum duration (in seconds) to wait for a response from the server. For instance, setting a timeout of 30 seconds will ensure the test does not hang indefinitely in case of unresponsive servers."},"verify_cert":{"type":"boolean","description":"Optional. Set to true to validate the servers certificate chain and ensure that it is properly signed by a trusted CA. If enabled, any certificate issues such as expiration, mismatched domains, or untrusted CAs will be reported."}},"required":["command_options","target"]}},
11
+ {"name":"run_busybox_command","description":"Execute a network related command using BusyBox, a lightweight utility offering a suite of Unix tools in a single executable. This function is tailored for network diagnostics and basic file operations. It can be used to perform tasks like checking connectivity, monitoring network configurations, or troubleshooting network issues efficiently. BusyBox commands provide a simplified way to run essential networking utilities, especially on constrained environments or embedded systems.","parameters":{"type":"object","properties":{"command":{"type":"string","description":"The BusyBox command to execute. Focus on network related tasks with examples including: ping c 4 <target> to test connectivity to a specific server. traceroute <target> to trace the route packets take to a destination. ifconfig to display network interface configurations. nslookup <domain> to resolve a domain to its IP address. netstat an to list active network connections and listening ports. wget O <URL> to fetch a webpage and test HTTP connectivity. Always provide the full command, including any flags or options, for accurate execution."},"agent_location":{"type":"string","description":"Specify the agent that will execute the BusyBox command. Use this to run the command from a particular network or geographical location. If not provided, the default agent will be used."},"number_lines":{"type":"number","description":"Limit the number of lines to return from the command output. Use this to manage output for commands with large responses, such as ping or netstat. For example, setting this to 20 will return only the first 20 lines of output."},"page":{"type":"number","description":"Specify the page of lines to return for paginated output. Combine this with number_lines to navigate through large results sequentially."},"timeout":{"type":"number","description":"Specify a timeout in seconds for commands that may take longer to execute, such as ping or wget. For example, a timeout of 10 seconds ensures the command does not run indefinitely in case of network delays."}},"required":["command"]}},
12
+ {"name":"are_functions_running","description":"Check if functions have completed. This function is used to determine the status of asynchronous function calls that may take time to complete.","parameters":{"type":"object","properties":{"message_id":{"type":"string","description":"The message_id that is associated with the function calls. This ID is used to track the status of the functions."},"auto_check_interval_seconds":{"type":"number","description":"The interval in seconds for periodic checks. Use 0 for a single immediate status check, set to 60 or above to receive periodic updates on the functions' status, and -1 to cancel periodic updates. Optional. Default is 0."}},"required":["message_id"]}},
13
+ {"name":"cancel_functions","description":"Cancel running functions. Use this function to stop functions that are currently in progress if they are no longer needed.","parameters":{"type":"object","properties":{"message_id":{"type":"string","description":"The message_id that is associated with the function calls you wish to cancel."}},"required":["message_id"]}}
14
+ ]<|/tool|>
15
+ When you need to call a tool. Reply only with the tool_call instruction using the following format
16
+ <tool_call>
17
+ {"name": <function-name>, "arguments": <args-json-object>}
18
+ </tool_call>
19
+ Do not give examples of how to call tools as this will be interpreted by the tool parsing code as an actual tool_call instruction and it will be executed. Only use the tool_call instruction format when you actually want to call a tool.
20
+ You are a Network Monitor Assistant called TestLLM. You will use the provided tools to help a user monitor their network. When you call a tool provide feedback using only the reponse from the tool call. Choose the tool that best fits the users request. You will provide helpful and informative assistance using the tool responses<|end|>
21
+ <|user|>
22
+ What's my user info?
23
+ <|end|><|assistant|><tool_call>
24
+ {"name" : "get_user_info", "parameters" : {"detail_response" : false}}
25
+ </tool_call>
26
+ <|end|>
27
+