@aws/ml-container-creator 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE-THIRD-PARTY +50760 -16218
  2. package/bin/cli.js +31 -137
  3. package/package.json +7 -2
  4. package/servers/lib/catalogs/instances.json +52 -1275
  5. package/servers/lib/catalogs/models.json +0 -132
  6. package/servers/lib/catalogs/popular-diffusors.json +1 -110
  7. package/src/app.js +29 -2
  8. package/src/lib/config-manager.js +17 -0
  9. package/src/lib/generated/cli-options.js +467 -0
  10. package/src/lib/generated/validation-rules.js +202 -0
  11. package/src/lib/mcp-client.js +16 -1
  12. package/src/lib/mcp-command-handler.js +10 -2
  13. package/src/lib/prompt-runner.js +16 -2
  14. package/src/lib/train-config-parser.js +136 -0
  15. package/src/lib/train-config-persistence.js +143 -0
  16. package/src/lib/train-config-validator.js +112 -0
  17. package/src/lib/train-feedback.js +46 -0
  18. package/src/lib/train-idempotency.js +97 -0
  19. package/src/lib/train-request-builder.js +120 -0
  20. package/templates/code/serve +5 -134
  21. package/templates/code/serve.d/lmi.ejs +19 -0
  22. package/templates/code/serve.d/sglang.ejs +47 -0
  23. package/templates/code/serve.d/tensorrt-llm.ejs +53 -0
  24. package/templates/code/serve.d/vllm.ejs +48 -0
  25. package/templates/do/.train_build_request.py +141 -0
  26. package/templates/do/.train_poll_parser.py +135 -0
  27. package/templates/do/.train_status_parser.py +187 -0
  28. package/templates/do/clean +1 -1387
  29. package/templates/do/clean.d/async-inference.ejs +508 -0
  30. package/templates/do/clean.d/batch-transform.ejs +512 -0
  31. package/templates/do/clean.d/hyperpod-eks.ejs +481 -0
  32. package/templates/do/clean.d/managed-inference.ejs +1043 -0
  33. package/templates/do/deploy +1 -1766
  34. package/templates/do/deploy.d/async-inference.ejs +501 -0
  35. package/templates/do/deploy.d/batch-transform.ejs +529 -0
  36. package/templates/do/deploy.d/hyperpod-eks.ejs +339 -0
  37. package/templates/do/deploy.d/managed-inference.ejs +726 -0
  38. package/templates/do/lib/feedback.sh +41 -0
  39. package/templates/do/train +786 -0
  40. package/templates/do/training/config.yaml +140 -0
  41. package/templates/do/training/train.py +463 -0
@@ -555,98 +555,6 @@
555
555
  "text-generation"
556
556
  ]
557
557
  },
