Skip to content

Thox-ai/magstack-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

MagStack™ SDK

Coming Soon Public Beta License: MIT

Official SDK for MagStack™ Magnetic Clustering Technology

DocumentationWebsiteDiscord


🚀 Coming Soon - Public Beta

The MagStack™ SDK is currently in private development and will be released as a public beta alongside the Thox.ai Edge Device launch. Join our waitlist to get early access!


Overview

MagStack™ enables modular AI computing through magnetically-coupled device clusters. This SDK provides comprehensive tools for:

  • Cluster Management: Monitor topology, power contracts, and node health
  • Distributed Inference: OpenAI-compatible API for running AI models across clusters
  • Model Management: Load, unload, and manage AI models
  • Device Discovery: Find MagStack devices on your network
  • Cluster Coordination: Leader election and distributed coordination

Quick Links

Roadmap

Phase Status Description
Alpha ✅ Complete Internal testing with partner developers
Private Beta 🔄 In Progress Limited access for early adopters
Public Beta 📅 Q2 2026 Open access with Thox.ai device launch
1.0 Release 📅 Q3 2026 Production-ready stable release

Upcoming Features

  • TypeScript SDK v1.0
  • Python SDK v1.0
  • React hooks for cluster status
  • CLI tool for development
  • WebSocket streaming support
  • Async batch inference
  • Model fine-tuning API

Installation

Note: Packages will be published to npm and PyPI when the public beta launches. For now, you can build from source for early access.

TypeScript/JavaScript

# Coming soon to npm
npm install @thox/magstack-sdk

# Build from source (early access)
git clone https://github.com/Thox-ai/magstack-sdk.git
cd magstack-sdk/typescript
npm install && npm run build

Python

# Coming soon to PyPI
pip install magstack-sdk

# Build from source (early access)
git clone https://github.com/Thox-ai/magstack-sdk.git
cd magstack-sdk/python
pip install -e .

Quick Start

TypeScript

import { MagStackClient } from '@thox/magstack-sdk';

const client = new MagStackClient({
  host: '192.168.1.100',
  apiKey: 'your-api-key'
});

// Get cluster status
const cluster = await client.cluster.getStatus();
console.log(`${cluster.nodeCount} nodes, ${cluster.totalTops} TOPS`);

// Run inference
const response = await client.inference.chat({
  model: 'llama-3.1-8b',
  messages: [{ role: 'user', content: 'Hello!' }]
});

Python

from magstack import MagStackClient

client = MagStackClient("192.168.1.100", api_key="your-api-key")

# Get cluster status
cluster = client.cluster.get_status()
print(f"{cluster.node_count} nodes, {cluster.total_tops} TOPS")

# Run inference
response = client.inference.chat(
    model="llama-3.1-8b",
    messages=[{"role": "user", "content": "Hello!"}]
)

SDK Components

Client Libraries

Component TypeScript Python
Core Client
Cluster Management
Inference API
Model Management
Device Discovery
Coordinator

Host Daemon (Rust)

The magstackd daemon runs on Thox.ai devices and provides:

  • REST API for cluster management
  • MS-Link protocol handling
  • Power contract negotiation
  • Topology management

Module Firmware (C)

Reference firmware for accessory modules:

  • MS-Link framing implementation
  • Power negotiation
  • CRC32 validation
  • Safe state handling

Protocol Definition

The MagStack protocol uses protobuf for message serialization:

  • magstack.proto - Full protocol schema
  • Message types for discovery, power, firmware, and control
  • Forward-compatible design

Development

Build All Components

make all

Run Tests

make test

Generate Test Vectors

make vectors

Full CI Pipeline

make ci

Project Structure

magstack-sdk/
├── SPECIFICATION.md      # Full SDK specification
├── README.md             # This file
├── Makefile              # Build automation
├── protocol/             # Protobuf definitions
│   └── magstack.proto
├── typescript/           # TypeScript/JavaScript SDK
│   ├── src/
│   └── package.json
├── python/               # Python SDK
│   ├── magstack/
│   └── pyproject.toml
├── host-daemon/          # Rust host daemon
│   ├── src/
│   └── Cargo.toml
├── module-fw/            # C module firmware
│   ├── src/
│   ├── include/
│   └── CMakeLists.txt
├── tests/                # Conformance tests
│   ├── test_*.py
│   └── requirements.txt
└── examples/             # Usage examples
    ├── typescript/
    └── python/

Architecture

┌──────────────────────────────────────────────────────────────┐
│                     MagStack Cluster                          │
├──────────────────────────────────────────────────────────────┤
│  ┌─────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐   │
│  │ Device  │────│ Device  │────│ Device  │────│ Module  │   │
│  │ (Node)  │    │ (Node)  │    │ (Leader)│    │         │   │
│  └────┬────┘    └────┬────┘    └────┬────┘    └────┬────┘   │
│       │              │              │              │        │
│       └──────────────┴──────────────┴──────────────┘        │
│                    MS-Link Data Bus                          │
├──────────────────────────────────────────────────────────────┤
│                    Shared Power Plane                        │
└──────────────────────────────────────────────────────────────┘

API Endpoints

Inference API (Port 8080)

Endpoint Method Description
/v1/chat/completions POST Chat completion
/v1/completions POST Text completion
/v1/embeddings POST Generate embeddings
/v1/models GET List models

Cluster API (Port 5381)

Endpoint Method Description
/v1/topology GET Get cluster topology
/v1/cluster GET Get cluster status
/v1/nodes GET List all nodes
/v1/power/contract POST Negotiate power
/v1/health GET Get health status

Certification

MagStack™ certification ensures safe interoperability:

Tier Capabilities
Tier C Power-only (charging + magnetic attach)
Tier B Power + MS-Link + telemetry
Tier A Full-trust (power + data + firmware + cluster)

Get Notified

Want to know when the public beta launches?

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Note: Public contributions will be accepted starting with the public beta in Q2 2026. Until then, please join our Discord to share feedback and ideas.

Support

License

MIT License - see LICENSE file for details.

Trademark

MagStack™ is a trademark of Thox.ai LLC. The MagStack magnetic stacking and automatic cluster formation technology is proprietary and patent pending.


Built with precision by Thox.ai

Bringing frontier AI to the edge

About

Build with magnetic clustering technology - coming soon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors