Model StudioSetup

Connect a local runner.

Keep exact weights and training data on your hardware. Connect people and authorized agents to one service for experiments, jobs, evaluations and local serving.

This is a single-tenant local pilot. You need a source checkout, Node 22.13 or newer, and an Apple silicon environment suitable for MLX. The adapter API has been checked with Python 3.12 and MLX LM 0.32.2; a complete model training result requires its own successful receipt.

Open Model Studio

Four steps to a connected workspace

Expand a step for commands. The source checkout includes the full sequence in docs/model-studio.md.

01Prepare private storage and the runtimeExternal SSD, Python environment and pinned weights

Choose your own absolute storage path. An external SSD can hold weights, datasets, outputs and private state; it does not add unified memory. Keep the volume connected while jobs run.

umask 077
export STUDIO_ROOT="/Volumes/ModelStudio/moemodels"
mkdir -p "$STUDIO_ROOT/state" "$STUDIO_ROOT/credentials" \
  "$STUDIO_ROOT/datasets" "$STUDIO_ROOT/output"
export STUDIO_STATE_DIR="$STUDIO_ROOT/state"
export STUDIO_RUNNER_CONFIG="$STUDIO_ROOT/runner.json"
export STUDIO_URL="http://127.0.0.1:4328"

npm ci
python3.12 -m venv "$STUDIO_ROOT/venv"
"$STUDIO_ROOT/venv/bin/python" -m pip install "mlx-lm==0.32.2"

The first pilot artifact is Qwen3-Coder-Next, MLX 4-bit, approximately 44.856 GB of weights. Acquire the complete snapshot at revision 7b9321eabb85ce79625cac3f61ea691e4ea984b5 using the provider’s approved download path. Register the local snapshot directory whose basename is that revision. Runtime memory needs exceed the weight-file size.

The synthetic fixture at examples/studio/synthetic-code-review contains 12 training, 4 validation and 4 test records. It tests machinery and compatibility; it is not a security benchmark or proof of improved model quality.

02Register exact model and dataset inputsOne private runner configuration, verified split hashes

Save this template as the private runner.json named by STUDIO_RUNNER_CONFIG. Replace every example path and the dataset digest. Controller port 4328 and serving port 4329 stay on loopback.

Download runner configuration template ↓
{
  "tenantId": "local-lab",
  "label": "Local MLX runner",
  "workerId": "mlx-worker",
  "python": "/absolute/path/to/studio/venv/bin/python",
  "outputDirectory": "/absolute/path/to/studio/output",
  "port": 4329,
  "models": [
    {
      "id": "qwen3-coder-next-4bit",
      "revision": "7b9321eabb85ce79625cac3f61ea691e4ea984b5",
      "path": "/absolute/path/to/cache/snapshots/7b9321eabb85ce79625cac3f61ea691e4ea984b5"
    }
  ],
  "datasets": [
    {
      "id": "code-review-v1",
      "label": "Synthetic compatibility fixture",
      "path": "/absolute/path/to/studio/datasets/code-review-v1",
      "sha256": "REPLACE_WITH_VERIFIED_DATASET_DIGEST",
      "records": 12,
      "synthetic": true
    }
  ]
}

Datasets contain train.jsonl, valid.jsonl and test.jsonl with text chat messages. The controller rejects exact overlap between splits. Each split is limited to 32 MiB. Compute the registered manifest digest with the same verifier the controller uses:

node --experimental-strip-types --input-type=module -e '
  import { datasetDigest } from "./scripts/studio-server.mjs";
  console.log(JSON.stringify(await datasetDigest(process.argv[1])));
' "$STUDIO_ROOT/datasets/code-review-v1"

The manifest hashes each split’s exact bytes, in train, validation and test order. The worker verifies the digest again before execution. Changed data requires a new registered version.

03Issue separate, scoped identitiesPerson, delegated agent and execution workload

An administrator explicitly issues local credentials. Use human for the operator, delegated_agent for a caller acting on an authorized request, and workload with a run grant for the worker. Scope consequential actions to the intended experiment. The source guide covers initial experiment creation before those scoped grants are issued.

This example allows an agent to read and evaluate an existing experiment. Replace EXPERIMENT_ID with its real ID and save it as agent-grants.json:

{
  "id": "local-agent",
  "kind": "delegated_agent",
  "tenantId": "local-lab",
  "ttlSeconds": 3600,
  "grants": [
    { "action": "read", "resource": "EXPERIMENT_ID" },
    { "action": "evaluate", "resource": "EXPERIMENT_ID" }
  ]
}
node --experimental-strip-types scripts/studio.mjs identity issue \
  --input agent-grants.json \
  --output "$STUDIO_ROOT/credentials/agent.json"