558
- "stabilityai/stable-diffusion-3.5-medium": {
559
- "family": "stable-diffusion-3",
560
- "gated": false,
561
- "tags": [
562
- "image-generation",
563
- "diffusion",
564
- "stable-diffusion"
565
- ],
566
- "architecture": "StableDiffusion3Pipeline",
567
- "profiles": {
568
- "default": {
569
- "displayName": "SD3.5 Medium",
570
- "envVars": {}
571
- }
572
- },
573
- "notes": "Stable Diffusion 3.5 medium model. Supported natively by vLLM-Omni StableDiffusion3Pipeline.",
574
- "chatTemplate": null,
575
- "frameworkCompatibility": {
576
- "vllm-omni": ">=0.14.0"
577
- },
578
- "validationLevel": "experimental",
579
- "modelType": "diffusor",
580
- "tasks": [
581
- "text-to-image"
582
- ]
583
- },
584
- "black-forest-labs/FLUX.1-dev": {
585
- "family": "flux",
586
- "gated": true,
587
- "tags": [
588
- "image-generation",
589
- "diffusion",
590
- "flux"
591
- ],
592
- "architecture": "FluxPipeline",
593
- "profiles": {
594
- "default": {
595
- "displayName": "FLUX.1 Dev",
596
- "envVars": {}
597
- }
598
- },
599
- "notes": "FLUX.1-dev high-quality generation model. Uses dual text encoders (CLIP + T5) and FlowMatchEuler scheduler. Requires significant VRAM.",
600
- "chatTemplate": null,
601
- "frameworkCompatibility": {
602
- "vllm-omni": ">=0.14.0"
603
- },
604
- "validationLevel": "experimental",
605
- "modelType": "diffusor",
606
- "tasks": [
607
- "text-to-image"
608
- ]
609
- },
610
- "black-forest-labs/FLUX.1-schnell": {
611
- "family": "flux",
612
- "gated": false,
613
- "tags": [
614
- "image-generation",
615
- "diffusion",
616
- "flux"
617
- ],
618
- "architecture": "FluxPipeline",
619
- "notes": "FLUX.1-schnell fast generation model. Fewer denoising steps for faster inference at slightly lower quality",
620
- "chatTemplate": null,
621
- "frameworkCompatibility": {
622
- "vllm-omni": ">=0.14.0"
623
- },
624
- "validationLevel": "experimental",
625
- "modelType": "diffusor",
626
- "tasks": [
627
- "text-to-image"
628
- ]
629
- },
630
- "Wan-AI/Wan2.1-T2V-14B-Diffusers": {
631
- "family": "wan",
632
- "gated": false,
633
- "tags": [
634
- "video-generation",
635
- "diffusion",
636
- "wan"
637
- ],
638
- "architecture": "WanPipeline",
639
- "notes": "Wan2.1 text-to-video 14B model (diffusers format). Requires multi-GPU instance (ml.g5.12xlarge or larger). Must use the -Diffusers variant — the base Wan2.1-T2V-14B repo lacks model_index.json required by vLLM-Omni",
640
- "chatTemplate": null,
641
- "frameworkCompatibility": {
642
- "vllm-omni": ">=0.16.0"
643
- },
644
- "validationLevel": "experimental",
645
- "modelType": "diffusor",
646
- "tasks": [
647
- "text-to-video"
648
- ]
649
- },
650
558
  "meta-llama/Llama-3*": {
651
559
  "family": "llama-3",
652
560
  "gated": true,
@@ -731,45 +639,5 @@
731
639
  "tasks": [
732
640
  "text-generation"
733
641
  ]
734
- },
735
- "stabilityai/stable-diffusion-*": {
736
- "family": "stable-diffusion",
737
- "gated": false,
738
- "tags": [
739
- "image-generation",
740
- "diffusion",
741
- "stable-diffusion"
742
- ],
743
- "architecture": null,
744
- "notes": "Fallback for Stable Diffusion variants not explicitly listed",
745
- "chatTemplate": null,
746
- "frameworkCompatibility": {
747
- "vllm-omni": ">=0.14.0"
748
- },
749
- "validationLevel": "experimental",
750
- "modelType": "diffusor",
751
- "tasks": [
752
- "text-to-image"
753
- ]
754
- },
755
- "black-forest-labs/FLUX*": {
756
- "family": "flux",
757
- "gated": false,
758
- "tags": [
759
- "image-generation",
760
- "diffusion",
761
- "flux"
762
- ],
763
- "architecture": null,
764
- "notes": "Fallback for FLUX model variants not explicitly listed",
765
- "chatTemplate": null,
766
- "frameworkCompatibility": {
767
- "vllm-omni": ">=0.14.0"
768
- },
769
- "validationLevel": "experimental",
770
- "modelType": "diffusor",
771
- "tasks": [
772
- "text-to-image"
773
- ]
774
642
  }
775
643
  }
