Skip to main content
torch.js has not been released yet.
torch.js logotorch.js logotorch.js
PlaygroundContact
Login
Documentation
IntroductionType SafetyTensor ExpressionsTensor IndexingEinsumEinopsAutogradTraining a ModelProfiling & MemoryPyTorch MigrationBest PracticesRuntimesPerformancePyTorch CompatibilityBenchmarksDType Coverage
torch.js· 2026
LegalTerms of UsePrivacy Policy
/
/
  1. docs
  2. Spark
  3. spark
  4. JsonRpcRequest

spark.JsonRpcRequest

export interface JsonRpcRequest {
  /** JSON-RPC version */
  jsonrpc: '2.0';
  /** Method name to invoke */
  method: string;
  /** Optional parameters for the method */
  params?: unknown;
  /** Optional request ID (required for calls, omitted for notifications) */
  id?: string;
}
jsonrpc('2.0')
– JSON-RPC version
method(string)
– Method name to invoke
params(unknown)optional
– Optional parameters for the method
id(string)optional
– Optional request ID (required for calls, omitted for notifications)

Core types for Spark.

Spark is the web platform layer for torch.js that provides:

  • WebWorker runtime with hot reload support
  • Reactive bindings between worker and UI
  • File I/O to torchjs.org
  • Local IndexedDB persistence
  • Dataset loading with torch.json manifests
Previous
JsonRpcMessage
Next
JsonRpcResponse