File size: 21,379 Bytes
60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 7466d33 ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c 60e554c ebd633c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
---
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/)
---
```
## π 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> |