|
|
--- |
|
|
license: mit |
|
|
tags: |
|
|
- recursive-reasoning |
|
|
- solana-os |
|
|
- blockchain-ai |
|
|
- tiny-model |
|
|
- question-answering |
|
|
- trm |
|
|
- token-gated |
|
|
- defi-ai |
|
|
datasets: |
|
|
- solana-qa |
|
|
language: |
|
|
- en |
|
|
metrics: |
|
|
- accuracy |
|
|
- perplexity |
|
|
library_name: pytorch |
|
|
pipeline_tag: text-generation |
|
|
--- |
|
|
|
|
|
<div align="center"> |
|
|
|
|
|
# π§ SOLANA $OS |
|
|
|
|
|
### The Neural Operating System for Solana |
|
|
|
|
|
``` |
|
|
βββββββ ββββββββ |
|
|
βββββββββββββββββ |
|
|
βββ βββββββββββ |
|
|
βββ βββββββββββ |
|
|
βββββββββββββββββ |
|
|
βββββββ ββββββββ |
|
|
``` |
|
|
|
|
|
**Recursive Intelligence β’ Token-Gated Inference β’ Autonomous Agents** |
|
|
|
|
|
[](https://pump.fun/DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump) |
|
|
[](https://arxiv.org/abs/2510.04871) |
|
|
[](https://opensource.org/licenses/MIT) |
|
|
[](https://pytorch.org/) |
|
|
|
|
|
--- |
|
|
|
|
|
### π Token Contract Address |
|
|
|
|
|
``` |
|
|
``` |
|
|
|
|
|
[Buy on Pump.fun](https://pump.fun/DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump) β’ [DexScreener](https://dexscreener.com/solana/DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump) β’ [Birdeye](https://birdeye.so/token/DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump) |
|
|
|
|
|
</div> |
|
|
|
|
|
--- |
|
|
|
|
|
## π What is Solana $OS? |
|
|
|
|
|
**Solana $OS** is a token-gated AI infrastructure layer combining a **3.5M parameter Tiny Recursive Model (TRM)** with blockchain-native utility. It powers intelligent Solana development assistance, autonomous agents, and on-chain AI inference. |
|
|
|
|
|
``` |
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
|
|
β SOLANA $OS ECOSYSTEM β |
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ |
|
|
β β |
|
|
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β |
|
|
β β $OS TRM βββββΆβ CLAWDBOT βββββΆβ INFERENCE β β |
|
|
β β Model β β Agent β β API β β |
|
|
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β |
|
|
β β β β β |
|
|
β ββββββββββββββββββββΌβββββββββββββββββββ β |
|
|
β βΌ β |
|
|
β βββββββββββββββ β |
|
|
β β $OS TOKEN β β |
|
|
β β UTILITY β β |
|
|
β βββββββββββββββ β |
|
|
β β |
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## π° $OS Token Utility |
|
|
|
|
|
The **$OS token** unlocks access to the entire Solana OS ecosystem: |
|
|
|
|
|
### π« Tier System |
|
|
|
|
|
| Tier | $OS Holdings | Benefits | |
|
|
|------|-------------|----------| |
|
|
| π₯ **Bronze** | 10,000 $OS | 100 inference calls/day | |
|
|
| π₯ **Silver** | 100,000 $OS | 1,000 inference calls/day + Clawdbot basic | |
|
|
| π₯ **Gold** | 500,000 $OS | 5,000 inference calls/day + Clawdbot pro | |
|
|
| π **Diamond** | 1,000,000+ $OS | Unlimited + Clawdbot autonomous + API keys | |
|
|
|
|
|
### π Access Methods |
|
|
|
|
|
**1. Hold to Access (Recommended)** |
|
|
Simply hold $OS tokens in your connected wallet to unlock tier benefits automatically. |
|
|
|
|
|
**2. Burn for Credits** |
|
|
Burn $OS tokens to receive permanent inference credits: |
|
|
- 1,000 $OS burned = 500 inference credits (never expire) |
|
|
|
|
|
**3. Stake for Premium** |
|
|
Stake $OS to earn yield while maintaining access: |
|
|
- Staked tokens count toward tier qualification |
|
|
- Earn additional $OS from protocol fees |
|
|
|
|
|
--- |
|
|
|
|
|
## π€ Clawdbot Integration |
|
|
|
|
|
**Clawdbot** is an autonomous AI agent powered by Solana $OS, capable of: |
|
|
|
|
|
```typescript |
|
|
// Clawdbot Capabilities |
|
|
interface ClawdbotFeatures { |
|
|
// Solana Development |
|
|
codeAnalysis: "Smart contract review & optimization"; |
|
|
pdaGeneration: "Generate PDAs with derivation paths"; |
|
|
txBuilder: "Construct & simulate transactions"; |
|
|
|
|
|
// Autonomous Actions |
|
|
portfolioMonitor: "Track & alert on positions"; |
|
|
dexAggregation: "Find optimal swap routes"; |
|
|
yieldFarming: "Auto-compound strategies"; |
|
|
|
|
|
// Intelligence |
|
|
marketAnalysis: "Real-time sentiment & signals"; |
|
|
contractAudit: "Security vulnerability detection"; |
|
|
documentation: "Auto-generate project docs"; |
|
|
} |
|
|
``` |
|
|
|
|
|
### Clawdbot Access Tiers |
|
|
|
|
|
| Feature | Silver | Gold | Diamond | |
|
|
|---------|--------|------|---------| |
|
|
| Q&A Responses | β
| β
| β
| |
|
|
| Code Analysis | β
| β
| β
| |
|
|
| Transaction Building | β | β
| β
| |
|
|
| Autonomous Monitoring | β | β | β
| |
|
|
| Custom Agent Training | β | β | β
| |
|
|
| API Access | β | β | β
| |
|
|
|
|
|
--- |
|
|
|
|
|
## π§ Model Architecture |
|
|
|
|
|
Solana $OS is built on the **Tiny Recursive Model (TRM)** architecture: |
|
|
|
|
|
``` |
|
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
|
|
β TRM-SOLANA-OS ARCHITECTURE β |
|
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ |
|
|
β β |
|
|
β Input: "What is a PDA?" β |
|
|
β β β |
|
|
β βΌ β |
|
|
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β |
|
|
β β BYTE-LEVEL TOKENIZATION β β |
|
|
β β (UTF-8 β 258 vocab tokens) β β |
|
|
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β |
|
|
β β β |
|
|
β βΌ β |
|
|
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β |
|
|
β β RECURSIVE REASONING CORE β β |
|
|
β β βββββββββββββββββββββββββββββββββββββββββββ β β |
|
|
β β β H-Cycle 1 βββΆ H-Cycle 2 β β β |
|
|
β β β β β β β β |
|
|
β β β βΌ βΌ β β β |
|
|
β β β L-Cycle 1,2 L-Cycle 1,2 β β β |
|
|
β β βββββββββββββββββββββββββββββββββββββββββββ β β |
|
|
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β |
|
|
β β β |
|
|
β βΌ β |
|
|
β Output: Refined Solana expertise β |
|
|
β β |
|
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
|
|
``` |
|
|
|
|
|
### Specifications |
|
|
|
|
|
| Component | Value | |
|
|
|-----------|-------| |
|
|
| **Parameters** | 3.5M (~1/1000th of GPT-3) | |
|
|
| **Layers (L)** | 1 transformer layer | |
|
|
| **High-level cycles (H)** | 2 reasoning iterations | |
|
|
| **Low-level cycles (L)** | 2 refinement iterations | |
|
|
| **Vocabulary** | 258 tokens (byte-level) | |
|
|
| **Max Sequence** | 512 tokens | |
|
|
| **Inference** | CPU/MPS/GPU compatible | |
|
|
| **Memory** | <1GB during inference | |
|
|
|
|
|
--- |
|
|
|
|
|
## π Quick Start |
|
|
|
|
|
### 1. Connect Wallet & Verify Holdings |
|
|
|
|
|
```typescript |
|
|
import { Connection, PublicKey } from '@solana/web3.js'; |
|
|
import { getAssociatedTokenAddress, getAccount } from '@solana/spl-token'; |
|
|
|
|
|
const OS_TOKEN_MINT = new PublicKey('DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump'); |
|
|
|
|
|
async function checkOSBalance(walletPubkey: PublicKey): Promise<number> { |
|
|
const connection = new Connection('https://api.mainnet-beta.solana.com'); |
|
|
|
|
|
const ata = await getAssociatedTokenAddress(OS_TOKEN_MINT, walletPubkey); |
|
|
|
|
|
try { |
|
|
const account = await getAccount(connection, ata); |
|
|
return Number(account.amount) / 1e6; // Assuming 6 decimals |
|
|
} catch { |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
function getTier(balance: number): string { |
|
|
if (balance >= 1_000_000) return 'diamond'; |
|
|
if (balance >= 500_000) return 'gold'; |
|
|
if (balance >= 100_000) return 'silver'; |
|
|
if (balance >= 10_000) return 'bronze'; |
|
|
return 'none'; |
|
|
} |
|
|
``` |
|
|
|
|
|
### 2. API Inference |
|
|
|
|
|
```typescript |
|
|
// Token-gated inference endpoint |
|
|
const response = await fetch('https://api.solana-os.ai/v1/inference', { |
|
|
method: 'POST', |
|
|
headers: { |
|
|
'Content-Type': 'application/json', |
|
|
'X-Wallet-Address': walletAddress, |
|
|
'X-Signature': signedMessage, // Prove wallet ownership |
|
|
}, |
|
|
body: JSON.stringify({ |
|
|
question: 'How do I create a PDA in Anchor?', |
|
|
model: 'trm-solana-os-v1', |
|
|
max_tokens: 512, |
|
|
}), |
|
|
}); |
|
|
|
|
|
const { answer, tokens_used, remaining_calls } = await response.json(); |
|
|
``` |
|
|
|
|
|
### 3. Clawdbot Discord/Telegram |
|
|
|
|
|
``` |
|
|
# Discord Commands (Silver+ tier) |
|
|
/clawdbot ask "What is rent exemption in Solana?" |
|
|
/clawdbot analyze <contract_address> |
|
|
/clawdbot build-tx transfer 1 SOL to <address> |
|
|
|
|
|
# Telegram Commands |
|
|
/ask What are CPIs? |
|
|
/audit <program_id> |
|
|
/monitor <token_address> |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## π§ Self-Hosted Inference |
|
|
|
|
|
For Diamond tier holders, run the model locally: |
|
|
|
|
|
### Installation |
|
|
|
|
|
```bash |
|
|
# Clone the repository |
|
|
git clone https://github.com/8bitlabs/solana-os-model |
|
|
cd solana-os-model |
|
|
|
|
|
# Install dependencies |
|
|
pip install torch transformers huggingface_hub numpy |
|
|
|
|
|
# Download model |
|
|
python scripts/download_model.py --token YOUR_HF_TOKEN |
|
|
``` |
|
|
|
|
|
### Local Inference |
|
|
|
|
|
```python |
|
|
import torch |
|
|
import numpy as np |
|
|
from huggingface_hub import hf_hub_download |
|
|
from models.trm import TinyRecursiveReasoningModel |
|
|
|
|
|
# Download checkpoint |
|
|
checkpoint_path = hf_hub_download( |
|
|
repo_id="ordlibrary/trm-solana-v1", |
|
|
filename="model.pt" |
|
|
) |
|
|
|
|
|
# Load model |
|
|
checkpoint = torch.load(checkpoint_path, map_location='cpu') |
|
|
model = TinyRecursiveReasoningModel(**checkpoint['config']['arch']) |
|
|
model.load_state_dict(checkpoint['model_state_dict']) |
|
|
model.eval() |
|
|
|
|
|
# Byte-level encoding |
|
|
def encode(text: str, max_len: int = 512) -> torch.Tensor: |
|
|
bytes_arr = np.frombuffer(text.encode('utf-8'), dtype=np.uint8) |
|
|
tokens = (bytes_arr + 2).astype(np.uint8) |
|
|
seq = np.zeros(max_len, dtype=np.uint8) |
|
|
seq[:min(len(tokens), max_len-1)] = tokens[:max_len-1] |
|
|
seq[min(len(tokens), max_len-1)] = 1 # EOS |
|
|
return torch.tensor(seq).unsqueeze(0) |
|
|
|
|
|
def decode(tokens: torch.Tensor) -> str: |
|
|
tokens = tokens.squeeze().numpy() |
|
|
tokens = tokens[tokens > 1] - 2 # Remove PAD/EOS, unshift |
|
|
return bytes(tokens).decode('utf-8', errors='replace') |
|
|
|
|
|
# Inference |
|
|
question = "What is a Program Derived Address (PDA) in Solana?" |
|
|
input_tensor = encode(question) |
|
|
|
|
|
with torch.no_grad(): |
|
|
output = model(input_tensor) |
|
|
answer = decode(output.argmax(dim=-1)) |
|
|
print(answer) |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## π Training Details |
|
|
|
|
|
### Dataset |
|
|
|
|
|
| Metric | Value | |
|
|
|--------|-------| |
|
|
| **Total Pairs** | 8,970 Q&A | |
|
|
| **Training Set** | 8,073 (90%) | |
|
|
| **Test Set** | 897 (10%) | |
|
|
| **Topics** | Solana architecture, accounts, programs, transactions, security, DeFi | |
|
|
| **Encoding** | Byte-level UTF-8 | |
|
|
|
|
|
### Training Configuration |
|
|
|
|
|
```yaml |
|
|
# config/training.yaml |
|
|
architecture: |
|
|
L_layers: 1 |
|
|
H_cycles: 2 |
|
|
L_cycles: 2 |
|
|
vocab_size: 258 |
|
|
max_seq_len: 512 |
|
|
|
|
|
training: |
|
|
epochs: 5000 |
|
|
global_batch_size: 64 |
|
|
learning_rate: 1e-4 |
|
|
weight_decay: 0.5 |
|
|
ema_enabled: true |
|
|
ema_rate: 0.999 |
|
|
|
|
|
hardware: |
|
|
device: mps # Apple Silicon |
|
|
training_time: "~4 hours" |
|
|
``` |
|
|
|
|
|
### Performance |
|
|
|
|
|
| Metric | Value | |
|
|
|--------|-------| |
|
|
| Training Loss | ~2.3 | |
|
|
| Test Loss | ~2.5 | |
|
|
| Inference Speed | <100ms | |
|
|
| Memory Usage | <1GB | |
|
|
|
|
|
--- |
|
|
|
|
|
## π― Example Queries |
|
|
|
|
|
The Solana $OS model excels at: |
|
|
|
|
|
``` |
|
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
|
|
β EXAMPLE QUERIES β |
|
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ |
|
|
β β |
|
|
β β "What is a Program Derived Address (PDA)?" β |
|
|
β β "How do Solana transactions differ from Ethereum?" β |
|
|
β β "Explain the Solana account model" β |
|
|
β β "What is rent exemption?" β |
|
|
β β "How do cross-program invocations (CPI) work?" β |
|
|
β β "What is the System Program?" β |
|
|
β β "How does Anchor simplify Solana development?" β |
|
|
β β "What are the security best practices for PDAs?" β |
|
|
β β |
|
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## π‘οΈ Tokenomics |
|
|
|
|
|
``` |
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
|
|
β $OS TOKENOMICS β |
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ |
|
|
β β |
|
|
β Token: $OS β |
|
|
β Contract: DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump β |
|
|
β Chain: Solana β |
|
|
β Standard: SPL Token β |
|
|
β β |
|
|
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β |
|
|
β β UTILITY FLYWHEEL β β |
|
|
β β β β |
|
|
β β ββββββββββββ β β |
|
|
β β β HOLD ββββββββββββββββββββ β β |
|
|
β β β $OS β β β β |
|
|
β β ββββββ¬ββββββ β β β |
|
|
β β β β β β |
|
|
β β βΌ β β β |
|
|
β β ββββββββββββ βββββββ΄βββββ β β |
|
|
β β β ACCESS β β VALUE β β β |
|
|
β β β TIERS β β ACCRUAL β β β |
|
|
β β ββββββ¬ββββββ ββββββββββββ β β |
|
|
β β β β² β β |
|
|
β β βΌ β β β |
|
|
β β ββββββββββββ βββββββ΄βββββ β β |
|
|
β β β USE βββββββββββββΆβ DEMAND β β β |
|
|
β β β SERVICESβ β GROWS β β β |
|
|
β β ββββββββββββ ββββββββββββ β β |
|
|
β β β β |
|
|
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β |
|
|
β β |
|
|
β Revenue Streams: β |
|
|
β β’ Inference API fees β 50% to stakers β |
|
|
β β’ Clawdbot premium features β 30% buyback & burn β |
|
|
β β’ Enterprise licensing β Treasury β |
|
|
β β |
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## π Integration Examples |
|
|
|
|
|
### Next.js App Router |
|
|
|
|
|
```typescript |
|
|
// app/api/inference/route.ts |
|
|
import { NextRequest, NextResponse } from 'next/server'; |
|
|
import { verifyWalletSignature, checkTier } from '@/lib/auth'; |
|
|
|
|
|
export async function POST(req: NextRequest) { |
|
|
const { question, walletAddress, signature } = await req.json(); |
|
|
|
|
|
// Verify wallet ownership |
|
|
const isValid = await verifyWalletSignature(walletAddress, signature); |
|
|
if (!isValid) { |
|
|
return NextResponse.json({ error: 'Invalid signature' }, { status: 401 }); |
|
|
} |
|
|
|
|
|
// Check $OS holdings |
|
|
const tier = await checkTier(walletAddress); |
|
|
if (tier === 'none') { |
|
|
return NextResponse.json({ |
|
|
error: 'Insufficient $OS holdings', |
|
|
required: 10000, |
|
|
contract: 'DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump' |
|
|
}, { status: 403 }); |
|
|
} |
|
|
|
|
|
// Process inference |
|
|
const answer = await runInference(question); |
|
|
|
|
|
return NextResponse.json({ answer, tier }); |
|
|
} |
|
|
``` |
|
|
|
|
|
### React Hook |
|
|
|
|
|
```typescript |
|
|
// hooks/useSolanaOS.ts |
|
|
import { useWallet } from '@solana/wallet-adapter-react'; |
|
|
import { useState } from 'react'; |
|
|
|
|
|
export function useSolanaOS() { |
|
|
const { publicKey, signMessage } = useWallet(); |
|
|
const [loading, setLoading] = useState(false); |
|
|
|
|
|
const askQuestion = async (question: string) => { |
|
|
if (!publicKey || !signMessage) { |
|
|
throw new Error('Wallet not connected'); |
|
|
} |
|
|
|
|
|
setLoading(true); |
|
|
|
|
|
try { |
|
|
// Sign message to prove ownership |
|
|
const message = new TextEncoder().encode(`Solana OS: ${Date.now()}`); |
|
|
const signature = await signMessage(message); |
|
|
|
|
|
const response = await fetch('/api/inference', { |
|
|
method: 'POST', |
|
|
headers: { 'Content-Type': 'application/json' }, |
|
|
body: JSON.stringify({ |
|
|
question, |
|
|
walletAddress: publicKey.toBase58(), |
|
|
signature: Buffer.from(signature).toString('base64'), |
|
|
}), |
|
|
}); |
|
|
|
|
|
return await response.json(); |
|
|
} finally { |
|
|
setLoading(false); |
|
|
} |
|
|
}; |
|
|
|
|
|
return { askQuestion, loading }; |
|
|
} |
|
|
``` |
|
|
|
|
|
--- |
|
|
|
|
|
## β οΈ Limitations |
|
|
|
|
|
| Limitation | Description | |
|
|
|------------|-------------| |
|
|
| **Domain Specific** | Trained only on Solana content | |
|
|
| **Knowledge Cutoff** | Limited to training data timeframe | |
|
|
| **Not for Audits** | Do not use for production security audits | |
|
|
| **English Only** | Trained exclusively on English data | |
|
|
| **Q&A Format** | Optimized for questions, not conversations | |
|
|
|
|
|
--- |
|
|
|
|
|
## π License |
|
|
|
|
|
MIT License - Open source and free to use. |
|
|
|
|
|
--- |
|
|
|
|
|
## π Acknowledgments |
|
|
|
|
|
- **Alexia Jolicoeur-Martineau** - TRM Architecture |
|
|
- **Solana Foundation** - Documentation & Ecosystem |
|
|
- **OrdLibrary** - Original model training |
|
|
- **8bit Labs** - $OS Token Integration |
|
|
|
|
|
--- |
|
|
|
|
|
## π Resources |
|
|
|
|
|
| Resource | Link | |
|
|
|----------|------| |
|
|
| π TRM Paper | [arXiv:2510.04871](https://arxiv.org/abs/2510.04871) | |
|
|
| π» TRM Code | [GitHub](https://github.com/AlexiaJM/TinyRecursiveModels) | |
|
|
| π€ Model | [HuggingFace](https://huggingface.co/ordlibrary/trm-solana-v1) | |
|
|
| π Solana Docs | [docs.solana.com](https://docs.solana.com) | |
|
|
| π Buy $OS | [Pump.fun](https://pump.fun/DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump) | |
|
|
|
|
|
--- |
|
|
|
|
|
<div align="center"> |
|
|
|
|
|
## π Get $OS Now |
|
|
|
|
|
``` |
|
|
DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump |
|
|
``` |
|
|
|
|
|
**[Pump.fun](https://pump.fun/DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump)** β’ **[DexScreener](https://dexscreener.com/solana/DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump)** β’ **[Birdeye](https://birdeye.so/token/DrU9M6SUaXWua49zeaHQWJuwMpcZ4jMDRT3J5Ywpump)** |
|
|
|
|
|
--- |
|
|
|
|
|
**Built by [8bit Labs](https://8bitlabs.ai) for the Solana ecosystem** |
|
|
|
|
|
*The Neural Operating System for Solana* |
|
|
|
|
|
</div> |