BETA Syft-hub SDK is in alpha. Payments are disabled during alpha; enjoy $20 in free credits.

syft-hub SDK

Discover data sources, run federated AI queries on the network and get your unqiue insights with ease in Python!

Quickstart

1

Install

Prerequisites: Install SyftBox from syftbox.net

Install the syft-hub SDK using pip:

pip install syft-hub
2

Initialize

Create a client that connects to your SyftBox:

from syft_hub import Client

# Auto-detects SyftBox at ~/SyftBox
client = Client()
print(client)
3

Discover Available Data & Models

Scan the network and retrieve a list of available data sources and models. This might take a second, as it is verifying the availability of the services:

client.show_services()

4

Run Your First Query

Federated Pipeline Diagram

Create a pipeline and add at least one preferred data source that you would like to fetch information from and an LLM to synthesize the response. Then, execute a federated query:

# Load a data source
data_source = client.load_service("irina@openmined.org/openmined-blog")

# Load an AI model
llm = client.load_service("aggregator@openmined.org/claude-sonnet-3.5")

# Create federated pipeline
pipeline = client.pipeline(
    data_sources=[data_source],
    synthesizer=llm
)

# Execute query
response = pipeline.run(messages=[
    {"role": "user", "content": "What is federated learning?"}
])

API Reference

Essential API documentation for building with syft-hub SDK

🔧 Client API

Initialize clients, discover services, and create pipelines for data processing and AI inference.

View Client API →

🌐 Service API

Interact with chat models and search services for AI-powered queries and data retrieval.

View Service API →

⚡ Pipeline API

Build and execute federated RAG pipelines combining multiple data sources and models.

View Pipeline API →

🔐 Authentication API

Manage accounts, payments, and access credentials for syft-hub services.

View Auth API →