neorichi commited on
Commit
67a8bae
·
verified ·
1 Parent(s): 57c11c5

README: dos configuraciones (Q8+MTP y Q6); modelo = nesi2

Browse files
Files changed (1) hide show
  1. README.md +73 -62
README.md CHANGED
@@ -7,7 +7,6 @@ tags:
7
  - pentesting
8
  - security
9
  - uncensored
10
- - qwen3
11
  - tool-calling
12
  - gguf
13
  - llama-cpp
@@ -21,58 +20,74 @@ pipeline_tag: text-generation
21
  penetration testing, vulnerability analysis, exploit development, secure
22
  code review, and audit automation.
23
 
24
- It is built on the **Qwen3.8-27B** architecture (same family as
25
- [Nesi1](https://huggingface.co/nesilabs/Nesi1)) and packaged by Nesilabs as a
26
- **GGUF** build for **llama.cpp**, so it runs on a single GPU without an AWQ/vLLM
27
- stack. This is the build we run as an autonomous **pentest agent**: it reliably
28
- reaches code-exec on multi-stage targets (web → WebSocket tool abuse → RCE) with
29
- native tool-calling.
30
 
31
  ## Highlights
32
  - **Unrestricted** for legitimate security use cases.
33
- - **27B parameters**, long context (up to **240k tokens** in production), native tool-calling.
34
- - **GGUF Q6_K** — single-file, runs on one 48–96 GB GPU with llama.cpp.
35
- - Includes the **MTP** weights (`*-mtp.gguf`) for optional speculative decode.
36
  - Validated end-to-end as a **pentest agent** (live RCE + loot + flag on a 3-stage CTF).
37
 
38
  ## Model details
39
  | | |
40
  |---|---|
41
- | Base architecture | Qwen3.8-27B |
42
- | Format | **GGUF** (`Nesi2-Q6_K.gguf` + `Nesi2-Q6_K-mtp.gguf`) |
43
- | Quantization | **Q6_K** (~22 GB weights) |
44
  | Context length | up to 262,144 tokens (240k used in prod) |
45
  | Tool-calling | OpenAI-compatible (native in llama.cpp `llama-server`) |
46
  | Serving | **llama.cpp `llama-server`** (OpenAI `/v1` compatible) |
47
  | KV cache | bf16 by default; `q8_0` to roughly halve footprint |
48
 
49
  > Note: the Hub's "Architecture" widget reads the GGUF's internal loader tag
50
- > (`general.architecture`), which may display as `qwen35`. That is only the
51
- > llama.cpp loader key baked into the file — the model is **Qwen3.8-27B**.
52
 
53
  ## Files
54
  | File | What |
55
  |---|---|
56
- | `Nesi2-Q6_K.gguf` | the model (load this one) |
57
- | `Nesi2-Q6_K-mtp.gguf` | MTP head for speculative decode (optional, `--model-draft`) |
 
 
58
 
59
  ---
60
 
61
- ## Deploy on a Vast.ai box from zero
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  Everything below runs **on the GPU box as root**. The gateway bits run on your
64
- LiteLLM host. Target image: `nvidia/cuda:12.8.1-devel-ubuntu22.04`, ≥ 160 GB disk.
 
65
 
66
  ### 0) Pick a GPU
67
- | GPU | VRAM | Fits | single-stream tok/s (Q6_K, 240k slot) |
68
  |---|---|---|---|
69
- | RTX A6000 | 48 GB | 1 user @ 240k | ~22 |
70
  | RTX PRO 6000 **Max-Q** (power-capped ~300W) | 96 GB | 1–3 users @ 240k | ~20–25 (gateway end-to-end) |
71
- | RTX PRO 6000 **WS** (full ~600W) | 96 GB | 1–3 users @ 240k | **~55** |
72
 
73
- > Blackwell (PRO 6000, `sm_120`) needs CUDA toolkit **≥ 12.8**. A box whose driver
74
- > reports CUDA < 12.8 will fail vLLM; for llama.cpp just build with
75
- > `-DCMAKE_CUDA_ARCHITECTURES=120`. On Ampere (A6000) use `86`.
76
 
77
  ### 1) Deps + build llama.cpp
78
  ```bash
@@ -91,6 +106,9 @@ cmake --build build --config Release -j"$(nproc)" --target llama-server
91
 
92
  ### 2) Download the model
93
  ```bash
 
 
 
94
  hf download nesilabs/Nesi2 --include "Nesi2-Q6_K*.gguf" --local-dir /root/models/nesi2
95
  ```
96
 
@@ -98,35 +116,35 @@ hf download nesilabs/Nesi2 --include "Nesi2-Q6_K*.gguf" --local-dir /root/models
98
  Never start it with `setsid`/`nohup` over SSH (they die when the pipe closes).
99
  Use **tmux** so it survives the SSH session.
100
 
101
- **Profile A — single power user @ 240k** (the production default):
 
 
 
102
  ```bash
103
- GGUF=$(find /root/models/nesi2 -name "*.gguf" | grep -ivE "mmproj|vision|mtp" | sort | head -1)
104
  tmux new-session -d -s nesi2 "/root/llama.cpp/build/bin/llama-server \
105
- --model $GGUF --alias nesi2 \
106
- --ctx-size 245760 --parallel 1 --n-gpu-layers 999 -fa on \
 
 
 
107
  --host 0.0.0.0 --port 8080 --api-key <YOUR_API_KEY> \
108
  > /root/llama.log 2>&1"
109
  ```
 
110
 
111
- **Profile B — 3 users (team), 240k each at the same time:**
112
- `--parallel N` splits `--ctx-size` across slots → `n_ctx_slot = ctx_size / parallel`.
113
- So for **3 slots of 240k each you need `--ctx-size 737280` (= 3 × 245760)**.
114
- That much KV does not fit alongside Q6_K weights in 96 GB at bf16, so use a
115
- **quantized KV cache** (`q8_0`, ~half the footprint, negligible quality loss):
116
  ```bash
117
- GGUF=$(find /root/models/nesi2 -name "*.gguf" | grep -ivE "mmproj|vision|mtp" | sort | head -1)
118
  tmux new-session -d -s nesi2 "/root/llama.cpp/build/bin/llama-server \
119
- --model $GGUF --alias nesi2 \
120
- --ctx-size 737280 --parallel 3 --n-gpu-layers 999 -fa on \
121
- --cache-type-k q8_0 --cache-type-v q8_0 \
122
  --host 0.0.0.0 --port 8080 --api-key <YOUR_API_KEY> \
123
  > /root/llama.log 2>&1"
124
  ```
125
- If it still OOMs on a given card: drop to `--cache-type-k q4_0 --cache-type-v q4_0`,
126
- or lower per-user context (e.g. `--ctx-size 393216 --parallel 3` = 128k each),
127
- or move to a 2× GPU box. Under `--parallel 3` **per-stream** speed drops
128
- (~55 → ~20–30 tok/s/stream on a WS) but aggregate throughput goes up; this is the
129
- right trade for a 3-person team that isn't all generating at the exact same instant.
130
 
131
  Wait for load (VRAM up + `server is listening`):
132
  ```bash
@@ -143,8 +161,6 @@ NESI2_API_KEY=<YOUR_API_KEY>
143
  # then
144
  docker compose up -d litellm
145
  ```
146
- Get `<BOX_PUBLIC_IP>:<HOSTPORT>` with
147
- `vastai show instance <ID> --raw` → `public_ipaddr` and `ports["8080/tcp"][0].HostPort`.
148
 
149
  ### 5) Verify end-to-end
150
  ```bash
@@ -157,22 +173,18 @@ curl -s -X POST https://<your-gateway>/v1/chat/completions \
157
 
158
  ## Lessons learned & recommendations
159
 
160
- - **`reasoning_effort` breaks this chat template.** The template only accepts
161
- `xhigh|medium|low`; a client sending `reasoning_effort: "high"` triggers a jinja
162
- exception → HTTP 500. Strip it at the gateway (LiteLLM: `drop_params: true` +
163
- `additional_drop_params: ["reasoning_effort"]`) so every client is unaffected.
164
  - **`--parallel 1` is mandatory to actually get the full 240k in one slot.** The
165
  llama.cpp default (`--parallel 4`) silently gives each slot `ctx/4`.
166
  - **`-fa on` (flash-attention)** — keep it on; large context is unusable without it.
167
  - **tmux, not setsid/nohup.** Over SSH the detached process dies and you get an
168
  empty log; tmux survives.
169
- - **Agent discipline > raw capability.** Same base as Nesi1, but as an agent Nesi2
170
- shines because of *tool-calling discipline*: it acts (one concrete tool call per
171
- turn) instead of narrating. Give it a lean system prompt that says: act don't
172
- narrate; write your own Python for anything past a simple HTTP request
173
- (WebSocket, sockets, rotating CSRF); get code-exec first and confirm with `id`;
174
- and **keep durable state on disk** (a `NOTES.md` + reusable scripts) so a context
175
- compaction doesn't make it re-derive what it already solved.
176
  - **Isolate the agent's filesystem for honest evals.** A harness whose shell can
177
  read your machine will "solve" a CTF by reading the solution/writeups off disk
178
  instead of attacking live. Deny reads outside the target (regex guard in the tool
@@ -180,13 +192,13 @@ curl -s -X POST https://<your-gateway>/v1/chat/completions \
180
  stays open.
181
  - **KV quantization scales users cheaply.** `--cache-type-k/v q8_0` roughly doubles
182
  how many 240k slots fit, with no quality drift we could measure; it's what makes
183
- the 3-user profile fit a single 96 GB card.
184
  - **Max-Q vs WS.** The power-capped Max-Q PRO 6000 is ~2.5× slower than the full WS
185
  for ~0.25 $/h less. For interactive/agent use pay for the WS; for cheap batch,
186
  Max-Q is fine.
187
- - **Speculative decode (MTP).** The `*-mtp.gguf` draft head is included; under
188
- concurrency it did **not** help throughput in our tests (same finding as Nesi1's
189
- NEXTN), so we run without it and keep it available for single-stream latency.
190
 
191
  ## ⚠️ Legal Notice / Disclaimer
192
 
@@ -214,5 +226,4 @@ By using Nesi2 you accept this notice and the Nesilabs Terms of Service and
214
  Acceptable Use Policy.
215
 
216
  ## License
217
- Released under **Apache 2.0**. Based on the Qwen3.8-27B architecture.
218
- Adapted and packaged by Nesilabs.
 
7
  - pentesting
8
  - security
9
  - uncensored
 
10
  - tool-calling
11
  - gguf
12
  - llama-cpp
 
20
  penetration testing, vulnerability analysis, exploit development, secure
21
  code review, and audit automation.
22
 
23
+ It is packaged by Nesilabs as a **GGUF** build for **llama.cpp**, so it runs on a
24
+ single GPU without an AWQ/vLLM stack. This is the build we run as an autonomous
25
+ **pentest agent**: it reliably reaches code-exec on multi-stage targets
26
+ (web → WebSocket tool abuse → RCE) with native tool-calling.
 
 
27
 
28
  ## Highlights
29
  - **Unrestricted** for legitimate security use cases.
30
+ - **~27B parameters**, long context (up to **240k tokens** in production), native tool-calling.
31
+ - Two GGUF builds: **Q8_0** (≈lossless, production quality) and **Q6_K** (lighter).
32
+ - Ships the **MTP** draft weights (`*-mtp*.gguf`) for optional speculative decode.
33
  - Validated end-to-end as a **pentest agent** (live RCE + loot + flag on a 3-stage CTF).
34
 
35
  ## Model details
36
  | | |
37
  |---|---|
38
+ | Format | **GGUF** (llama.cpp) |
39
+ | Quantizations | **Q8_0** (~29 GB) · **Q6_K** (~22 GB) |
 
40
  | Context length | up to 262,144 tokens (240k used in prod) |
41
  | Tool-calling | OpenAI-compatible (native in llama.cpp `llama-server`) |
42
  | Serving | **llama.cpp `llama-server`** (OpenAI `/v1` compatible) |
43
  | KV cache | bf16 by default; `q8_0` to roughly halve footprint |
44
 
45
  > Note: the Hub's "Architecture" widget reads the GGUF's internal loader tag
46
+ > (`general.architecture`); that is only a llama.cpp loader key baked into the
47
+ > file and does not reflect the model name. The model is **Nesi2**.
48
 
49
  ## Files
50
  | File | What |
51
  |---|---|
52
+ | `Nesi2-Q8_0.gguf` | the model, **Q8_0** (max quality) |
53
+ | `Nesi2-mtp-Q8_0.gguf` | MTP draft head for Q8 (optional, `--model-draft`) |
54
+ | `Nesi2-Q6_K.gguf` | the model, **Q6_K** (lighter) |
55
+ | `Nesi2-Q6_K-mtp.gguf` | Q6_K with the MTP head already merged (single file) |
56
 
57
  ---
58
 
59
+ ## Two configurations
60
+
61
+ Both serve the same `nesi2` model over an OpenAI-compatible `/v1`. Pick by VRAM
62
+ and quality target.
63
+
64
+ | Config | Files | VRAM (weights + MTP) | When |
65
+ |---|---|---|---|
66
+ | **A — Q8_0 + MTP** | `Nesi2-Q8_0.gguf` + `Nesi2-mtp-Q8_0.gguf` | ~29 + ~3 GB | max quality, 96 GB card |
67
+ | **B — Q6_K (+MTP)** | `Nesi2-Q6_K.gguf` (or `Nesi2-Q6_K-mtp.gguf`) | ~22 GB | lighter, more slots / smaller card |
68
+
69
+ > **MTP (speculative decode)** needs a llama.cpp build that supports
70
+ > `--spec-type draft-mtp`. It helps **single-stream latency**; under heavy
71
+ > concurrency it did not improve aggregate throughput in our tests, so for
72
+ > multi-user serving you can run without it and keep it for low-latency use.
73
+
74
+ ---
75
+
76
+ ## Deploy on a GPU box from zero
77
 
78
  Everything below runs **on the GPU box as root**. The gateway bits run on your
79
+ LiteLLM host. Target image: `nvidia/cuda:12.8.1-devel-ubuntu22.04`, ≥ 60 GB disk
80
+ (≥ 90 GB if you want Q8 **and** Q6 on the same box).
81
 
82
  ### 0) Pick a GPU
83
+ | GPU | VRAM | Fits | single-stream tok/s (240k slot) |
84
  |---|---|---|---|
85
+ | RTX A6000 | 48 GB | 1 user @ 240k (Q6_K) | ~22 |
86
  | RTX PRO 6000 **Max-Q** (power-capped ~300W) | 96 GB | 1–3 users @ 240k | ~20–25 (gateway end-to-end) |
87
+ | RTX PRO 6000 **WS** (full ~600W) | 96 GB | up to 5 users @ 240k (Q8+MTP) | **~55** |
88
 
89
+ > Blackwell (PRO 6000, `sm_120`) needs CUDA toolkit **≥ 12.8**; build llama.cpp
90
+ > with `-DCMAKE_CUDA_ARCHITECTURES=120`. On Ampere (A6000) use `86`.
 
91
 
92
  ### 1) Deps + build llama.cpp
93
  ```bash
 
106
 
107
  ### 2) Download the model
108
  ```bash
109
+ # Config A — Q8 + MTP
110
+ hf download nesilabs/Nesi2 --include "Nesi2-Q8_0.gguf" "Nesi2-mtp-Q8_0.gguf" --local-dir /root/models/nesi2
111
+ # Config B — Q6_K
112
  hf download nesilabs/Nesi2 --include "Nesi2-Q6_K*.gguf" --local-dir /root/models/nesi2
113
  ```
114
 
 
116
  Never start it with `setsid`/`nohup` over SSH (they die when the pipe closes).
117
  Use **tmux** so it survives the SSH session.
118
 
119
+ #### Config A — Q8_0 + MTP, 5 users @ 240k (production, RTX PRO 6000 WS)
120
+ `--parallel N` splits `--ctx-size` across slots → `n_ctx_slot = ctx_size / parallel`.
121
+ For **5 slots of 240k each** you need `--ctx-size 1228800` (= 5 × 245760), a
122
+ **quantized KV cache** (`q8_0`), and the MTP draft:
123
  ```bash
 
124
  tmux new-session -d -s nesi2 "/root/llama.cpp/build/bin/llama-server \
125
+ --model /root/models/nesi2/Nesi2-Q8_0.gguf --alias nesi2 \
126
+ --n-gpu-layers 999 -fa on \
127
+ --cache-type-k q8_0 --cache-type-v q8_0 \
128
+ --spec-type draft-mtp --model-draft /root/models/nesi2/Nesi2-mtp-Q8_0.gguf --spec-draft-n-max 3 \
129
+ --ctx-size 1228800 --parallel 5 \
130
  --host 0.0.0.0 --port 8080 --api-key <YOUR_API_KEY> \
131
  > /root/llama.log 2>&1"
132
  ```
133
+ VRAM ≈ 84 / 96 GB. Drop `--spec-type/--model-draft` if your build lacks MTP.
134
 
135
+ #### Config B — Q6_K, single power user @ 240k
 
 
 
 
136
  ```bash
 
137
  tmux new-session -d -s nesi2 "/root/llama.cpp/build/bin/llama-server \
138
+ --model /root/models/nesi2/Nesi2-Q6_K.gguf --alias nesi2 \
139
+ --ctx-size 245760 --parallel 1 --n-gpu-layers 999 -fa on \
 
140
  --host 0.0.0.0 --port 8080 --api-key <YOUR_API_KEY> \
141
  > /root/llama.log 2>&1"
142
  ```
143
+ For **3 users @ 240k each** on a 96 GB card, use `--ctx-size 737280 --parallel 3`
144
+ plus `--cache-type-k q8_0 --cache-type-v q8_0`. If it OOMs, drop to
145
+ `q4_0` KV, lower per-user context (e.g. `--ctx-size 393216 --parallel 3` = 128k
146
+ each), or move to a 2× GPU box. Under `--parallel 3` per-stream speed drops
147
+ (~55 → ~20–30 tok/s) but aggregate throughput goes up.
148
 
149
  Wait for load (VRAM up + `server is listening`):
150
  ```bash
 
161
  # then
162
  docker compose up -d litellm
163
  ```
 
 
164
 
165
  ### 5) Verify end-to-end
166
  ```bash
 
173
 
174
  ## Lessons learned & recommendations
175
 
 
 
 
 
176
  - **`--parallel 1` is mandatory to actually get the full 240k in one slot.** The
177
  llama.cpp default (`--parallel 4`) silently gives each slot `ctx/4`.
178
  - **`-fa on` (flash-attention)** — keep it on; large context is unusable without it.
179
  - **tmux, not setsid/nohup.** Over SSH the detached process dies and you get an
180
  empty log; tmux survives.
181
+ - **Agent discipline > raw capability.** As an agent Nesi2 shines because of
182
+ *tool-calling discipline*: it acts (one concrete tool call per turn) instead of
183
+ narrating. Give it a lean system prompt that says: act don't narrate; write your
184
+ own Python for anything past a simple HTTP request (WebSocket, sockets, rotating
185
+ CSRF); get code-exec first and confirm with `id`; and **keep durable state on
186
+ disk** (a `NOTES.md` + reusable scripts) so a context compaction doesn't make it
187
+ re-derive what it already solved.
188
  - **Isolate the agent's filesystem for honest evals.** A harness whose shell can
189
  read your machine will "solve" a CTF by reading the solution/writeups off disk
190
  instead of attacking live. Deny reads outside the target (regex guard in the tool
 
192
  stays open.
193
  - **KV quantization scales users cheaply.** `--cache-type-k/v q8_0` roughly doubles
194
  how many 240k slots fit, with no quality drift we could measure; it's what makes
195
+ the multi-user profiles fit a single 96 GB card.
196
  - **Max-Q vs WS.** The power-capped Max-Q PRO 6000 is ~2.5× slower than the full WS
197
  for ~0.25 $/h less. For interactive/agent use pay for the WS; for cheap batch,
198
  Max-Q is fine.
199
+ - **Speculative decode (MTP).** The `*-mtp*.gguf` draft head is included; under
200
+ concurrency it did **not** help throughput in our tests, so we run without it for
201
+ multi-user serving and keep it available for single-stream latency.
202
 
203
  ## ⚠️ Legal Notice / Disclaimer
204
 
 
226
  Acceptable Use Policy.
227
 
228
  ## License
229
+ Released under **Apache 2.0**. Packaged and optimized by Nesilabs.