Commit 8a7fc3c
committed
fix(presets): enforce that the served repo is a variant of the requested base
A preset declaring `base: X` was verified against two things that a
substitution preserves: that the service advertises the requested name,
and that the report echoes the requested base. Neither looks at the repo
the agent actually served.
So `vllm serve Qwen/Qwen3.5-27B-GPTQ-Int4 --served-model-name
Qwen/Qwen3.8-27B` answered a request for Qwen3.8 with a different model
generation, verified clean, and was reported successful.
`base` is documented as "the base model for which the agent may select a
compatible variant", so verification now checks compatibility: the
served repo must be the base, or the base plus a suffix at a separator
boundary. A different generation is not a variant however similar the
name.
The comparison is on the model name alone, ignoring the owner. A
quantisation is routinely published by someone other than the model's
author -- this repository's own fixtures pair a Qwen/Qwen3.5-27B base
with a community/Qwen3.5-27B-GPTQ-Int4 repo -- so comparing owners would
reject the ordinary case and cost `base` the freedom it exists to grant.
It is also case-insensitive, since repo references are.
Eight tests: four substitutions that must be rejected, including the
reported one and a name that merely starts the same, and four genuine
variants that must still pass, including the third-party quantisation
and a lowercased reference.1 parent e828c9e commit 8a7fc3c
2 files changed
Lines changed: 119 additions & 0 deletions
File tree
- src
- dstack/_internal/cli/services/presets
- tests/_internal/cli/services/presets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
138 | 178 | | |
139 | 179 | | |
140 | 180 | | |
| |||
145 | 185 | | |
146 | 186 | | |
147 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
148 | 199 | | |
149 | 200 | | |
150 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
307 | 375 | | |
308 | 376 | | |
309 | 377 | | |
| |||
0 commit comments