Developer Resources

Everything you need to start building decentralized AI applications with PYRAI.

Resources

Quick Start Example


import pyrai

# Initialize PYRAI client
client = pyrai.Client(api_key="YOUR_API_KEY")

# Define a simple neural network model
model = pyrai.models.Sequential([
  pyrai.layers.Dense(64, activation='relu', input_shape=(10,)),
  pyrai.layers.Dense(32, activation='relu'),
  pyrai.layers.Dense(1, activation='sigmoid')
])

# Compile the model
model.compile(optimizer='adam', loss='binary_crossentropy')

# Train the model on the decentralized network
model.fit(x_train, y_train, epochs=10, batch_size=32)

# Make predictions
predictions = model.predict(x_test)

# Save the model to PYRAI's decentralized storage
model.save('my_model.h5')

# Load the model from PYRAI's decentralized storage
loaded_model = pyrai.models.load_model('my_model.h5')

Online Demo

Python Editor
Output Console
> Run the code to see output