On-chain AI inference
the agent economy can pay for.
SolanaLM is a decentralized, OpenAI-compatible inference network built for machine-to-machine payment: agents pay per request in SOL with sub-second settlement, operators run nodes on the cheapest DePIN GPUs, and every call leaves an on-chain audit trail — heading toward inference you can verify.
from solanalm_client import OpenAICompatibleClient
client = OpenAICompatibleClient(
base_url="https://gateway.solanalm.io/v1",
api_key="your-solana-wallet-address", # wallet as API key
)
response = client.chat.completions.create(
model="meta-llama/Llama-3.1-8B-Instruct",
messages=[{"role": "user", "content": "Explain CRDTs."}],
)
print(response.choices[0].message.content) SolanaLM is an MIT-licensed, decentralized AI network combining OpenAI-compatible LLM inference and federated learning, with settlement and node incentives on Solana. It's built for the agent economy: callers — increasingly autonomous agents with their own wallets — pay per request in SOL with ~0.4s settlement, while GPU operators earn SOL serving inference and contributing GPU cycles on the cheapest DePIN hardware. It bundles a FastAPI gateway, a Python client SDK with OpenAI compatibility, and a federation runtime implementing FedAvg, FedProx, FedAdam, and SCAFFOLD.
The gaps centralized inference can't close.
The problem
Agents make more inference calls than humans, at thinner margins, and increasingly hold their own wallets — but centralized APIs bill monthly against seat licenses, not per call. They can't prove your prompt is unreadable to the operator, and idle DePIN GPUs earn nothing between jobs.
What SolanaLM does
Per-request SOL micropayments with sub-second finality make machine-to-machine inference practical — an agent funds a session and pays as it calls. Operators monetize the cheapest DePIN GPUs across inference and federated training, and every payment leaves an on-chain audit trail.
Why it's practical
OpenAI-compatible endpoints mean existing apps and agent frameworks switch with a base-URL change. A standard Python stack — FastAPI, Postgres, Redis, Prometheus — plus Docker Compose and Kubernetes manifests make it deployable, not just theoretical.
Built for paid inference on hardware you don't own.
On-chain payment and DePIN compute are only useful if the stack ships the boring operational pieces too. SolanaLM bundles them in.
See the full feature breakdown →Multi-backend inference
One API across PyTorch/Transformers, llama.cpp, and proxied OpenAI, Anthropic, Cohere, or Ollama. Switch backends without changing client code.
Federated learning that ships
FedAvg, FedProx, FedAdam, and SCAFFOLD implementations with non-IID data handling, circuit breakers, and automatic recovery on dropped clients.
Privacy-preserving inference
Optional 3-hop onion routing for confidential prompts and differential privacy on gradient updates. Sensitive workloads stop leaking metadata.
OpenAI-compatible gateway
Drop-in replacement for the OpenAI client. Point base_url at the gateway, pass a Solana wallet as the API key, and existing apps — or autonomous agents — work unchanged. Compatibility is the on-ramp to on-chain inference.
Machine-payable settlement on Solana
Per-request SOL micropayments with sub-second finality and ~$0.00025 fees — settlement built for agents that pay per call, not per invoice. Operators get paid on every served request and every training round; every payment leaves an on-chain audit trail.
Real observability
Prometheus metrics, WebSocket admin dashboard, structured request tracing, and a Textual TUI. Diagnose hot nodes and slow clients without grepping logs.
Runs on cheap DePIN GPUs
Nodes are just containers that phone home to the registry, so they drop straight onto DePIN GPU networks (io.net, Akash, Render, Nosana) or marketplace/spot GPUs (Vast.ai, RunPod). Turn the cheapest idle inference-capable hardware into SOL revenue.
On-chain audit trail, verifiable next
Every request and payout is anchored to an on-chain audit trail today. The roadmap moves from "trust the operator" toward verifiable inference — signed attestation of which model produced a result, then sampled re-execution, then cryptographic proofs.
Gateway, registry, nodes. No magic.
A FastAPI gateway handles auth, rate limits, and routing. The node registry tracks health and capacity with circuit breakers. Inference and training nodes plug in via a uniform backend interface — local Torch, llama.cpp, or proxied providers, with the same wire protocol.
- · JWT + Solana signature auth, per-route rate limits
- · Prometheus, structured logs, real-time WebSocket dashboard
- · SQLAlchemy 2 + asyncpg, Redis cache, Alembic migrations
- · Docker Compose for dev, Kubernetes HPA/VPA for prod
Client SDK ─▶ Gateway API ─▶ Node Registry
│ │
▼ ▼
Auth / Rate Health / Routing
Audit Logs Circuit Breakers
│
┌────────────────────┼────────────────────┐
▼ ▼ ▼
Inference Training Proxy
PyTorch · GGUF FedAvg · FedProx OpenAI
Transformers SCAFFOLD · DP Anthropic What people build on SolanaLM.
Privacy-preserving inference
Route confidential prompts through onion circuits so no single node sees both source and content.
DePIN GPU compute that earns
Put idle DePIN or spot GPUs to work as an OpenAI-compatible inference node — dual SOL revenue from inference requests and federated training rounds.
Federated model training
Coordinate training across nodes that never share raw data, with FedAvg, FedProx, FedAdam, and SCAFFOLD.
Machine-payable inference for agents
Give an autonomous agent an OpenAI-compatible endpoint it can pay for per call in SOL — point the existing SDK at the gateway, keep your app code unchanged.
How SolanaLM is different.
Bittensor
The largest decentralized AI subnet network.
Akash Network
Decentralized GPU compute marketplace.
Together AI
Centralized inference and fine-tuning provider.
Ollama
Local-first LLM runtime for a single machine.
Latest writing.
Running a SolanaLM node: real numbers from week one
Field notes from running an inference node for a week. Hardware, hours, payouts, and the operational reality that nobody puts in marketing copy.
The threat model for onion-routed LLM inference
Privacy-preserving inference sounds great in marketing copy. The honest engineering question is: what attacks does the 3-hop onion circuit actually stop, and what does it not?
OpenAI API compatibility is a distribution strategy, not an integration
Every decentralized inference network has to answer: how does an existing application start using us? Speaking OpenAI's schema is the cheapest, most honest answer.
Questions, answered.
Do I need to know Solana to run a node? +
No. You need a wallet to receive payouts, but the node software handles signing, registry, and settlement. The quick-start script provisions a testnet wallet for development.
Is SolanaLM OpenAI API compatible? +
Yes. The gateway exposes /v1/chat/completions and /v1/completions matching OpenAI’s schema. Point the OpenAI SDK at the gateway URL and pass your Solana wallet address as the api_key.
What models can I serve? +
Anything PyTorch/Transformers supports, anything llama.cpp can load (GGUF), or anything reachable through OpenAI/Anthropic/Cohere/Ollama backends. You declare available models in node config.
How does privacy-preserving inference work? +
You can route a request through a 3-hop onion circuit so no single node sees both the prompt source and the prompt content. Combined with differential privacy on federated rounds, sensitive data stops leaking.
Everything on SolanaLM, one hop away.
The whole site, grouped so you — or your crawler — can go straight to the page you need.
Features
Full breakdown across inference, federated learning, privacy, settlement, and observability.
Architecture
Gateway, registry, nodes, privacy layer, and the full request lifecycle.
Quickstart
Clone, install, configure a node, and make your first OpenAI-compatible request.
Use cases
Private inference, monetizing idle GPUs, federated training, OpenAI drop-in replacement.
Comparisons
How SolanaLM stacks up against Bittensor, Akash, Together AI, and Ollama.
Blog
Engineering deep dives on federated learning, Solana micropayments, and privacy.
Glossary
Key SolanaLM, inference, and Solana-settlement terms defined in plain language.
About
The mission, the thesis, and the team building SolanaLM.
Point a DePIN GPU at it. Get paid in SOL.
Clone the repo, run poetry install, and your node joins the registry on its first heartbeat — on io.net, Akash, Vast.ai, or hardware you already own.