synor/sdk/go
Gulshan Yadav eab599767c feat(sdk): Add ZK SDK for all 12 languages
Implement Zero-Knowledge proof SDK for ZK-Rollups and privacy:
- Proof systems: Groth16, PLONK, STARK
- Circuit types: Transfer, Batch, Deposit, Withdraw
- Rollup batch processing and state management
- Trusted setup ceremony operations
- Merkle proof verification

Languages: JS/TS, Python, Go, Rust, Flutter, Java, Kotlin, Swift, C, C++, C#, Ruby
2026-01-28 13:11:06 +05:30
..
bridge Add Synor Storage and Wallet SDKs for Swift 2026-01-27 01:56:45 +05:30
contract feat: implement Privacy and Contract SDKs for all 12 languages (Phase 5) 2026-01-28 09:03:34 +05:30
database Add Synor Storage and Wallet SDKs for Swift 2026-01-27 01:56:45 +05:30
dex feat(sdk): implement DEX SDK with perpetual futures for all 12 languages 2026-01-28 12:32:04 +05:30
economics feat: add Economics, Governance, and Mining SDKs for core languages 2026-01-27 02:39:27 +05:30
governance feat: add Economics, Governance, and Mining SDKs for core languages 2026-01-27 02:39:27 +05:30
hosting Add Synor Storage and Wallet SDKs for Swift 2026-01-27 01:56:45 +05:30
ibc feat(sdk): implement IBC SDK for all 12 languages 2026-01-28 12:53:46 +05:30
mining feat: add Economics, Governance, and Mining SDKs for core languages 2026-01-27 02:39:27 +05:30
privacy feat: implement Privacy and Contract SDKs for all 12 languages (Phase 5) 2026-01-28 09:03:34 +05:30
rpc feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage 2026-01-27 00:46:24 +05:30
storage feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage 2026-01-27 00:46:24 +05:30
wallet feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage 2026-01-27 00:46:24 +05:30
zk feat(sdk): Add ZK SDK for all 12 languages 2026-01-28 13:11:06 +05:30
go.mod feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage 2026-01-27 00:46:24 +05:30
README.md docs(sdk): add comprehensive documentation for all 12 SDKs 2026-01-11 18:05:03 +05:30
synor.go feat(sdk): add consumer SDKs for JavaScript, Python, and Go 2026-01-11 14:11:58 +05:30
synor_test.go test(sdk): add comprehensive unit tests for all SDKs 2026-01-11 17:56:11 +05:30

Synor Compute SDK for Go

Access distributed heterogeneous compute at 90% cost reduction.

Installation

go get github.com/synor/compute-sdk-go

Quick Start

package main

import (
    "context"
    "fmt"
    "log"

    synor "github.com/synor/compute-sdk-go"
)

func main() {
    client := synor.NewClient("your-api-key")

    // Create tensors
    a := synor.NewTensor(data, []int{512, 512}, synor.FP32)
    b := synor.Zeros([]int{512, 512}, synor.FP32)

    // Matrix multiplication
    ctx := context.Background()
    result, err := client.MatMul(ctx, a, b,
        synor.WithPrecision(synor.FP16),
        synor.WithProcessor(synor.GPU),
    )
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("Execution time: %.2fms\n", result.Metrics.ExecutionTimeMs)
}

Configuration

config := synor.Config{
    APIKey:    "your-api-key",
    Endpoint:  "https://api.synor.io/compute/v1",
    Strategy:  synor.Balanced,
    Precision: synor.FP16,
    Timeout:   30 * time.Second,
}

client := synor.NewClientWithConfig(config)

Tensor Operations

// Create tensors
zeros := synor.Zeros([]int{3, 3}, synor.FP32)
ones := synor.Ones([]int{2, 2}, synor.FP32)

// From slice
data := []float32{1, 2, 3, 4, 5, 6}
tensor := synor.NewTensor(data, []int{2, 3}, synor.FP32)

// Serialize for API
serialized := tensor.Serialize()

Matrix Operations

// Matrix multiplication
result, err := client.MatMul(ctx, a, b,
    synor.WithPrecision(synor.FP16),
    synor.WithProcessor(synor.GPU),
    synor.WithStrategy(synor.Speed),
)

// 2D Convolution
conv, err := client.Conv2D(ctx, input, kernel,
    synor.WithStride(1, 1),
    synor.WithPadding(1, 1),
)

// Attention
attention, err := client.Attention(ctx, query, key, value,
    synor.WithNumHeads(8),
    synor.WithFlash(true),
)

LLM Inference

// Single response
response, err := client.Inference(ctx, "llama-3-70b", "Explain quantum computing",
    synor.WithMaxTokens(512),
    synor.WithTemperature(0.7),
)
fmt.Println(response.Result)

// Streaming (using channel)
stream, err := client.InferenceStream(ctx, "llama-3-70b", "Write a poem")
for chunk := range stream {
    fmt.Print(chunk)
}

Job Management

// Submit async job
job, err := client.SubmitJob(ctx, "matmul", map[string]interface{}{
    "a": a.Serialize(),
    "b": b.Serialize(),
})

// Get status
status, err := client.GetJobStatus(ctx, job.ID)

// Cancel
err = client.CancelJob(ctx, job.ID)

Error Handling

result, err := client.MatMul(ctx, a, b)
if err != nil {
    if synorErr, ok := err.(*synor.SynorError); ok {
        fmt.Printf("API Error: %s (status: %d)\n",
            synorErr.Message, synorErr.StatusCode)
    }
}

Processor Types

synor.CPU     // General-purpose CPU
synor.GPU     // NVIDIA/AMD GPU
synor.TPU     // Google TPU
synor.NPU     // Neural Processing Unit
synor.LPU     // Language Processing Unit
synor.FPGA    // Field-Programmable Gate Array
synor.WASM    // WebAssembly runtime
synor.WebGPU  // Browser GPU

Precision Levels

synor.FP64  // 64-bit float
synor.FP32  // 32-bit float (default)
synor.FP16  // 16-bit float
synor.BF16  // Brain float 16
synor.INT8  // 8-bit integer
synor.INT4  // 4-bit integer

Testing

go test ./...

License

MIT