BenchWeave SDK
Star on GitHub
SDK 0.15.0 · OTDP 0.2.3 · adapter API 1.1
Python 3.13+ · MIT

Build device plugins. Do not import the gateway.

Offline tools to author OTDP device plugins and to check their conformance. Scaffold an independent project. Hand your AI the generated guide and the evidence files. Then check descriptors, presentation resources and presets against the same contract bytes the gateway uses.

prompt protocol.md vectors.json benchweave-sdk new check build device plugin descriptor · adapter · tests
fig. 1: prompt to plugin

Install

Stable releases are on PyPI. The generated plugin runtime has no dependency on the SDK. Only its test extra pins the SDK version.

pip install benchweave-sdk
# then scaffold an independent plugin project
benchweave-sdk new plugins/acme/model100 --package benchweave_acme_model100

Five steps

Generate, implement, test, review, then prepare a release. The SDK covers the offline parts. Hardware qualification and publication approval stay with you.

  1. 1
    Install the SDK

    From PyPI, as an isolated CLI tool, or from Homebrew.

  2. 2
    Scaffold the project

    benchweave-sdk new plugins/<manufacturer>/<device> --package <import_name>. The project contains src/, tests/ and a generated AI-GUIDE.md that describes the design, build, test, review and release steps.

  3. 3
    Replace the synthetic protocol

    Swap the explicitly synthetic protocol.md and vectors.json for verified device behaviour. Then update the descriptor.

  4. 4
    Run the checks

    Install the plugin with its test dependencies. Run pytest. Then run benchweave-sdk check against the descriptor. Record the applicable S01–S18, C01–C12 and M01–M14 obligations and evidence. The basic checks do not cover all of them.

  5. 5
    Build and prepare the release

    Run uv build. Prepare the registry metadata and the reviewed evidence. Then approve the release before publication or hardware qualification. benchweave-sdk inventory generates hashes, not a complete registry manifest.

Public surfaces

Six modules. You do not need an SDK superclass. The interfaces are structural.

interfaces

async

Structural Adapter, HostServices, OperationContext and optional CaptureServices and DatasetServices capability definitions.

API reference →

testing

doubles

Deterministic MockContext and MockHost: scripted transfers, dispatch markers, cancellation and a manually advanced clock. Not qualified host services.

validation

offline

Pinned local schemas, strict finite JSON, format validation, runtime correlation and basic descriptor checks for S01, S02 and S04. Unresolved references fail without network retrieval.

conformance

reusable

Operation and quiet-lifecycle checks with configurable wall-clock timeouts. Authors add device-specific failure, profile and measurement tests.

presentation

same bytes

Bounded offline validation of presentation resources and complete configuration presets, with the same validator bytes as the gateway.

packaging

integrity

Inventory and integrity checks for a prepared bundle, including duplicate, path and symlink rejection. It does not install, sign or publish anything.

Compatibility and limits

The gateway bridge implements identify, scalar read, scalar write, single-channel capture, streaming subscriptions and pinned-contract invoke. It does not implement the self_test, get_errors and reset verbs, or profile scheduling. The SDK supplies no live install endpoint, physical backend, container device permissions or hardware qualification. SDK and gateway versions have independent names. Each release records the exact tested pair.

Read the full list

Questions and discussion

Are you stuck on a descriptor? Do you want to show your work? The BenchWeave Discord is open, and the invite is permanent.

Join the Discord →

Documentation

Versioned docs built with Great Docs. The root tracks the latest release. Every page carries a version selector that switches between released versions and the current main build.

CLI

One console script, benchweave-sdk, built on Click with Rich output. Every command works offline. No command admits a plugin, approves settings or qualifies hardware.

CommandWhat it does
newCreate a synthetic external plugin project. Add --with-ui for a presentation envelope, binding catalogue and readings page.ref →
doctorReport the project's pinned SDK version against the installed one, offline. A mismatch is a report, not an error.ref →
checkRun offline descriptor schema and basic semantic checks.ref →
check-uiValidate a presentation candidate offline.ref →
check-presetValidate complete configuration presets offline.ref →
preview-uiPreview the plugin project on the standalone host, mock transport only. Needs the [server] extra. Loopback only unless you pass --allow-network. Every preview carries a simulated label.ref →
inventoryPrint hashes for a prepared bundle. This is not a release manifest.ref →
sync-standardsImport a standards bundle into the SDK's vendored tree and lock. --check verifies the committed lock alone.ref →

Validate from the plugin project root

# after installing the plugin's development dependencies
benchweave-sdk check src/benchweave_acme_model100/descriptor.json
benchweave-sdk check-ui src/benchweave_acme_model100/presentation.json \
  --descriptor src/benchweave_acme_model100/descriptor.json \
  --resources src/benchweave_acme_model100 \
  --catalogue src/benchweave_acme_model100/binding-catalogue.json \
  --firmware 1.0.0
pytest
uv build

--resources points at the package root. The envelope's resource_root: "ui" selects its ui/ subdirectory. Resource paths must stay inside the root and cannot traverse symlinks.

Gateway

This is the SDK. The BenchWeave gateway, the canonical architecture and the contract standards live in the main repository. The main repository mounts this package at packages/sdk as a git submodule. The package has its own CI and release cycle.

Vendored contract sets

The source distribution and wheel carry these standards so validation runs without the gateway checkout. standards-lock.json pins every file by hash. The release smoke compares installed bytes with the canonical copies.

otdp 0.2.3 registry 0.1.2 execution 0.2.0 interface 0.1.0 plugin-ui 0.3.1 plugin-ui-preview 0.2.0 plugin-ui-class-reference 0.1.0

Compatibility: SDK 0.15.0 against the main repository >=0.1.0.