> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 3D Weight Studio and Live RL Cockpit

> Inspect open-weight models in WebGL2, stream live RL telemetry with cooperative Pause/Rollback controls, run autonomous Auto-Heal/Red-Team/Canary gates, and automate via 39 MCP tools or TypeScript.

**StateSet 3D Weight Studio** (`stateset-agents studio`) is a browser-based WebGL2 weight
and circuit workbench paired with a persistent SQLite WAL run ledger, a Live RL Cockpit,
an autonomous self-healing/red-team/canary autopilot, and full **MCP** + **`@stateset/agents`**
TypeScript SDK parity.

> [!NOTE]
>
> Weight Studio runs locally over HTTP (`127.0.0.1:8765` by default) and works without a GPU
> using local fixtures or zero-download Hugging Face HTTP-Range `.safetensors` streaming.
> Live endpoint probing (`--live-endpoint` / `serve-ab`) requires a reachable OpenAI-compatible
> or vLLM server.

## Launch the workbench

```bash theme={null}
pip install "stateset-agents[api,mcp]"
stateset-agents studio --port 8765
```

Open `http://127.0.0.1:8765/studio` in any WebGL2 browser.

## Core capabilities

| Area | Capabilities |
| - | - |
| **3D Inspection & Surgery** | WebGL2 weight/circuit/attention/residual views, cross-checkpoint `Split A\|B` diff, zero-download Hugging Face HTTP-Range `.safetensors` loader, NF4/AWQ/FP8/SmoothQuant 3D quantization lab, SAE monosemantic feature clamping, and standalone single-file HTML PR reports |
| **Live RL Cockpit** | Persistent SQLite WAL `rl_steps` ledger, side-by-side multi-run sparkline overlay (`ΔR`), Verifiable Trajectory Credit Inspector with 1-click **Mine Fail -> Traces**, and 1-click 6-domain sandbox pool & cloud blueprint triggers |
| **Bi-Directional Trainer Control** | `StudioControlMixin` and `StudioTelemetryCallback` automatically snapshot best-reward weights and enforce cooperative **Pause**, **Resume**, and **In-Place Weight Rollback** across `GSPOTrainer`, `DAPOTrainer`, `GEPOTrainer`, and `VAPOTrainer` |
| **Autonomous Production Autopilot** | Transcript-to-Surgery Auto-Heal (`heal`), 10-probe Adversarial Red-Team Immunization (`redteam`), Pareto Tournament & TIES/DARE/SLERP Merge (`tournament`), Live vLLM LoRA Hot-Swap A/B (`serve-ab`), OTLP Trace Collector & LLM-Judge Calibration (`traces`), and Paired Shadow Canary Gate (`canary` / `autopilot`) |

## Connect a live RL trainer to the cockpit

Attach `StudioTelemetryCallback` to stream step metrics, `OnlineRewardHackingGuard`
verdicts, and live Pause/Rollback enforcement:

```python theme={null}
from stateset_agents.training import StudioTelemetryCallback

studio_cb = StudioTelemetryCallback(
    run_name="qwen3-8b-gspo",
    studio_url="http://127.0.0.1:8765",
)
trainer.attach_studio_callback(studio_cb)
```

Every `on_step` telemetry post returns the operator's current control state (`running`,
`paused`, or `rollback`), allowing `StudioControlMixin.enforce_studio_step(...)` to pause
cleanly or restore the best weight snapshot in place.

## TypeScript / Node SDK (`@stateset/agents`)

The zero-runtime-dependency `@stateset/agents` npm package exposes typed `client.studio.*`
and `client.mcp.*` resources alongside `/v1/messages` and `/v1/chat/completions`:

```js theme={null}
import { StateSet } from "@stateset/agents";

const client = new StateSet({ baseURL: "http://127.0.0.1:8765" });

const plan = await client.studio.planRlRun({
  model: "Qwen/Qwen3.6-35B-A3B-FP8",
  algorithm: "cispo",
  cloud: "river",
});

const pool = await client.studio.runSandboxPool({
  domains: ["commerce", "coding", "sql", "rest_api", "docker_code", "web_agent"],
});

const telemetry = await client.studio.getRlTelemetry({ limit: 40 });
await client.studio.controlRlRun({ action: "pause", reason: "Inspect entropy dip" });
```

## Security posture for shared deployments

When exposing Weight Studio or its Streamable HTTP MCP endpoint (`/api/weight-studio/mcp`)
beyond loopback:

* Set `STATESET_MCP_TOKEN` (full read/write Bearer auth) and optionally
  `STATESET_MCP_READONLY_TOKEN` (read-only Bearer auth).
* Workspace file operations are fail-closed confined to the configured `--workspace` root.
* Run `stateset-agents doctor --json` to audit MCP authentication, ingress guards, and
  SQLite ledger health.

Continue with the [Agents MCP server](https://docs.stateset.com/stateset-agents/mcp-server.md),
[Open-Weight RL suite](https://docs.stateset.com/stateset-agents/open-weight-rl.md), or the
[CLI reference](https://docs.stateset.com/stateset-agents/cli.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.