Skip to content

SolanaLM Documentation

Decentralized AI Network on Solana

Under active development

SolanaLM is under active development. APIs, schemas, and on-chain layouts may change. Production use at your own risk. Issues + PRs welcome — see the GitHub repo.

SolanaLM is a hybrid decentralized network combining LLM inference and federated learning on Solana. Nodes earn SOL through dual revenue streams: serving inference requests and participating in training rounds.


Key Features


Quick Start

Get up and running in minutes:

# Clone and setup
git clone https://github.com/cryptuon/solanalm.git
cd solanalm && poetry install && poetry shell

# Start development environment
python scripts/quick_start.py

# Test the system
python scripts/test_end_to_end.py

:octicons-arrow-right-24: Full Installation Guide


Basic Usage

Python SDK

import asyncio
from solanalm_client import SolanaLMClient

async def main():
    async with SolanaLMClient("http://localhost:8001") as client:
        response = await client.inference(
            model="microsoft/DialoGPT-small",
            prompt="Explain quantum computing",
            wallet_address="your-wallet-address"
        )
        print(f"Response: {response.response}")
        print(f"Cost: {response.cost_sol} SOL")

asyncio.run(main())

OpenAI-Compatible API

from solanalm_client import OpenAICompatibleClient

client = OpenAICompatibleClient(
    base_url="http://localhost:8001/v1",
    api_key="your-solana-wallet-address"
)

response = client.chat.completions.create(
    model="microsoft/DialoGPT-small",
    messages=[{"role": "user", "content": "Hello!"}]
)

:octicons-arrow-right-24: SDK Documentation


Architecture Overview

┌─────────────────────────────────────────────────────────────────┐
│                      User Interfaces                             │
│  ┌───────────┐  ┌───────────┐  ┌───────────┐  ┌─────────────┐   │
│  │Python SDK │  │ OpenAI API│  │Web Dashboard│ │Terminal TUI│   │
│  └─────┬─────┘  └─────┬─────┘  └─────┬─────┘  └──────┬──────┘   │
└────────┼──────────────┼──────────────┼───────────────┼──────────┘
         └──────────────┴──────────────┴───────────────┘
                    ┌──────────▼──────────┐
                    │    Gateway API      │
                    │   Load Balancer     │
                    └──────────┬──────────┘
                    ┌──────────▼──────────┐
                    │   Node Registry     │
                    └──────────┬──────────┘
       ┌───────────────────────┼───────────────────────┐
       │                       │                       │
┌──────▼───────┐    ┌──────────▼─────────┐    ┌───────▼───────┐
│ Inference    │    │ Training Nodes     │    │ Proxy Nodes   │
│ Nodes        │    │ • Federated FL     │    │ • OpenAI API  │
│ • PyTorch    │    │ • Privacy FL       │    │ • Anthropic   │
│ • llama.cpp  │    │ • Model Training   │    │ • Cohere      │
└──────────────┘    └────────────────────┘    └───────────────┘

:octicons-arrow-right-24: Architecture Details


Deployment Options

Environment Description Use Case
Local Single-command setup Development, testing
Docker Full containerized stack Staging, small deployments
Kubernetes Production-grade orchestration Enterprise, high availability

:octicons-arrow-right-24: Deployment Guide


Community & Support


License

SolanaLM is open-source software licensed under the MIT License.