node --experimental-strip-types scripts/studio.mjs identity revoke \
  --id local-agent

Credentials are bound to the Studio audience and expire after one hour by default, with an allowed lifetime of one minute to eight hours. Revocation blocks later requests for that identity. No identity is created by discovery or installation. Enterprise identity-provider integration is not installed by this pilot.

04Start the controller, worker and local websiteOne controller and worker, distinct credentials

Start each process in its own terminal using the selected private configuration. The controller serves one tenant. Give the worker its own workload credential file; do not reuse the operator’s credential.

# controller terminal, with the private environment above
node --experimental-strip-types scripts/studio-server.mjs

# worker terminal, with a separately issued workload credential
STUDIO_CREDENTIAL_FILE="$STUDIO_ROOT/credentials/worker.json" \
  node --experimental-strip-types scripts/studio-worker.mjs

# local website terminal
STUDIO_CONTROL_URL="http://127.0.0.1:4328" npm run dev

Open /studio on the development URL and select Connect runner access. Enter your separately issued human credential in the masked password field. It stays in page memory and clears on disconnect or leaving. Keep the credential out of URLs, terminal output, logs and chats.

Both Model Studio and Chat can connect directly from the hosted website to the controller on your computer. In connection settings, use http://127.0.0.1:4328/api/v1/studio. An administrator must allow the exact website origin in the runner configuration and issue the required operation grants; chat needs an inference grant. The browser may request local network permission. The hosted server does not receive your local credential or run your model. Keep both services bound to loopback.

The same operations without a browser

Every Studio capability is available through the versioned API. The CLI and MCP adapter use the same authorization and business rules.

CLI and HTTP

export STUDIO_CREDENTIAL_FILE="$STUDIO_ROOT/credentials/operator.json"
node --experimental-strip-types scripts/studio.mjs help
node --experimental-strip-types scripts/studio.mjs catalog
node --experimental-strip-types scripts/studio.mjs list

Mutations take a JSON file with a caller-selected operation ID. Saving, queuing and cancelling also require the current expected revision. Jobs require an explicit deadline between 30 seconds and four hours ahead.

Read operation discovery →

MCP over local stdio

STUDIO_CREDENTIAL_FILE="$STUDIO_ROOT/credentials/agent.json" \
  node --experimental-strip-types scripts/studio-mcp.mjs

The official SDK 1.32.2 maintenance line supports MCP through 2025-11-25. Actual SDK client and stdio transport tests cover allowed reads, denied training and recovery after a committed response is lost. These synthetic tests establish protocol behavior, not model quality.

Discovery, preview, experiments, jobs, chat, cancellation, operation recovery and variant lineage are exposed as typed tools. No autonomous A2A service is advertised.

Read the result the runner actually measured

A queued request is acceptance of work. It does not establish that training or deployment happened.

Current evaluation: held-out test loss and perplexity. A training result requires saved adapter weights, complete base-plus-adapter reload and a generation smoke check. Refusal and quality targets remain declared and unmeasured by this evaluator; a zero target is not a guarantee.

Architecture support: the approximately 249 GB DeepSeek V4.1 GGUF remains an inference reference with Engram training blocked. GLM-5.3 Flash ablated MLX training is unverified. Qwen3.5 397B A17B 4-bit, approximately 224 GB, is a future capacity candidate. Artifact size alone establishes no training fit.

Product boundaries: the MoETokens CPU research engine is not attached to MLX. Enterprise identity, external ARC1 policy and spend integration, and production approval orchestration are not installed here. An optional change reference supplies attribution, not independent approval.

Cancellation, unknown outcomes and safe restart

Read current job state before cancelling. A queued job can be stopped before dispatch; a running job remains active until the runner confirms cancellation. Aborting a browser or MCP request does not cancel the job.

node --experimental-strip-types scripts/studio.mjs job --id JOB_ID
node --experimental-strip-types scripts/studio.mjs operation --id ORIGINAL_OPERATION_ID

If a response is lost, recover the original operation or replay its exact command with the same operation ID, revision and deadline. Do not invent a fresh ID to resolve uncertainty. Expired worker leases become unknown and are not automatically requeued.

Inspect private job receipts, logs, saved artifacts and the owned process before restarting. Preserve operation and audit history. Never remove a controller or worker lock while its writer is alive, and never run two controllers against one state directory. Use a separate reviewed approval path for consequential production work; a requester agent cannot approve itself.