Skip to content
Targon — Subnets — AI — News

Targon SDK v4 Adds Typed VM, Bare Metal, and Sandbox APIs

The update expands programmatic compute management, with broader Go and Python support and a Sandbox-focused TypeScript SDK.

Table of Contents

Targon has released SDK v4, adding typed APIs for managing virtual machines, dedicated Bare Metal servers, and Sandboxes from application code. The update gives developers workload-specific controls for provisioning infrastructure and running commands, transferring files, and managing reusable sandbox environments.

The compute platform, operated by Manifold on Bittensor Subnet 4, is extending the software layer developers use to automate its infrastructure. Go and Python support all three workload types. TypeScript supports Sandboxes, a narrower scope than Targon's announcement on X, which advertised all three languages "for all three" products.

The SDK repository explicitly distinguishes that language coverage. Existing users also face changes in how workloads are created, how configuration fields are read, and which older APIs remain available.

Workload-Specific Controls Replace Generic Creation

In Go and Python, developers now create resources through dedicated VM, Bare Metal, or Sandbox services rather than a generic workload-creation API. The services expose operations appropriate to each environment, while retaining a shared set of management functions where the workload types overlap.

The default Create operation combines registration and deployment, with an option to wait for the workload to become ready. Developers who need separate provisioning stages can use Register and Deploy in Go and Python instead.

A common Workloads service remains available in those two languages for listing and retrieving workloads, checking state and events, deleting resources, waiting for readiness, verifying image digests, and attaching or detaching SSH keys. More specialized functions move to the relevant typed service: VM logs, streaming logs, and VM images belong to the VM service, while Bare Metal images, power controls, and reinstallation belong to the Bare Metal service.

The division gives applications a more explicit interface to different infrastructure models. A dedicated physical server needs operations such as reinstalling its software or controlling power; a short-lived sandbox needs command execution, file access, and cloning. Developers no longer reach for a generic mutation method for each of those tasks.

Inventory queries also gain a region filter and the current vm and bm workload types. VM creation uses SSH keys and an optional hostname rather than a VM password. Bare Metal creation and deployment wait up to 30 minutes by default, a different provisioning path from a disposable sandbox.

The v4.0.0 changelog, dated November 11, records a coordinated release of the Go, Python, and TypeScript packages. Their supported surfaces differ:

LanguageTyped Workload ServicesCreation Interface
GoVM, Bare Metal, and SandboxCreate, plus separate Register and Deploy operations
PythonVM, Bare Metal, and SandboxCreate, plus separate register and deploy operations
TypeScriptSandboxSandbox creation; no separate Register or Deploy operations

TypeScript does not expose the VM, Bare Metal, or common Workloads services. Its package has no runtime dependencies, and terminal connections use a WebSocket implementation supplied by the application's runtime.

Sandboxes Gain a Full Programmatic Workflow

The Sandbox APIs cover the sequence from creating an environment to doing work inside it and tearing it down. Developers can execute commands, transfer binary files, manage terminal sessions, retrieve desktop connection metadata, freeze and thaw environments, fork copies, and publish reusable templates.

Creation starts with a fetched SandboxTemplate resource in READY status. Applications must pass that resource object to the creation method; a raw template identifier is rejected. Templates are client-bound resources with their own refresh, update, delete, and sandbox-creation methods.

That resource model supports repeatable execution. An application can create a sandbox from a prepared template, upload input files, run a command, retrieve the result, and delete the environment. Forking creates a separate workload with its own identifier and billing, while publishing snapshots an environment into a template that survives deletion of the original sandbox.

Command execution and interactive terminals serve different purposes. exec runs one shell command and returns standard output, standard error, an exit code, and a timeout indicator. A terminal provides a persistent pseudo-terminal session over a WebSocket using raw binary frames, with short-lived access tickets for direct connections.

The release also fixes request handling that previously cut off execution and file transfers at the ordinary 30-second request timeout. Sandbox mutations do not retry automatically, avoiding duplicate executions, forks, or published templates; safe reads retain retries.

targon-sdk GitHub repository card
targon-sdk GitHub repository card | manifold-inc on GitHub

Targon pointed developers to runnable examples in its follow-up post. The Sandbox cookbook provides matching Python, Go, and TypeScript recipes for creation, command execution, files, reconnection, cleanup, timeout changes, freezing, forking, publishing, terminals, and desktop access. The repository also links to the public Sandbox SDK documentation.

The examples use TARGON_API_KEY and TARGON_ORG for credentials and organization context. Python and Go can also read an active CLI profile when those variables are unset. TypeScript requires an organization through its environment or client configuration.

A sandbox left running continues to incur costs until it is deleted, expires, or idles out. The cookbook examples use a 15-minute lifetime and a five-minute idle timeout so a failed program does not leave an environment running all day.

Comments

Latest