@aws/ml-container-creator 0.5.0 → 0.6.0

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.
@@ -199,6 +199,9 @@ export default class BootstrapCommandHandler {
199
199
  if (stackOutputs.BatchS3BucketName) {
200
200
  profileData.batchS3Bucket = stackOutputs.BatchS3BucketName;
201
201
  }
202
+ if (stackOutputs.AdapterS3BucketName) {
203
+ profileData.adapterS3Bucket = stackOutputs.AdapterS3BucketName;
204
+ }
202
205
  if (stackOutputs.BenchmarkS3BucketName) {
203
206
  profileData.benchmarkS3Bucket = stackOutputs.BenchmarkS3BucketName;
204
207
  }
@@ -390,6 +393,9 @@ export default class BootstrapCommandHandler {
390
393
  if (outputs.BatchS3BucketName) {
391
394
  console.log(` ✅ S3 bucket (batch): ${outputs.BatchS3BucketName}`);
392
395
  }
396
+ if (outputs.AdapterS3BucketName) {
397
+ console.log(` ✅ S3 bucket (adapters): ${outputs.AdapterS3BucketName}`);
398
+ }
393
399
  if (outputs.BenchmarkS3BucketName) {
394
400
  console.log(` ✅ S3 bucket (benchmark): ${outputs.BenchmarkS3BucketName}`);
395
401
  }
@@ -204,7 +204,7 @@ VALIDATION OPTIONS:
204
204
 
205
205
  MCP OPTIONS:
206
206
  --smart Enable Bedrock-powered smart mode on all MCP servers
207
- --discover Enable live registry lookups (e.g. Docker Hub) on MCP servers that support it
207
+ --no-discover Disable live registry lookups (HuggingFace API, quota checks) catalog-only mode
208
208
 
209
209
  REGISTRY SYSTEM:
210
210
  The generator includes built-in registries for frameworks, models, and instance types:
@@ -1631,7 +1631,7 @@ export default class ConfigManager {
1631
1631
  if (!mcpServerConfigs || !mcpServerConfigs[serverName]) return null;
1632
1632
 
1633
1633
  const smart = this.options.smart === true;
1634
- const discover = this.options.discover === true;
1634
+ const discover = this.options.discover !== false;
1635
1635
  const serverConfig = mcpServerConfigs[serverName];
1636
1636
 
1637
1637
  // Build a custom McpClient that passes context through
@@ -32,7 +32,7 @@ class McpClient {
32
32
  this.timeout = options.timeout || DEFAULT_TIMEOUT;
33
33
  this.parameterMatrix = options.parameterMatrix || {};
34
34
  this.smart = options.smart || false;
35
- this.discover = options.discover || false;
35
+ this.discover = options.discover !== undefined ? options.discover : true;
36
36
  this._transport = null;
37
37
  this._client = null;
38
38
  this._diagnosticMessage = null;
@@ -98,10 +98,10 @@ class McpClient {
98
98
 
99
99
  // Build environment: merge process.env with server-specific env
100
100
  // When --smart flag is active, inject BEDROCK_SMART=true for this run
101
- // When --discover flag is active, inject MCP_DISCOVER=true for this run
101
+ // Discover mode is now default; inject DISCOVER_MODE=false only when explicitly disabled
102
102
  // Always pass process.env so child processes inherit AWS credentials, profiles, etc.
103
103
  const smartEnv = this.smart ? { BEDROCK_SMART: 'true' } : {};
104
- const discoverEnv = this.discover ? { MCP_DISCOVER: 'true' } : {};
104
+ const discoverEnv = this.discover === false ? { DISCOVER_MODE: 'false' } : {};
105
105
  const serverEnv = env && Object.keys(env).length > 0 ? env : {};
106
106
  const spawnEnv = { ...process.env, ...smartEnv, ...discoverEnv, ...serverEnv };
107
107
 
@@ -1098,9 +1098,9 @@ export default class PromptRunner {
1098
1098
  if (!modelName || modelName === 'Custom (enter manually)') return;
1099
1099
 
1100
1100
  const smart = this.options.smart === true;
1101
- const discover = this.options.discover === true;
1101
+ const discover = this.options.discover !== false;
1102
1102
 
1103
- const modeLabel = [smart && '[smart]', discover && '[discover]'].filter(Boolean).join(' ');
1103
+ const modeLabel = [smart && '[smart]', !discover && '[no-discover]'].filter(Boolean).join(' ');
1104
1104
  console.log(` 🔍 Querying instance-sizer${modeLabel ? ` ${modeLabel}` : ''}...`);
1105
1105
 
1106
1106
  try {
@@ -1115,8 +1115,8 @@ export default class PromptRunner {
1115
1115
  const { StdioClientTransport } = await import('@modelcontextprotocol/sdk/client/stdio.js');
1116
1116
 
1117
1117
  const serverArgs = [...(serverConfig.args || [])];
1118
- if (discover && !serverArgs.includes('--discover')) {
1119
- serverArgs.push('--discover');
1118
+ if (!discover && !serverArgs.includes('--no-discover')) {
1119
+ serverArgs.push('--no-discover');
1120
1120
  }
1121
1121
 
1122
1122
  const transport = new StdioClientTransport({
@@ -1375,7 +1375,7 @@ export default class PromptRunner {
1375
1375
  if (!mcpServers.includes('base-image-picker')) return;
1376
1376
 
1377
1377
  const smart = this.options.smart === true;
1378
- const discover = this.options.discover === true;
1378
+ const discover = this.options.discover !== false;
1379
1379
  const framework = frameworkAnswers.framework;
1380
1380
  const modelServer = frameworkAnswers.modelServer;
1381
1381
  const architecture = frameworkAnswers.architecture || frameworkAnswers.deploymentConfig?.split('-')[0];
@@ -399,9 +399,33 @@ const modelFormatPrompts = [
399
399
  ];
400
400
  }
401
401
  return [
402
- 'openai/gpt-oss-20b',
403
- 'meta-llama/Llama-3.2-3B-Instruct',
402
+ { type: 'separator', separator: '── Meta Llama ──' },
404
403
  'meta-llama/Llama-3.2-1B-Instruct',
404
+ 'meta-llama/Llama-3.2-3B-Instruct',
405
+ 'meta-llama/Llama-3.1-8B-Instruct',
406
+ 'meta-llama/Llama-3.3-70B-Instruct',
407
+ { type: 'separator', separator: '── Qwen (Alibaba) ──' },
408
+ 'Qwen/Qwen3-0.6B',
409
+ 'Qwen/Qwen3-1.7B',
410
+ 'Qwen/Qwen3-4B',
411
+ 'Qwen/Qwen3-8B',
412
+ 'Qwen/Qwen3-14B',
413
+ 'Qwen/Qwen3-32B',
414
+ 'Qwen/Qwen2.5-7B-Instruct',
415
+ 'Qwen/Qwen2.5-14B-Instruct',
416
+ 'Qwen/Qwen2.5-32B-Instruct',
417
+ 'Qwen/Qwen2.5-72B-Instruct',
418
+ { type: 'separator', separator: '── DeepSeek ──' },
419
+ 'deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B',
420
+ 'deepseek-ai/DeepSeek-R1-Distill-Qwen-7B',
421
+ 'deepseek-ai/DeepSeek-R1-Distill-Qwen-14B',
422
+ 'deepseek-ai/DeepSeek-R1-Distill-Qwen-32B',
423
+ 'deepseek-ai/DeepSeek-R1-Distill-Llama-8B',
424
+ 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B',
425
+ { type: 'separator', separator: '── OpenAI ──' },
426
+ 'openai/gpt-oss-20b',
427
+ 'openai/gpt-oss-120b',
428
+ { type: 'separator', separator: '──────────────' },
405
429
  'Custom (enter manually)'
406
430
  ];
407
431
  },
@@ -413,7 +437,7 @@ const modelFormatPrompts = [
413
437
  if (architecture === 'diffusors') {
414
438
  return 'stabilityai/stable-diffusion-3.5-medium';
415
439
  }
416
- return 'openai/gpt-oss-20b';
440
+ return 'meta-llama/Llama-3.1-8B-Instruct';
417
441
  },
418
442
  when: answers => {
419
443
  const architecture = answers.architecture || answers.deploymentConfig?.split('-')[0];
@@ -528,9 +552,11 @@ const modelProfilePrompts = [
528
552
  */
529
553
  // eslint-disable-next-line no-unused-vars -- reference list for future use
530
554
  const EXAMPLE_MODEL_IDS = [
531
- 'openai/gpt-oss-20b',
555
+ 'meta-llama/Llama-3.1-8B-Instruct',
532
556
  'meta-llama/Llama-3.2-3B-Instruct',
533
- 'meta-llama/Llama-3.2-1B-Instruct'
557
+ 'Qwen/Qwen3-8B',
558
+ 'deepseek-ai/DeepSeek-R1-Distill-Qwen-7B',
559
+ 'openai/gpt-oss-20b'
534
560
  ];
535
561
 
536
562
  const hfTokenPrompts = [
@@ -162,8 +162,8 @@ _download_from_hub() {
162
162
 
163
163
  # ── Resolve S3 bucket ─────────────────────────────────────────────────
164
164
  local s3_bucket=""
165
- if [ -n "${ASYNC_S3_BUCKET:-}" ]; then
166
- s3_bucket="${ASYNC_S3_BUCKET}"
165
+ if [ -n "${ADAPTER_S3_BUCKET:-}" ]; then
166
+ s3_bucket="${ADAPTER_S3_BUCKET}"
167
167
  else
168
168
  local account_id
169
169
  account_id=$(aws sts get-caller-identity --query Account --output text 2>/dev/null || echo "")
@@ -172,14 +172,30 @@ _download_from_hub() {
172
172
  echo " Ensure AWS credentials are configured."
173
173
  exit 1
174
174
  fi
175
- s3_bucket="ml-container-creator-${account_id}-${AWS_REGION}"
175
+ s3_bucket="mlcc-adapters-${account_id}-${AWS_REGION}"
176
176
  fi
177
177
 
178
178
  # ── Create temp directory ─────────────────────────────────────────────
179
179
  mkdir -p "${tmp_dir}/adapter_files"
180
180
 
181
181
  # ── Download adapter files ────────────────────────────────────────────
182
- if command -v huggingface-cli &>/dev/null; then
182
+ if command -v hf &>/dev/null; then
183
+ echo " Using hf CLI to download..."
184
+ local hf_args=("download" "${hf_repo_id}" "--local-dir" "${tmp_dir}/adapter_files")
185
+ if [ -n "${HF_TOKEN:-}" ]; then
186
+ hf_args+=("--token" "${HF_TOKEN}")
187
+ fi
188
+ if ! hf "${hf_args[@]}" 2>/dev/null; then
189
+ echo "❌ Failed to download adapter from HuggingFace Hub: ${hf_repo_id}"
190
+ echo ""
191
+ echo " Check that:"
192
+ echo " • The repository exists: https://huggingface.co/${hf_repo_id}"
193
+ echo " • For gated repos, set HF_TOKEN environment variable"
194
+ echo " • You have network connectivity to huggingface.co"
195
+ rm -rf "${tmp_dir}"
196
+ exit 1
197
+ fi
198
+ elif command -v huggingface-cli &>/dev/null; then
183
199
  echo " Using huggingface-cli to download..."
184
200
  local hf_args=("download" "${hf_repo_id}" "--local-dir" "${tmp_dir}/adapter_files")
185
201
  if [ -n "${HF_TOKEN:-}" ]; then
@@ -693,7 +709,7 @@ _adapter_list() {
693
709
 
694
710
  # ── Print table ───────────────────────────────────────────────────────
695
711
  printf '%-14s%-12s%s\n' "NAME" "STATUS" "WEIGHTS"
696
- echo -e "${output_lines}" | head -n -1
712
+ echo -e "${output_lines}" | sed '$ { /^$/d; }'
697
713
  }
698
714
 
699
715
  _adapter_remove() {
@@ -13,6 +13,7 @@ export MODEL_SERVER="<%= modelServer %>"
13
13
  <% if (typeof enableLora !== 'undefined' && enableLora) { %>
14
14
  # LoRA adapter serving
15
15
  export ENABLE_LORA=true
16
+ export ADAPTER_S3_BUCKET="mlcc-adapters-$(aws sts get-caller-identity --query Account --output text 2>/dev/null || echo 'UNKNOWN')-${AWS_REGION}"
16
17
  <% } %>
17
18
 
18
19
  # AWS configuration
@@ -67,7 +68,7 @@ ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text 2>/dev/nu
67
68
  <% if (asyncS3OutputPath) { %>
68
69
  export ASYNC_S3_OUTPUT_PATH="<%= asyncS3OutputPath %>"
69
70
  <% } else { %>
70
- export ASYNC_S3_OUTPUT_PATH="s3://ml-container-creator-async-${AWS_REGION}-${ACCOUNT_ID}/${PROJECT_NAME}/output/"
71
+ export ASYNC_S3_OUTPUT_PATH="s3://mlcc-async-${ACCOUNT_ID}-${AWS_REGION}/${PROJECT_NAME}/output/"
71
72
  <% } %>
72
73
 
73
74
  <% if (asyncSnsSuccessTopic) { %>
@@ -107,12 +108,12 @@ ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text 2>/dev/nu
107
108
  <% if (batchInputPath) { %>
108
109
  export BATCH_INPUT_PATH="<%= batchInputPath %>"
109
110
  <% } else { %>
110
- export BATCH_INPUT_PATH="s3://ml-container-creator-batch-${AWS_REGION}-${ACCOUNT_ID}/${PROJECT_NAME}/input/"
111
+ export BATCH_INPUT_PATH="s3://mlcc-batch-${ACCOUNT_ID}-${AWS_REGION}/${PROJECT_NAME}/input/"
111
112
  <% } %>
112
113
  <% if (batchOutputPath) { %>
113
114
  export BATCH_OUTPUT_PATH="<%= batchOutputPath %>"
114
115
  <% } else { %>
115
- export BATCH_OUTPUT_PATH="s3://ml-container-creator-batch-${AWS_REGION}-${ACCOUNT_ID}/${PROJECT_NAME}/output/"
116
+ export BATCH_OUTPUT_PATH="s3://mlcc-batch-${ACCOUNT_ID}-${AWS_REGION}/${PROJECT_NAME}/output/"
116
117
  <% } %>
117
118
  export BATCH_INSTANCE_COUNT="<%= batchInstanceCount %>"
118
119
  export BATCH_SPLIT_TYPE="<%= batchSplitType %>"
@@ -223,7 +224,7 @@ export BENCHMARK_REQUEST_COUNT=""
223
224
  <% if (benchmarkS3OutputPath) { %>
224
225
  export BENCHMARK_S3_OUTPUT_PATH="<%= benchmarkS3OutputPath %>"
225
226
  <% } else { %>
226
- export BENCHMARK_S3_OUTPUT_PATH="s3://ml-container-creator-benchmark-${AWS_REGION}-$(aws sts get-caller-identity --query Account --output text)/${PROJECT_NAME}/"
227
+ export BENCHMARK_S3_OUTPUT_PATH="s3://mlcc-benchmark-$(aws sts get-caller-identity --query Account --output text)-${AWS_REGION}/${PROJECT_NAME}/"
227
228
  <% } %>
228
229
  export BENCHMARK_JOB_NAME=""
229
230
  export BENCHMARK_WORKLOAD_CONFIG_NAME=""