|
| 1 | +--- |
| 2 | +name: jetson-model-catalog-inference |
| 3 | +description: Edit Jetson AI Lab model catalog Markdown so the Run on Jetson UI, serve matrix, and one-shot sections render correctly from frontmatter. Use when adding or editing model pages, inference engines, serve/run commands, or one-shot inference blocks. |
| 4 | +license: Apache-2.0 |
| 5 | +compatibility: Requires Node.js and npm for build verification of model schema changes. |
| 6 | +--- |
| 7 | + |
| 8 | +# Jetson AI Lab: model catalog and inference frontmatter |
| 9 | + |
| 10 | +## Reality check |
| 11 | + |
| 12 | +- **Jetson AI Lab** is a **static Astro site**. It does **not** host inference APIs. Users copy commands from the site and run them on a Jetson (or other machine). |
| 13 | +- Model pages are **Markdown files** in the Astro content collection **`models`**: path pattern `src/content/models/<slug>.md`. |
| 14 | +- The file **`slug`** (filename without `.md`) becomes the URL segment: published route **`/models/<slug>`** (see page wiring in `src/pages/models/[slug].astro`). |
| 15 | +- Commands shown in **Serve the model**, **Call the model**, and **one-shot** modals come **only** from that fileΓÇÖs YAML frontmatter (and from shared layout/components that read it). |
| 16 | + |
| 17 | +Do **not** invent a base URL for ΓÇ£the Jetson AI Lab inference APIΓÇ¥ΓÇöthere isnΓÇÖt one. |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Minimal anatomy |
| 22 | + |
| 23 | +1. **File location:** `src/content/models/<slug>.md` (e.g. `qwen3-vl-8b.md` → `/models/qwen3-vl-8b`). |
| 24 | +2. **Frontmatter** must satisfy **`modelsSchema`** in `src/content/config.ts` (required fields include `title`, `short_description`, `vision_capable`, `memory_requirements`, `precision`, `model_size`, etc.). |
| 25 | +3. **`vision_capable`** (boolean, **required**): drives the hero line ΓÇ£Vision (VLM)ΓÇ¥ Yes/No on the model page (`src/pages/models/[slug].astro`). Set `true` for VLMs / models that accept image or video inputs; `false` for text-only catalog entries. |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## Frontmatter tag reference |
| 30 | + |
| 31 | +Every model page is driven by its YAML frontmatter. The table below lists every recognized tag, whether it is required, and what it controls. |
| 32 | + |
| 33 | +### Always-include tags |
| 34 | + |
| 35 | +These tags are either schema-required (build fails without them) or used by **every model in the repo** (schema-optional but expected in practice). Include all of them when adding a new model. |
| 36 | + |
| 37 | +| Tag | Schema | What it does | |
| 38 | +|-----|--------|--------------| |
| 39 | +| `title` | **required** | Display name on the model page and catalog cards. | |
| 40 | +| `short_description` | **required** | One-line summary shown in the catalog grid. | |
| 41 | +| `vision_capable` | **required** | `true` for VLMs (image/video input); `false` for text-only. Drives the "Vision (VLM)" badge. | |
| 42 | +| `memory_requirements` | **required** | e.g. `"16GB RAM"`. Shown in the specs sidebar. | |
| 43 | +| `precision` | **required** | e.g. `"W4A16"`, `"Q4_K_M GGUF"`. Quantization / precision label. | |
| 44 | +| `model_size` | **required** | e.g. `"12GB"`. Download / disk size shown in specs. | |
| 45 | +| `model_id` | optional | Explicit model identifier (usually matches the filename slug). Used by 100% of models. | |
| 46 | +| `family` | optional | Groups related models in the catalog (e.g. `"OpenAI GPT OSS"`). Used by 100% of models. | |
| 47 | +| `icon` | optional | Emoji shown on catalog cards. Used by 100% of models. | |
| 48 | +| `is_new` | optional | Adds a "New" badge to catalog cards. Used by 100% of models (set `false` once the model is no longer new). | |
| 49 | +| `order` | optional | Controls sort position inside the catalog grid. Used by 100% of models. | |
| 50 | +| `type` | optional | Category label (e.g. `"Text"`, `"Multimodal"`). Used by 100% of models. | |
| 51 | +| `hf_checkpoint` | optional | HuggingFace model id used in commands (e.g. `"openai/gpt-oss-20b"`). Used by 100% of models. | |
| 52 | +| `huggingface_url` | optional | Link to the HuggingFace model card. Used by 100% of models. | |
| 53 | +| `minimum_jetson` | optional | Smallest Jetson that can run the model (e.g. `"AGX Orin"`, `"Orin Nano"`). Used by 100% of models. | |
| 54 | + |
| 55 | +### Situational tags |
| 56 | + |
| 57 | +Only add these when the model needs them. Most models do not. |
| 58 | + |
| 59 | +| Tag | When to use | Repo usage | |
| 60 | +|-----|-------------|:----------:| |
| 61 | +| `build_nvidia_url` | Model has an NVIDIA Build page. | ~67% of models | |
| 62 | +| `matrix_modules_disabled` | Some matrix module tabs should be grayed out for this model. | ~10% of models | |
| 63 | +| `hide_run_button` | Hide the entire Run/Serve UI even though engine data exists (e.g. model not yet launchable). | ~5% of models | |
| 64 | + |
| 65 | +### Inference blocks (at least one required unless `hide_run_button: true`) |
| 66 | + |
| 67 | +| Block | Purpose | |
| 68 | +|-------|---------| |
| 69 | +| `supported_inference_engines` | Legacy engine array ΓÇö still works, used by most existing models. | |
| 70 | +| `serving.entries` | New-style engine list ΓÇö preferred for new models, overrides the legacy array. | |
| 71 | +| `one_shot_inference` | One-shot run commands (shell, python, per-module variants). | |
| 72 | +| `client_call` | Curl / Python snippet for calling a served model (shown in "Call the model"). | |
| 73 | +| `benchmark` | Per-platform performance numbers (orin / thor: concurrency1, concurrency8, ttftMs). | |
| 74 | + |
| 75 | + |
| 76 | +## Inference data: serve matrix (engines) |
| 77 | + |
| 78 | +The UI builds the engine list with **`getSupportedInferenceEngines`** in `src/lib/modelFrontmatterAdapter.ts`: |
| 79 | + |
| 80 | +- If **`serving.entries`** exists and has **one or more** entries, those entries are used (preferred for new work). |
| 81 | +- Otherwise **`supported_inference_engines`** (legacy array) is used. |
| 82 | + |
| 83 | +Each engine row maps to **`SupportedEngineEntry`** in `src/lib/inferenceCommands.ts`. Prefer: |
| 84 | + |
| 85 | +- **`serve_command_orin`** / **`serve_command_thor`** for long-running serve commands (vLLM, Ollama, etc.). |
| 86 | +- Legacy **`run_command_orin`** / **`run_command_thor`** still work as fallbacks for the serve matrix but are **deprecated** in favor of `serve_command_*` (see comments on `SupportedEngineEntry`). |
| 87 | + |
| 88 | +Optional fields (non-exhaustive): |
| 89 | + |
| 90 | +- **`modules_supported`**: array of **matrix module ids** this engine supports; others may appear grayed for that engine. |
| 91 | +- **`run_commands_by_module`**: map from module id → command string for **Run** matrix cells. |
| 92 | +- **`matrix_modules_disabled`** (top-level frontmatter): ids to show grayed / non-clickable across the matrix. |
| 93 | + |
| 94 | +**Canonical module ids** and labels live in **`JETSON_MATRIX_MODULES`** in `src/lib/inferenceCommands.ts` (e.g. `thor_t5000`, `thor_t4000`, `orin_agx_64`, `orin_nx_16`, `orin_nano_8`). Use these ids in `modules_supported` / `matrix_modules_disabled` / `one_shot_inference.modules_supported`ΓÇödo not invent new ids unless you extend `JETSON_MATRIX_MODULES` in code (out of scope for a content-only change). |
| 95 | + |
| 96 | +**Examples in repo:** |
| 97 | + |
| 98 | +- Legacy-only matrix: `src/content/models/qwen3-vl-8b.md` (`supported_inference_engines` with `serve_command_orin` / `serve_command_thor`). |
| 99 | +- New **`serving.entries`** plus **`one_shot_inference`**: `src/content/models/ministral3-8b-reasoning.md`. |
| 100 | +- **`hide_run_button: true`**: hides the whole run block even if engines existΓÇöe.g. `src/content/models/cosmos-reason2-8b.md` (still has engine data for docs; button hidden). |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +## One-shot inference |
| 105 | + |
| 106 | +Optional frontmatter block **`one_shot_inference`** (see schema in `src/content/config.ts`). Typical fields: |
| 107 | + |
| 108 | +- **`run_command_orin`**, **`run_command_thor`**, and/or **`shell`**, **`python`** |
| 109 | +- **`shell_by_module`** / **`python_by_module`** (per matrix module) |
| 110 | +- **`modules_supported`**, **`intro`** |
| 111 | + |
| 112 | +Visibility: `src/components/ModelOneShotSection.astro` shows the section when at least one of those command fields is non-empty (see its `hasContent` logic). Snippet/module resolution uses **`src/lib/evalRunModal.ts`**. |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## Validation (build will fail if wrong) |
| 117 | + |
| 118 | +`src/content/config.ts` **`superRefine`** on the models collection (unless **`hide_run_button: true`**): |
| 119 | + |
| 120 | +You must provide **at least one** of: |
| 121 | + |
| 122 | +1. Non-empty **`serving.entries`**, or |
| 123 | +2. Non-empty **`supported_inference_engines`**, or |
| 124 | +3. **`one_shot_inference`** with at least one **trimmed** command among `run_command_orin`, `run_command_thor`, `shell`, `python`, or values inside `shell_by_module` / `python_by_module`. |
| 125 | + |
| 126 | +Otherwise Zod reports a custom error on `supported_inference_engines` asking you to provide engines and/or one-shot commands or set `hide_run_button: true`. |
| 127 | + |
| 128 | +--- |
| 129 | + |
| 130 | +## Checklist before you finish |
| 131 | + |
| 132 | +- [ ] Required model fields present (`title`, `short_description`, `vision_capable`, `memory_requirements`, `precision`, `model_size`, …). |
| 133 | +- [ ] Either `serving.entries` **or** `supported_inference_engines` **or** meaningful `one_shot_inference`, **or** `hide_run_button: true`. |
| 134 | +- [ ] `serve_command_*` preferred over deprecated `run_command_*` for serve flows. |
| 135 | +- [ ] Matrix ids match `JETSON_MATRIX_MODULES` in `src/lib/inferenceCommands.ts`. |
| 136 | +- [ ] Run **`npm run build`** (see skill **`jetson-ai-lab-verify-build`**). |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## Source of truth (repo files) |
| 141 | + |
| 142 | +| Purpose | Path | |
| 143 | +|--------|------| |
| 144 | +| Model schema + validation | `src/content/config.ts` (`modelsSchema`, `superRefine` ~L124ΓÇô145) | |
| 145 | +| Merge `serving.entries` vs legacy | `src/lib/modelFrontmatterAdapter.ts` (`getSupportedInferenceEngines`, `servingEntryToSupportedEngine`) | |
| 146 | +| Engine types, matrix ids, serve/run semantics | `src/lib/inferenceCommands.ts` (`SupportedEngineEntry`, `JETSON_MATRIX_MODULES`, matrix helpers) | |
| 147 | +| Model page layout | `src/pages/models/[slug].astro` | |
| 148 | +| Serve matrix UI | `src/components/ModelServeSection.astro` | |
| 149 | +| Call / client examples | `src/components/ModelCallSection.astro` | |
| 150 | +| One-shot UI | `src/components/ModelOneShotSection.astro` | |
| 151 | +| One-shot snippet logic | `src/lib/evalRunModal.ts` | |
| 152 | +| Benchmarks (optional) | `src/components/ModelBenchmarkSection.astro` + `benchmark` in schema | |
0 commit comments