---
path: /studio/aja/batch-inference
surface: studio
domain: aja
auth: signed-in + studio entitlement
source: apps/oshun/web/src/app/studio/aja/batch-inference/page.tsx
status: walked
last_walked:
  '2026-05-29 automated runtime walk (Playwright headless) — render, /v1 data
  (2xx), console/page-errors, expected content, screenshot verified; live
  screen-reader, touch, offline, and telemetry-delivery checks pending a manual
  AT pass. Evidence: WALKTHROUGH/results/runtime-sweep-2026-05-29.md; body
  re-derived 2026-06-03 from current source (lane-console architecture)'
---

# Aja Batch Inference

## Purpose

Admin lane console wired to the real `@aja/batch-inference` batch-planning math
via `/v1/admin/aja/batch-inference`: from a tensor shape + dtype + memory budget
+ throughput target it computes the tensor memory footprint, the memory-bounded
initial batch size, and a throughput-tuned batch size for a target frame rate.

## Entry points

- **Direct URL** — `/studio/aja/batch-inference` (signed-in + studio entitlement)
- **Breadcrumb** — Studio / Aja Batch Operations / Batch Inference
- **Sibling quick-actions from this page** — Batch Operations, Distributed
  Processing, Job Operations, Queue Statistics, Output Retrieval, Back to Studio

## Layout regions

`page.tsx` mounts `ShellLayout` with `active="studio"` and renders four panels.

- **Breadcrumb panel** (`data-aja-batch-inference-breadcrumbs`):
  `nav aria-label="Aja Batch Inference breadcrumbs"` — Studio (link) / Aja Batch
  Operations (link) / Batch Inference (`aria-current="page"`)
- **Workspace panel** (`data-aja-batch-inference-workspace`):
  - `<h1>` "Aja Batch Inference Workspace" (via `WorkspaceHeading`)
  - `<p data-aja-bi-summary>` — "Plan an inference batch — compute the tensor
    memory footprint, the memory-bounded initial batch size, and a
    throughput-tuned batch size for a target frame rate."
  - The plan form (rendered once the catalog loads)
- **Route Map panel** (`data-aja-batch-inference-route-map`): `<h2>` "Route Map"
  + one `<article>` per `STUDIO_AJA_BATCH_INFERENCE_ROUTE_MAP` entry (6 entries)
- **Quick actions panel**: `.quickAction` `<Link>`s — see Interactions

## States

- [ ] **Loading** — `data-aja-bi-loading` "Loading batch planner…"
- [ ] **Unauthorized** — on 401/403, `data-aja-bi-unauthorized` ("Access
      restricted." + reason, default "Aja workspace scope required to view batch
      inference.")
- [ ] **Error** — non-OK / malformed / unreachable → `data-aja-bi-error`
- [ ] **Ready (form)** — catalog present: the plan form
- [ ] **Result** — `data-aja-bi-result`: `data-aja-bi-tensor-bytes` (footprint),
      `data-aja-bi-initial-batch` (memory-bounded), `data-aja-bi-fps-batch`
      (throughput-tuned)
- [ ] **Validation error** — `data-aja-bi-plan-error` "Shape must be one or more
      positive integers."

## Interactions

### Plan form (`data-aja-bi-plan-form`)

- [ ] **Tensor shape (comma-separated)** — `input data-aja-bi-field-shape`
- [ ] **Data type** — `select data-aja-bi-field-dtype` (from `catalog.dtypes`)
- [ ] **Available memory (bytes)** — `input data-aja-bi-field-mem`
- [ ] **Per-frame memory (bytes)** — `input data-aja-bi-field-perframe`
- [ ] **Target FPS** — `input data-aja-bi-field-fps`
- [ ] **Current batch size** — `input data-aja-bi-field-batch`
- [ ] **Current latency (ms)** — `input data-aja-bi-field-latency`
- [ ] **Plan batch** — `button data-aja-bi-plan-submit`; `POST
      /v1/admin/aja/batch-inference/plan` with `{ shape, dtype,
      availableMemoryBytes, perFrameMemoryBytes, targetFps, currentBatchSize,
      currentLatencyMs }` → `{ plan }`

### Route Map panel (`data-aja-batch-inference-route-map`)

Non-interactive `<article>` blocks from `STUDIO_AJA_BATCH_INFERENCE_ROUTE_MAP`
(6 entries): `/studio/aja/batch-inference` plus `…/jobs/[jobId]`,
`…/runs/[runId]`, `…/artifacts/[artifactId]`, `…/parity/[parityId]`,
`…/governance/[policyId]`.

### Quick actions panel

- [ ] **Open Aja Batch Operations workspace** → `/studio/aja/batch-operations`
- [ ] **Open Aja Distributed Processing workspace** → `/studio/aja/distributed-processing`
- [ ] **Open Aja Job Operations workspace** → `/studio/aja/job-operations`
- [ ] **Open Aja Queue Statistics workspace** → `/studio/aja/queue-statistics`
- [ ] **Open Aja Output Retrieval workspace** → `/studio/aja/output-retrieval`
- [ ] **Back to Studio workspace index** → `/studio`

## Data & contracts

- **Reads**: `GET /v1/admin/aja/batch-inference` (catalog: `dtypes`,
  `initialBatchMax`, `fpsBatchMax`) on mount via `buildBffAuthHeaders()`,
  `cache: 'no-store'`
- **Writes**: `POST …/plan` → `{ plan }` (tensorBytes, initialBatchSize,
  fpsAdjustedBatchSize)
- **Realtime**: none
- **Caching**: client fetch on mount (no-store); SSR shell only
- **Auth**: BFF endpoints admin-scoped + fail-closed (401/403 → unauthorized
  render); the route is signed-in + studio (proxy gate)

## Cross-references

- Parent: [`../../studio-overview.md`](../../studio-overview.md)
- Component sources:
  - `apps/oshun/web/src/components/studio/StudioAjaBatchInferenceWorkspace.tsx`
  - `apps/oshun/web/src/components/studio/StudioAjaBatchInferenceRouteMap.ts`
- Siblings from quick-actions: `/studio/aja/batch-operations`,
  `/studio/aja/distributed-processing`, `/studio/aja/job-operations`,
  `/studio/aja/queue-statistics`, `/studio/aja/output-retrieval`

## Open questions / known gaps

- [ ] Route-map sub-routes (`jobs`/`runs`/`artifacts`/`parity`/`governance`) are
      descriptive only; confirm implementation status
- [ ] Document the exact studio entitlement / proxy gate governing `/studio/aja/*`
