Commit cdda8d8
feat: support multiple model names in --served_model_name
Allow specifying multiple served model names so that requests using any
alias are accepted and the /v1/models endpoint returns all names.
Changes:
- serve.py: --served_model_name is now multiple=True (specify flag
multiple times); launch_server/launch_grpc_server accept Sequence[str];
passes list to OpenAIServer
- openai_server.py: __init__ accepts Union[str, Sequence[str]]; stores
self.model (primary) and self.served_model_names (all aliases);
get_model() returns a ModelCard for each name; added
_resolve_model_name() to echo back the client-requested name in
responses if it matches a known alias
Usage:
trtllm-serve model --served_model_name my-model --served_model_name alias1
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent 7ee9e8b commit cdda8d8
2 files changed
+43
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
| |||
303 | 306 | | |
304 | 307 | | |
305 | 308 | | |
306 | | - | |
| 309 | + | |
307 | 310 | | |
308 | 311 | | |
309 | 312 | | |
| |||
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
324 | | - | |
| 327 | + | |
325 | 328 | | |
326 | 329 | | |
327 | 330 | | |
| |||
350 | 353 | | |
351 | 354 | | |
352 | 355 | | |
353 | | - | |
| 356 | + | |
| 357 | + | |
354 | 358 | | |
355 | 359 | | |
356 | 360 | | |
| |||
766 | 770 | | |
767 | 771 | | |
768 | 772 | | |
| 773 | + | |
769 | 774 | | |
770 | 775 | | |
771 | | - | |
772 | | - | |
773 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
774 | 779 | | |
775 | 780 | | |
776 | 781 | | |
| |||
794 | 799 | | |
795 | 800 | | |
796 | 801 | | |
797 | | - | |
| 802 | + | |
798 | 803 | | |
799 | 804 | | |
800 | 805 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
200 | 201 | | |
201 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
202 | 211 | | |
203 | 212 | | |
204 | 213 | | |
| |||
607 | 616 | | |
608 | 617 | | |
609 | 618 | | |
610 | | - | |
| 619 | + | |
611 | 620 | | |
612 | 621 | | |
613 | 622 | | |
| |||
644 | 653 | | |
645 | 654 | | |
646 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
647 | 662 | | |
648 | | - | |
| 663 | + | |
649 | 664 | | |
650 | 665 | | |
651 | 666 | | |
| |||
1062 | 1077 | | |
1063 | 1078 | | |
1064 | 1079 | | |
1065 | | - | |
| 1080 | + | |
1066 | 1081 | | |
1067 | 1082 | | |
1068 | 1083 | | |
| |||
1173 | 1188 | | |
1174 | 1189 | | |
1175 | 1190 | | |
1176 | | - | |
| 1191 | + | |
1177 | 1192 | | |
1178 | 1193 | | |
1179 | 1194 | | |
| |||
1447 | 1462 | | |
1448 | 1463 | | |
1449 | 1464 | | |
1450 | | - | |
| 1465 | + | |
1451 | 1466 | | |
1452 | 1467 | | |
1453 | 1468 | | |
| |||
1516 | 1531 | | |
1517 | 1532 | | |
1518 | 1533 | | |
1519 | | - | |
| 1534 | + | |
1520 | 1535 | | |
1521 | 1536 | | |
1522 | 1537 | | |
| |||
1525 | 1540 | | |
1526 | 1541 | | |
1527 | 1542 | | |
1528 | | - | |
| 1543 | + | |
1529 | 1544 | | |
1530 | 1545 | | |
1531 | 1546 | | |
| |||
0 commit comments