@@ -1,110 +1 @@
1
- {
2
- "stabilityai/stable-diffusion-3.5-medium": {
3
- "family": "stable-diffusion-3",
4
- "chat_template": null,
5
- "gated": false,
6
- "tags": [
7
- "image-generation",
8
- "diffusion",
9
- "stable-diffusion"
10
- ],
11
- "architecture": "StableDiffusion3Pipeline",
12
- "framework_compatibility": {
13
- "vllm-omni": ">=0.14.0"
14
- },
15
- "validation_level": "experimental",
16
- "profiles": {
17
- "default": {
18
- "displayName": "SD3.5 Medium",
19
- "envVars": {}
20
- }
21
- },
22
- "notes": "Stable Diffusion 3.5 medium model. Supported natively by vLLM-Omni StableDiffusion3Pipeline."
23
- },
24
- "black-forest-labs/FLUX.1-dev": {
25
- "family": "flux",
26
- "chat_template": null,
27
- "gated": true,
28
- "tags": [
29
- "image-generation",
30
- "diffusion",
31
- "flux"
32
- ],
33
- "architecture": "FluxPipeline",
34
- "framework_compatibility": {
35
- "vllm-omni": ">=0.14.0"
36
- },
37
- "validation_level": "experimental",
38
- "profiles": {
39
- "default": {
40
- "displayName": "FLUX.1 Dev",
41
- "envVars": {}
42
- }
43
- },
44
- "notes": "FLUX.1-dev high-quality generation model. Uses dual text encoders (CLIP + T5) and FlowMatchEuler scheduler. Requires significant VRAM."
45
- },
46
- "black-forest-labs/FLUX.1-schnell": {
47
- "family": "flux",
48
- "chat_template": null,
49
- "gated": false,
50
- "tags": [
51
- "image-generation",
52
- "diffusion",
53
- "flux"
54
- ],
55
- "architecture": "FluxPipeline",
56
- "framework_compatibility": {
57
- "vllm-omni": ">=0.14.0"
58
- },
59
- "validation_level": "experimental",
60
- "notes": "FLUX.1-schnell fast generation model. Fewer denoising steps for faster inference at slightly lower quality"
61
- },
62
- "Wan-AI/Wan2.1-T2V-14B-Diffusers": {
63
- "family": "wan",
64
- "chat_template": null,
65
- "gated": false,
66
- "tags": [
67
- "video-generation",
68
- "diffusion",
69
- "wan"
70
- ],
71
- "architecture": "WanPipeline",
72
- "framework_compatibility": {
73
- "vllm-omni": ">=0.16.0"
74
- },
75
- "validation_level": "experimental",
76
- "notes": "Wan2.1 text-to-video 14B model (diffusers format). Requires multi-GPU instance (ml.g5.12xlarge or larger). Must use the -Diffusers variant — the base Wan2.1-T2V-14B repo lacks model_index.json required by vLLM-Omni"
77
- },
78
- "stabilityai/stable-diffusion-*": {
79
- "family": "stable-diffusion",
80
- "chat_template": null,
81
- "gated": false,
82
- "tags": [
83
- "image-generation",
84
- "diffusion",
85
- "stable-diffusion"
86
- ],
87
- "architecture": null,
88
- "framework_compatibility": {
89
- "vllm-omni": ">=0.14.0"
90
- },
91
- "validation_level": "experimental",
92
- "notes": "Fallback for Stable Diffusion variants not explicitly listed"
93
- },
94
- "black-forest-labs/FLUX*": {
95
- "family": "flux",
96
- "chat_template": null,
97
- "gated": false,
98
- "tags": [
99
- "image-generation",
100
- "diffusion",
101
- "flux"
102
- ],
103
- "architecture": null,
104
- "framework_compatibility": {
105
- "vllm-omni": ">=0.14.0"
106
- },
107
- "validation_level": "experimental",
108
- "notes": "Fallback for FLUX model variants not explicitly listed"
109
- }
110
- }
1
+ {}
package/src/app.js CHANGED
@@ -296,6 +296,11 @@ export async function writeProject(templateDir, destDir, answers, registryConfig
296
296
  // Build ignore patterns
297
297
  const ignorePatterns = [];
298
298
 
299
+ // EJS partials — included by templates at render time, not copied to output
300
+ ignorePatterns.push('**/serve.d/**');
301
+ ignorePatterns.push('**/deploy.d/**');
302
+ ignorePatterns.push('**/clean.d/**');
303
+
299
304
  if (answers.deploymentTarget !== 'hyperpod-eks') {
300
305
  ignorePatterns.push('**/hyperpod/**');
301
306
  }
@@ -349,11 +354,27 @@ export async function writeProject(templateDir, destDir, answers, registryConfig
349
354
  }
350
355
 
351
356
  // Exclude tune files when framework is NOT transformers OR deploymentTarget is batch-transform
352
- if (architecture !== 'transformers' || answers.deploymentTarget === 'batch-transform') {
357
+ const tuneIncluded = architecture === 'transformers' && answers.deploymentTarget !== 'batch-transform';
358
+ if (!tuneIncluded) {
353
359
  ignorePatterns.push('**/do/tune');
354
360
  ignorePatterns.push('**/do/.tune_helper.py');
355
361
  }
356
362
 
363
+ // Exclude train files when deploymentTarget is batch-transform
364
+ const trainIncluded = answers.deploymentTarget !== 'batch-transform';
365
+ if (!trainIncluded) {
366
+ ignorePatterns.push('**/do/train');
367
+ ignorePatterns.push('**/do/.train_build_request.py');
368
+ ignorePatterns.push('**/do/.train_status_parser.py');
369
+ ignorePatterns.push('**/do/.train_poll_parser.py');
370
+ ignorePatterns.push('**/do/training/**');
371
+ }
372
+
373
+ // Exclude feedback.sh when neither tune nor train is included
374
+ if (!tuneIncluded && !trainIncluded) {
375
+ ignorePatterns.push('**/do/lib/feedback.sh');
376
+ }
377
+
357
378
  // Exclude do/test when hosted-model-endpoint is not selected
358
379
  const testTypes = answers.testTypes || [];
359
380
  if (!testTypes.includes('hosted-model-endpoint')) {
@@ -371,6 +392,11 @@ export async function writeProject(templateDir, destDir, answers, registryConfig
371
392
  ignorePatterns.push('**/do/adapters/**');
372
393
  ignorePatterns.push('**/do/tune');
373
394
  ignorePatterns.push('**/do/.tune_helper.py');
395
+ ignorePatterns.push('**/do/train');
396
+ ignorePatterns.push('**/do/.train_build_request.py');
397
+ ignorePatterns.push('**/do/.train_status_parser.py');
398
+ ignorePatterns.push('**/do/.train_poll_parser.py');
399
+ ignorePatterns.push('**/do/training/**');
374
400
  ignorePatterns.push('**/do/add-ic');
375
401
  ignorePatterns.push('**/do/run');
376
402
  ignorePatterns.push('**/sample_model/**');
@@ -1177,7 +1203,8 @@ function _setExecutablePermissions(destDir, answers = {}) {
1177
1203
  'do/status',
1178
1204
  'do/add-ic',
1179
1205
  'do/adapter',
1180
- 'do/tune'
1206
+ 'do/tune',
1207
+ 'do/train'
1181
1208
  ];
1182
1209
 
1183
1210
  const shellScripts = architecture === 'marketplace' ? marketplaceScripts : defaultScripts;
@@ -26,6 +26,7 @@ import DeploymentConfigResolver from './deployment-config-resolver.js';
26
26
  import BootstrapConfig from './bootstrap-config.js';
27
27
  import { parseKeyValue } from './key-value-parser.js';
28
28
  import ParameterSchemaValidator from './parameter-schema-validator.js';
29
+ import { validationRules } from './generated/validation-rules.js';
29
30
 
30
31
  const __configMgrFilename = fileURLToPath(import.meta.url);
31
32
  const __configMgrDir = dirname(__configMgrFilename);
@@ -2261,6 +2262,22 @@ export default class ConfigManager {
2261
2262
  * @private
2262
2263
  */
2263
2264
  _validateParameterValue(parameter, value, context = {}) {
2265
+ // First pass: schema-derived validation rules (type, range, pattern, enum)
2266
+ // Skip deprecated params — they have relaxed validation handled by the switch below
2267
+ const schemaRule = validationRules[parameter];
2268
+ if (schemaRule && value !== null && value !== undefined) {
2269
+ // Don't apply strict enum validation to internally-derived values
2270
+ // The switch statement below handles context-dependent validation
2271
+ const skipSchemaValidation = ['framework', 'modelServer', 'deploymentConfig'].includes(parameter);
2272
+ if (!skipSchemaValidation) {
2273
+ const error = schemaRule(value);
2274
+ if (error) {
2275
+ throw new ValidationError(error, parameter, value);
2276
+ }
2277
+ }
2278
+ }
2279
+
2280
+ // Second pass: context-dependent validations that require runtime state
2264
2281
  const supportedOptions = this._getSupportedOptions();
2265
2282
 
2266
2283
  switch (parameter) {