{"record":{"id":"4fc19e721739cbbb","repo":"can1357/oh-my-pi","slug":"unknown-tiny-local-model-model-expected-one-o","errorCode":null,"errorMessage":"Unknown tiny local model: ${model}. Expected one of: ${values}, all","messagePattern":"Unknown tiny local model: (.+?)\\. Expected one of: (.+?), all","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/tiny-models-cli.ts","lineNumber":63,"sourceCode":"\t\t\t.filter(line => line.length > 0) ?? [];\n\tconst first = lines[0];\n\tif (!first) return undefined;\n\tconst details = lines.slice(1).filter(line => ACTIONABLE_DOWNLOAD_ERROR_LINE.test(line));\n\tif (details.length === 0) return first;\n\treturn [first, ...details].join(\"\\n\");\n}\n\nexport function resolveModels(model: string | undefined): TinyLocalModelKey[] {\n\tif (!model) return [DEFAULT_TINY_TITLE_LOCAL_MODEL_KEY];\n\t// `all` is a prefetch convenience: skip models that fail before load (unsupported\n\t// runtime), so the bulk download stays green when every *usable* model succeeds.\n\tif (model === \"all\")\n\t\treturn TINY_LOCAL_MODELS.filter(spec => !(\"unsupportedReason\" in spec) || !spec.unsupportedReason).map(\n\t\t\tspec => spec.key,\n\t\t);\n\tif (!isTinyLocalModelKey(model)) {\n\t\tconst values = TINY_LOCAL_MODELS.map(spec => spec.key).join(\", \");\n\t\tthrow new Error(`Unknown tiny local model: ${model}. Expected one of: ${values}, all`);\n\t}\n\treturn [model];\n}\n\nfunction listModels(json: boolean | undefined): void {\n\tif (json) {\n\t\twriteLine(JSON.stringify({ models: TINY_LOCAL_MODELS }));\n\t\treturn;\n\t}\n\twriteLine(chalk.bold(\"Tiny local models\"));\n\tfor (const spec of TINY_LOCAL_MODELS) {\n\t\tconst defaultMark = spec.key === DEFAULT_TINY_TITLE_LOCAL_MODEL_KEY ? chalk.cyan(\" default\") : \"\";\n\t\twriteLine(`${chalk.cyan(spec.key)}${defaultMark}`);\n\t\twriteLine(`  ${spec.label} — ${spec.description}`);\n\t}\n}\n\nfunction makeProgressReporter(modelKey: TinyLocalModelKey, json: boolean | undefined): ProgressReporter {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/tiny-models-cli.ts#L45-L81","documentation":"`resolveModels` in the tiny-models CLI maps a model name argument to concrete tiny local model keys. `\"all\"` expands to every supported key; anything not in `TINY_LOCAL_MODELS` (checked by `isTinyLocalModelKey`) throws with the accepted values listed. It fails fast on invalid CLI input before any model is loaded.","triggerScenarios":"Running a tiny-models command with a model name that isn't one of the known keys or `all` — e.g. `omp tiny-models bench gpt2` when only specific tiny keys are supported.","commonSituations":"Guessing model names instead of running the list command; using upstream model ids not aliased locally; copy-pasting keys from a different tool version where the roster changed.","solutions":["Run the list command (e.g. `omp tiny-models list` or with `--json`) to see valid keys","Use the exact key from TINY_LOCAL_MODELS or `all`","Update the CLI if the model you want was added in a newer version","Add/extend the model spec in TINY_LOCAL_MODELS if you maintain the roster"],"exampleFix":"// before\nomp tiny-models bench llama3\n// after\nomp tiny-models list            # discover valid keys\nomp tiny-models bench <valid-key>   # or: all","handlingStrategy":"validation","validationCode":"import { TINY_LOCAL_MODELS } from \"./tiny-models\";\nconst valid = new Set([...TINY_LOCAL_MODELS.map(s => s.key), \"all\"]);\nif (!valid.has(modelArg)) {\n  console.error(`Unknown tiny local model: ${modelArg}. Expected one of: ${[...valid].join(\", \")}`);\n  process.exit(1);\n}","typeGuard":"function isTinyLocalModelKey(v: string): v is TinyLocalModelKey {\n  return TINY_LOCAL_MODELS.some(spec => spec.key === v);\n}","tryCatchPattern":"try {\n  const models = resolveModels(arg);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unknown tiny local model\")) {\n    console.error(`${err.message}\\nRun the list command to see supported models.`);\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["List available models before invoking bench/run commands","Use `all` when you want every supported tiny model","Keep CLI version in sync with documentation — model keys change between releases"],"tags":["cli","validation","models"],"backgroundTag":"invalid-model-name","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}