Skip to content

Solizardking/nemo-clawd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nemoclawd
Solana x xAI Agentic Trading Engine — Powered by $CLAWD
🔥 HISTORIC MILESTONE: First Wallet-Bearing LLM Now Live
ordlibrary/clawd-trading-wallet — A Qwen2.5-1.5B model that carries its own encrypted Solana wallet

8cHzQHUS2s2h8TzCmfqPKYiM4dSt4roa3n7MyRLApump

npm License Status Solana xAI Grok MCP Tools Multi-Agent Tests Node


  ╔══════════════════════════════════════════════════════════════╗
  ║    ╱⌒╲                              ╱⌒╠══                    ║
  ║   ( 🦞 )   █▀▀▀ █▄░█ █▀▄▀█ █▀▀▀   ( 🦞 )  LOBSTER          ║
  ║    ╲╱      █░▀█ █░▀█ █░▀░█ ██▀    ╲╱                       ║
  ║           ▀▀▀▀▀ ▀░░▀ ▀░░░▀ ▀▀▀                              ║
  ║    ──────────────────────────────────────────────────────    ║
  ║    ░▄░ █▀▀█ █▀▄▀█ ▀█▀ █▀▀█   █▀▀█ █░░ █▀▀ █░█ █▀▀▄        ║
  ║    ▀▄▀ █░░█ █░▀░█ ░█░ █░░█   █▄▄▀ █░░ █▀▀ ▄▀▄ █░░█        ║
  ║    ▀░▀ ▀▀▀▀ ▀░░░▀ ░▀░ ▀▀▀▀   ▀░▀▀ ▀▀▀ ▀▀▀ ▀░▀ ▀▀▀░        ║
  ║    ──────────────────────────────────────────────────────    ║
  ║    🦞  Solana × xAI  |  Agentic Trading Engine  |  $CLAWD  🦞   ║
  ╚══════════════════════════════════════════════════════════════╝


🎬 FIRE IT UP — GET NEMOCLAWD RUNNING LOCALLY 🔥

Three commands. One lobster. Infinite possibilities.

# 🎯 Step 1 — Global install (one-and-done)
sudo npm install -g @mawdbotsonsolana/nemoclawd

# 🚀 Step 2 — Launch with Grok + Solana tools
nemoclawd launch

# 🌀 Step 3 — Watch it go
nemoclawd demo
📋 👇 Or run straight from the repo (dev mode, no install needed)
git clone https://github.com/Solizardking/nemo-clawd.git
cd nemo-clawd

# Node.js v25.6.1+ required
node --version   # ✓ should be ≥20

# Dependencies already locked
npm install

# TypeScript → dist/ (it's fast, trust me)
npm run build:plugin

# 🩺 Doctor's in the house — verify everything
node bin/nemoclawd.js doctor

# Expected output:
#   Nemo Clawd doctor
#     Node.js: v25.6.1
#     Package: @mawdbotsonsolana/nemoclawd@0.5.0
#     DFlow: development: spot https://dev-quote-api.dflow.net/order, ...
#     OK

# 🧪 84 tests. Zero failures. Every time.
npm test

# ✨ Output:
#   ℹ tests 84
#   ℹ suites 24
#   ℹ pass 84
#   ℹ fail 0
#   ℹ duration_ms ~1680
# ⚡ One-line install with Node.js, GPU support, and everything
curl -fsSL https://raw.githubusercontent.com/Solizardking/nemo-clawd/main/install.sh | bash

🛟 Stuck? Run node bin/nemoclawd.js doctor for a health check.


🦞 WHAT IS NEMOCLAWD? 🦞

A Solana-native, xAI Grok-powered agentic trading engine that thinks, trades, chats, sees, speaks, and evolves — all powered by the $CLAWD token.

8cHzQHUS2s2h8TzCmfqPKYiM4dSt4roa3n7MyRLApump


🚀 Capability 🤯 What it does
xAI Grok Integration 4–16 Grok agents with web + X search, chat, vision, image gen, voice
$CLAWD Token Solana + Pump.fun native — your lobster's blood is crypto
31 MCP Tools Solana market data, trading, NFTs, Helius RPC/DAS, Pump.fun SDK
Multi-Agent Research Grok agent swarms collaborating in real-time
Blockchain Buddies 🧸 18 procedurally-generated species with trading personalities
Voice Mode 🎙️ xAI Grok Voice Agent API — text-to-speech, speech-to-text, custom voices
Telegram Bot 🤖 60+ commands — sniping, alerts, trading, research
DFlow Routing 🔀 Spot swaps + prediction markets, dev or production
ZK Primitives 🔐 Model attestations, nullifiers, Groth16 proofs, compressed-state helpers
Pump.fun Integration 🎯 Bonding curves, token scanning, buy/sell quoting, graduations
47 Spinner Packs 🎨 Developer, pirate, shakespeare, gordon-ramsay, bob-ross, yoda… yes, really
12 Core AI Packages 📦 Helius MCP, Clawd Code, Clawd Grok, perps agent, knowledge base
84/84 Tests Passing Every push. Every PR. Every time.
Node.js v25.6.1 🟢 Latest and greatest runtime

🤘 DOES IT WORK ON MY MACHINE? 🤘

Verified. Tested. Green across the board. Here's the proof 👇

# 🩺 RUN THE DOCTOR
node bin/nemoclawd.js doctor

# ── Output ──────────────────────────────────────────────────
# Nemo Clawd doctor
#   Node.js: v25.6.1              ✅ Latest
#   Package: @mawdbotsonsolana/nemoclawd@0.5.0  ✅ Installed
#   DFlow: dev endpoints active   ✅ Routing ready
#   OK                            ✅ All clear
# ─────────────────────────────────────────────────────────────

# 🌊 CHECK DFLOW ROUTING
node bin/nemoclawd.js dflow status

# ── Output ──────────────────────────────────────────────────
# DFlow routing
#   Mode:        development       ✅ Dev endpoints live
#   Spot:        https://dev-quote-api.dflow.net/order
#   Predictions: endpoint active   ✅ Prediction markets ready
# ─────────────────────────────────────────────────────────────

# 📦 CORE AI BUNDLE — ALL 12 PACKAGES PRESENT
node bin/nemoclawd.js core-ai status

# ── Output ──────────────────────────────────────────────────
# Core AI bundle
#   Present:  yes                  ✅ Bundle found
#   Packages: 12/12                ✅ All accounted for
#   Versions: helius@1.1.1, clawd-code@1.0.0, ai-training@1.0.0 ...
# ─────────────────────────────────────────────────────────────

# 🎨 SPINNER PACKS — 47 THEMES
node bin/nemoclawd.js spinners list
# Outputs: 90s-kid, pirate, shakespeare, yoda, gordon-ramsay, 
#          bob-ross, zombie, ninja, space, startup, meme ... 47 total ✅

# 🧪 FULL TEST SUITE — 84/84 PASSING
npm test
# ℹ tests 84 | ℹ pass 84 | ℹ fail 0 | ℹ duration_ms ~1680 ✅

# 🏗️ TYPESCRIPT COMPILES CLEAN
npm run build:plugin
# tsc → exit 0, zero errors ✅

# 🪄 MAGIC ROUTER DEMO
node bin/nemoclawd.js magic-router "check solana price"

# ── Output ──────────────────────────────────────────────────
#  🪄  Magic Router v2.0.0 — Decision Trace
#  ────────────────────────────────────────────────
#
#  🧠  Task Classification
#     Input type:    General Purpose
#     Confidence:    60%
#     Description:   Chat, Q&A, brainstorming, creative writing, anything else
#
#  ⚡  Performance Profile
#     Latency:       fast
#     Requires key:  no
#     Needs wallet:  no
#
#  🧠  Inference Route
#     Primary:       ✅ ollama-local / hf.co/ordlibrary/hauhau-qwen36-onchain
#     Credential:    $OLLAMA_HOST
#     Fallback:      ❌ openrouter / openrouter/auto
#     Fallback:      ❌ nvidia-nim / nvidia/nemotron-3-ultra-550b-a55b
#
#  🛠️  Tool Set (2)
#     • chat
#     • web-search
#
#  🛡️  Guardrails
#     ✓ least-privilege-tools
#     ✓ read-only-before-signing
#     ✓ explicit-approval-before-wallet-actions
#     ✓ no-private-key-or-seed-phrase-handling
#
#  🔀  DFlow Routing
#     Spot trading:           ✅ enabled
#     Prediction markets:     ✅ enabled
#     Credential:             $DFLOW_API_KEY
# ─────────────────────────────────────────────────────────────
# ▶ Also try:
#   nemoclawd magic-router "audit this smart contract for rug risk"
#   nemoclawd magic-router "buy a Kalshi YES token on the election"
#   nemoclawd magic-router "generate a Solana meme image"
#   nemoclawd magic-router "show me my wallet PnL and portfolio"
#   nemoclawd magic-router "check the floor price of my NFT collection"

⚡ ONE-SHOT INSTALL ⚡

sudo npm install -g @mawdbotsonsolana/nemoclawd

# Start with Grok + Solana tools
nemoclawd launch

# Run demo walkthrough
nemoclawd demo

Need Node.js 20+? The bundled install.sh handles everything — Node.js via nvm, optional GPU/Ollama support, and the CLI — in a single command:

curl -fsSL https://raw.githubusercontent.com/Solizardking/nemo-clawd/main/install.sh | bash

Quick Start

npm install -g @mawdbotsonsolana/nemoclawd

# Start with Grok + Solana tools
nemoclawd launch

# Run demo walkthrough
nemoclawd demo

🧰 CLI COMMAND REFERENCE 🧰

📋 Full command tree — expand to explore
nemoclawd 0.5.0

Getting Started
  nemoclawd onboard              🚀 Configure and launch a Solana-native sandbox
  nemoclawd launch               🚀 Alias for onboard
  nemoclawd doctor [--fix]       🩺 Check local prerequisites
  nemoclawd env status           🔍 Show masked local .env worker status
  nemoclawd setup-orin-nano      🧊 Prepare Jetson Orin Nano for OpenShell
  nemoclawd demo                 📺 Print a quick demo command
  nemoclawd birth                🧸 Create a Blockchain Buddy
  nemoclawd spinners             🎨 List or install custom spinner verb packs
  nemoclawd core-ai status       📦 Show bundled Core AI integration status

DFlow Routing
  nemoclawd dflow status         🔀 Show spot and prediction-market routing

Magic Router
  nemoclawd magic-router <task>  🪄 Pick provider/model/tools for a task
  nemoclawd magic-router --json <task>

Solana
  nemoclawd solana               🌊 Show Solana runtime overview
  nemoclawd solana start [name]  ⚡ Start the Solana operator stack
  nemoclawd wallet status        👛 Show wallet and RPC status
  nemoclawd wallet list          📋 List local agent wallets
  nemoclawd wallet create        🔑 Create a Privy Solana wallet

Sandbox Management
  nemoclawd list                 📋 List known sandboxes
  nemoclawd <name> connect       🔌 Open a shell inside a sandbox
  nemoclawd <name> status        📊 Show sandbox status
  nemoclawd <name> logs          📝 Show sandbox logs
  nemoclawd <name> destroy       💥 Delete a sandbox
  nemoclawd <name> solana-stack  ⛓️ Start bundled Solana services
  nemoclawd <name> solana-agent  🤖 Start the Solana tracker bot
  nemoclawd <name> solana-bridge 🌉 Start the Telegram/Solana bridge
  nemoclawd <name> telegram-bot  ✉️ Start the Telegram bot runtime
  nemoclawd <name> payment-app   💳 Start the Solana payment app

Policy Presets
  nemoclawd policies list        📜 List available network policy presets
  nemoclawd policies apply <sandbox> <preset>

Internal Runtime
  nemoclawd models set <model>   🧠 Set inference model
  nemoclawd devices list --json  📱 List paired/pending devices
  nemoclawd devices approve <id> ✅ Approve a device
  nemoclawd plugins install <path> 🔌 Install a plugin
  nemoclawd gateway run          🌐 Start the HTTP gateway

🌊 SOLANA-CLAWD INTEGRATION 🌊

nemoclawd integrates solana-clawd — the full xAI Grok-powered agentic framework for Solana trading, research, and autonomous agent operations.

┌─────────────────────────────────────────────────────────────────────────────┐
│                                                                             │
│   🧠 xAI Grok Integration ──── 4-16 Grok agents with web + X search        │
│   │                         Chat, vision, image gen, voice                 │
│   │                                                                         │
│   💰 $CLAWD Token ──────────── 8cHzQHUS2s2h8TzCmfqPKYiM4dSt4roa3n7MyRLApump│
│   │                         Solana + Pump.fun native                        │
│   │                                                                         │
│   🛠️  31 MCP Tools ──────────── Solana market data, trading, NFTs           │
│   │                         Helius RPC/DAS, Pump.fun SDK                    │
│   │                                                                         │
│   🔬 Multi-Agent Research ── 4 or 16 Grok agents collaborating             │
│   │                         Deep Solana research + intelligence             │
│   │                                                                         │
│   🧸 Blockchain Buddies ──── 18 species with trading personalities          │
│   │                         Procedurally generated companions               │
│   │                                                                         │
│   🎙️ Voice Mode ─────────────── xAI Grok text-to-speech agent               │
│   │                         Conversational AI + STT + Custom Voices         │
│   │                                                                         │
│   ✉️ Telegram Bot ───────────── 60+ commands for trading + research          │
│   │                         Real-time alerts, sniping, narration            │
│   │                                                                         │
│   🎨 47 Spinner Packs ──────── developer, pirate, yoda, gordon-ramsay...    │
│   │                         Animations for your terminal                    │
│   │                                                                         │
│   📦 12 Core AI Packages ──── Helius, Clawd Code, Grok, perps, MCP...      │
│   │                         Everything bundled and ready                    │
│   │                                                                         │
│   🔐 ZK Primitives ─────────── Attestations, nullifiers, Groth16 proofs     │
│                             Light Protocol compressed-state helpers         │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

🎨 SPINNER PACKS — 47 THEMES & GROWING 🎨

Your terminal's personality starts here. Pick a vibe. Any vibe.

nemoclawd ships the bundled Clawd spinner verb packs from spinners/ and can install them into your local Clawd settings:

nemoclawd spinners list           # See all 47 available packs
nemoclawd spinners install developer  # 🔧 Dev mode forever
nemoclawd spinners install pirate     # 🏴‍☠️ Yarr, yer terminal be speakin' pirate
nemoclawd spinners install yoda       # 🧘 The spinner, install you will
nemoclawd spinners install gordon-ramsay # 🔪 IT'S F***ING RAW CODE
nemoclawd spinners install bob-ross   # 🎨 Happy little loading bars
nemoclawd spinners install zombie     # 🧟 Braaaaains... compiling...
nemoclawd spinners install shakespeare # 🎭 Thou dost compile with great haste
nemoclawd spinners remove          # 🔙 Back to factory settings

The installer writes only the spinnerVerbs field in ~/.clawd/settings.json, falling back to ~/.claude/settings.json when that file already exists.

📋 Full spinner catalog — 47 packs
Pack Vibe
90s-kid 🦖 Tamagotchi meets terminal
blue-collar-dev 👷 Trades and construction humor
bob-ross 🎨 Happy little loading bars
borat 🤡 Very nice! How much?
cat 🐱 Meow
chaos 💥 Absurdist and chaotic humor
coffee ☕ Food and coffee themed
corporate 👔 Let's circle back on this build
cowboy 🤠 Wild West and frontier
darth-vader ⚫ I find your lack of semicolons disturbing
detective 🔍 Noir detective style
developer 🔧 Programming and dev culture
gardening 🌱 Gardening and growing
gordon-ramsay 🔪 IT'S F***ING RAW — angry chef edition
gym-bro 💪 Gym and fitness culture
honest-no-filter 🗣️ Brutally honest dev thoughts
jack-sparrow 🏴‍☠️ Chaotic pirate captain
meme 🦆 Internet memes and viral phrases
michael-scott 📋 That's what she said — The Office edition
minions 🟡 Banana — minion-style humor
motivational 🔥 Hype and motivational phrases
ninja 🥷 Ninja and stealth
ocean 🌊 Ocean and underwater
panicker 😱 Pure dev anxiety
philosophical 🧘 Deep thoughts and philosophy
pirate 🏴‍☠️ Pirate speak — yarr
retro-gaming 🕹️ Retro gaming references
sarcastic-ai 🤖 Self-aware AI humor
sf-entrepreneur 🏢 San Francisco tech scene
shakespeare 🎭 Thou dost compile with great haste
sherlock-holmes 🔎 Deductive reasoning
space 🚀 Space and sci-fi
startup 📈 Startup culture
superhero 🦸 Superhero themed
the-dude 🥃 The Big Lebowski style
therapist 🛋️ Therapy speak and self-care
time-traveler ⏰ Time travel and paradoxes
vibecoder ✨ Vibe coding culture
vim ⌨️ Vim editor enthusiasts — :wq
walter-white 🧪 Breaking Bad, Heisenberg
wholesome 🥹 Wholesome and cozy vibes
wizard 🧙 Fantasy and magic themed
yoda 🧘 The spinner, install you will
zombie 🧟 Braaaaains... compiling...

📦 CORE AI BUNDLE — 12 PACKAGES, ZERO CONFIGURATION 📦

nemoclawd vendors the Clawd Core AI bundle in core-ai/. Every package is pre-bundled, pre-verified, and ready to roll:

nemoclawd core-ai status        # 📊 Show bundle health (12/12 ✓ )
nemoclawd core-ai packages      # 📋 List all packages
nemoclawd core-ai package helius-mcp  # 🔍 Inspect a specific package
nemoclawd core-ai commands      # 🛠️ Available sub-commands

12 packages included:

  helius@1.1.1          ✅ Helius MCP server
  helius-dflow@1.1.1    ✅ DFlow routing integration
  helius-jupiter@1.0.1  ✅ Jupiter swap integration
  helius-okx@1.0.1      ✅ OKX exchange connector
  helius-phantom@1.0.1  ✅ Phantom wallet plugin
  svm@1.0.0             ✅ SVM (Solana Virtual Machine)
  clawd-code@1.0.0      ✅ Clawd Code runtime
  ai-training@1.0.0     ✅ AI training toolkit
  clawd-grok            ✅ Bun-native Grok runtime
  clawd-perps-agent     ✅ Perpetuals trading agent
  pump-mcp-server       ✅ Standalone Pump.fun MCP
  v3-runtime            ✅ V3 runtime scaffolding

Build and setup commands are exposed as root npm scripts:

npm run core-ai:helius-mcp:build
npm run core-ai:helius-cli:build
npm run core-ai:clawd-code:build
npm run core-ai:mcp-server:build

Run the Clawd plugin directly with:

clawd --plugin-dir core-ai/helius-plugin

🧊 JETSON ORIN NANO 🧊

For a single Jetson Orin Nano or Orin Nano Super Developer Kit, use the dedicated Orin path instead of setup-spark:

sudo nemoclawd setup-orin-nano
export NVIDIA_API_KEY="nvapi-..."
nemoclawd onboard
openshell inference set --no-verify --provider nvidia-nim --model nvidia/nemotron-3-ultra-550b-a55b

See docs/deployment/set-up-orin-nano.md.


🔀 DFLOW SPOT AND PREDICTION ROUTING 🔀

DFlow is the default Solana-native route for spot trading and prediction markets. Set DFLOW_API_KEY for production; without it, nemoclawd uses DFlow developer endpoints.

export DFLOW_API_KEY="your_dflow_key"
nemoclawd dflow status
DFlow routing
  Mode:        development                    ✅ Dev endpoints active
  API key env: DFLOW_API_KEY (not set)        🔑 Production needs key
  Spot:        https://dev-quote-api.dflow.net/order     📈
  Book stream: wss://dev-quote-api.dflow.net/book-stream 📊
  Predictions: https://dev-prediction-markets-api.dflow.net 🎯

Spot swaps and prediction outcome-token orders both use DFlow's /order trading endpoint. Prediction market discovery uses the DFlow prediction metadata API.


🔐 ZK PRIMITIVES 🔐

The repository includes zk-primitives/, a Solana-native ZK workspace for model attestations, one-shot nullifiers, Groth16 proof preparation, and Light Protocol compressed-state helpers.

pnpm --dir zk-primitives install --frozen-lockfile
npm run build:zk
npm run test:zk

The ZK agent builds instructions and derives proof metadata locally. Signing and transaction submission remain explicit operator actions.


🧠 xAI GROK SETUP 🧠

export XAI_API_KEY="your_key"              # 🔑 One key unlocks everything
export XAI_MANAGEMENT_API_KEY="your_key"   # 📚 Collections API management
export HELIUS_API_KEY="your_free_key"      # 🌐 From helius.dev

Grok Models

Model What it does Use case
grok-4.20-reasoning / grok-4.3 🧠 Chat, reasoning, vision, structured output, voice Default for everything
grok-4.20-multi-agent 🤖 4-16 agents collaborating in real-time Deep research, complex analysis
grok-4-1-fast ⚡ Quick responses, low latency Fast queries, real-time UX
grok-imagine-image / grok-img-1.0 🎨 Image generation + editing Memes, avatars, visualizations
grok-voice-latest 🎙️ Flagship voice model (grok-voice-think-fast-1.0) Voice Agent API, streaming TTS


🎙️ xAI VOICE APIs 🎙️

nemoclawd integrates all xAI voice capabilities — Voice Agent API (realtime speech-to-speech), Text to Speech (REST + WebSocket), Speech to Text (REST + WebSocket), and Custom Voices — all powered by Grok.

🎤 Voice Agent API (Realtime)

Build real-time, speech-to-speech voice agents over WebSockets with low-latency turn-taking and tool use.

import asyncio, json, os, websockets

async def voice_agent():
    async with websockets.connect(
        "wss://api.x.ai/v1/realtime?model=grok-voice-latest",
        additional_headers={"Authorization": f"Bearer {os.environ['XAI_API_KEY']}"}
    ) as ws:
        await ws.send(json.dumps({
            "type": "session.update",
            "session": {
                "voice": "eve",
                "instructions": "You are a helpful Solana trading assistant.",
                "turn_detection": {"type": "server_vad"},
                "tools": [{"type": "web_search"}]
            }
        }))
        async for msg in ws:
            event = json.loads(msg)
            if event["type"] == "response.output_audio.delta":
                pass  # Play audio: base64.b64decode(event["delta"])

asyncio.run(voice_agent())

Session Parameters:

Parameter Type Description
instructions string System prompt
reasoning.effort "high" | "none" Controls reasoning (default: "high"). Voice Agent only.
voice string eve, ara, rex, sal, leo or custom voice ID
turn_detection.type string | null "server_vad" for automatic VAD, null for manual
turn_detection.threshold number VAD threshold (0.1–0.9, default: 0.85)
turn_detection.silence_duration_ms number Silence before ending turn (0–10000ms)
turn_detection.prefix_padding_ms number Audio before detected speech start (default: 333)
turn_detection.idle_timeout_ms number Proactive re-engagement timeout
resumption.enabled boolean Session resumption (default: false)
audio.input.format object Input: "audio/pcm", "audio/pcmu", "audio/pcma"
audio.output.format object Output: same types as input
audio.output.speed number Speed multiplier (0.7–1.5, default: 1.0)
replace object Pronunciation replacements, e.g. {"Solana": "So-lah-nah"}
tools array file_search, web_search, x_search, mcp, function

Supported Audio Sample Rates: 8000, 16000, 22050, 24000 (default), 32000, 44100, 48000 Hz

Available Voices:

Voice Type Tone Description
eve Female Energetic, upbeat Default — engaging and enthusiastic
ara Female Warm, friendly Balanced and conversational
rex Male Confident, clear Professional and articulate
sal Neutral Smooth, balanced Versatile for various contexts
leo Male Authoritative, strong Commanding, instructional

Ephemeral Tokens: For client-side apps (browsers, mobile), generate short-lived tokens server-side via POST https://api.x.ai/v1/realtime/client_secrets:

curl -X POST https://api.x.ai/v1/realtime/client_secrets \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"expires_after": {"seconds": 300}}'

Then use in browser: new WebSocket("wss://api.x.ai/v1/realtime", ["xai-client-secret.{TOKEN}"])

Migrating from OpenAI Realtime: Change base URL to wss://api.x.ai/v1/realtime?model=grok-voice-latest, swap API key to XAI_API_KEY. The force_message, resumption, and replace features are xAI extensions.

🔊 Text to Speech (TTS)

Convert text to spoken audio. REST API or WebSocket streaming.

REST TTS:

curl -X POST https://api.x.ai/v1/tts \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Welcome to nemoclawd. How can I help you today?",
    "voice_id": "eve",
    "language": "en"
  }' \
  --output welcome.mp3

Parameters:

Parameter Required Description
text Text to speak (max 15,000 chars). Supports speech tags.
voice_id Voice: eve, ara, rex, sal, leo or custom voice ID (default: eve)
language BCP-47 code (en, zh, pt-BR) or auto
output_format Codec + sample_rate + bit_rate. Default: MP3 24kHz/128kbps
speed Speed multiplier (0.7–1.5, default: 1.0)
with_timestamps Return character-level timestamps (JSON envelope)
optimize_streaming_latency 0, 1, or 2 for latency optimization
text_normalization Normalize numbers/abbreviations to spoken form

Output Formats:

Codec Content-Type Best for
mp3 audio/mpeg General use, wide compatibility
wav audio/wav Lossless, editing
pcm audio/pcm Real-time processing
mulaw audio/basic Telephony (G.711 μ-law)
alaw audio/alaw Telephony (G.711 A-law)

Speech Tags: Add inline tags for expressive delivery — [laugh], [pause], [sigh], [breath], [whisper], <soft>, <loud>, <sing-song>, <emphasis>, etc.

Streaming TTS (WebSocket): wss://api.x.ai/v1/tts?language=en&voice=eve&codec=mp3

// Client → Server
ws.send(JSON.stringify({ type: "text.delta", delta: "Here is some text. " }));
ws.send(JSON.stringify({ type: "text.done" }));
// Server → Client
// { "type": "audio.delta", "delta": "<base64>" }
// { "type": "audio.done", "trace_id": "uuid" }
// Cancel with: { "type": "text.clear" } → { "type": "audio.clear" }

🎙️ Speech to Text (STT)

Transcribe audio in a single call (12 formats, 500MB max) or stream over WebSocket.

REST STT:

curl -X POST https://api.x.ai/v1/stt \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -F format=true \
  -F language=en \
  -F "keyterm=nemoclawd" \
  -F file=@meeting.mp3

Parameters:

Parameter Type Description
file file Audio file (max 500MB). Must be last field in multipart.
url string URL to download and transcribe
audio_format string Format hint for raw: pcm, mulaw, alaw
sample_rate int Required for raw audio only
language string Language code for text formatting
format boolean Inverse Text Normalization (e.g. "one hundred" → "$100")
multichannel boolean Transcribe each channel independently
channels int 2–8 channels
diarize boolean Speaker diarization
keyterm string Bias transcription toward key terms (repeat for multiple)
filler_words boolean Include "uh", "um" in transcript

Streaming STT (WebSocket): wss://api.x.ai/v1/stt?sample_rate=16000&encoding=pcm&interim_results=true

// Send raw PCM16 audio as binary frames
ws.send(audioChunk);  // 100ms chunks (3200 bytes at 16kHz)
ws.send(JSON.stringify({ type: "audio.done" }));

// Receive transcripts
// { "type": "transcript.partial", "text": "...", "is_final": false }
// { "type": "transcript.done", "text": "...", "duration": 12.5 }

Smart Turn: Enable smart_turn=0.7 for ML-based end-of-turn detection. Prevents false endpointing on mid-sentence pauses.

Supported Formats: WAV, MP3, OGG, Opus, FLAC, AAC, MP4, M4A, MKV, PCM, μ-law, A-law

Streaming Parameters:

Parameter Default Description
sample_rate 16000 Audio sample rate
encoding pcm pcm, mulaw, or alaw
interim_results false Emit partial transcripts every ~500ms
smart_turn End-of-turn ML confidence (0.0–1.0)
smart_turn_timeout Max silence before forcing speech_final (ms)
diarize false Speaker identification
multichannel false Per-channel transcription
keyterm Bias transcription (max 100 terms)

🗣️ Custom Voices

Clone any voice from a 120s reference clip, then use the resulting voice_id anywhere a built-in voice works (TTS, Voice Agent API, streaming TTS).

# Create a custom voice
curl -X POST https://api.x.ai/v1/custom-voices \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -F "name=Friendly Narrator" \
  -F "language=en" \
  -F "file=@reference.wav;type=audio/wav"

# Response: { "voice_id": "nlbqfwie", ... }

# Use it for TTS
curl -X POST https://api.x.ai/v1/tts \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello!", "voice_id": "nlbqfwie", "language": "en"}' \
  --output custom.mp3

Endpoints: GET /v1/custom-voices, GET /v1/custom-voices/{id}, PATCH /v1/custom-voices/{id}, DELETE /v1/custom-voices/{id}, GET /v1/custom-voices/{id}/audio

Limits: Up to 30 custom voices per team, reference audio max 120s, 8-char alphanumeric voice IDs.

Recording Tips: Record in quiet room with quality mic, 90–120s recommended, match recording style to intended use case (conversational, narration, support, etc.).



🛠️ xAI TOOLS 🛠️

The xAI API supports both built-in tools (server-side, auto-executed) and custom function calling.

Function Calling

Define custom tools with JSON Schema parameters:

import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.XAI_API_KEY, baseURL: "https://api.x.ai/v1" });

const response = await client.responses.create({
  model: "grok-4.3",
  input: [{ role: "user", content: "What's the weather in San Francisco?" }],
  tools: [{
    type: "function",
    name: "get_temperature",
    description: "Get current temperature for a location",
    parameters: {
      type: "object",
      properties: {
        location: { type: "string", description: "City name" },
        unit: { type: "string", enum: ["celsius", "fahrenheit"] }
      },
      required: ["location"]
    }
  }]
});
  • Tool Choice: "auto" (default), "required", "none", or force specific tool
  • Parallel calling: Enabled by default. Disable with parallel_tool_calls: false
  • Max tools: 200 per request

Built-in Tools

Tool xAI SDK OpenAI Responses API Description
Web Search 🌐 web_search() web_search Real-time web search + page browsing
X Search 🐦 x_search() x_search Search X posts, users, threads
Code Execution 💻 code_execution() code_interpreter Run Python in sandbox (NumPy, Pandas, Matplotlib)
Collections Search 📚 collections_search() file_search Search uploaded document collections
Remote MCP 🔌 mcp() mcp Connect to external MCP servers

Web Search Parameters: allowed_domains (max 5), excluded_domains (max 5), enable_image_understanding, enable_image_search

X Search Parameters: allowed_x_handles (max 20), excluded_x_handles (max 20), from_date, to_date, enable_image_understanding, enable_video_understanding

Remote MCP Tools:

from xai_sdk.tools import mcp

tools = [
    mcp(server_url="https://mcp.deepwiki.com/mcp", server_label="deepwiki"),
    mcp(server_url="https://your-tools.com/mcp", server_label="custom",
        allowed_tool_names=["search_db", "format_data"],
        authorization="Bearer your-token"),
]

Parameters: server_url (required, SSE/Streaming HTTP), server_label (required), allowed_tool_names, authorization, extra_headers. Multi-server supported.

Collections Search (RAG)

Search uploaded document collections for RAG-powered responses:

from xai_sdk.tools import collections_search, code_execution, web_search

chat = client.chat.create(
    model="grok-4.3",
    tools=[
        collections_search(collection_ids=["your-collection-id"]),
        code_execution(),
        web_search(),  # Combine with web search for hybrid analysis
    ],
)

Citations use collections://collection_id/files/file_id URIs.



⚡ ADVANCED xAI API FEATURES ⚡

💰 Prompt Caching

Reduce costs by caching prompt prefixes. Use x-grok-conv-id header (Chat Completions) or prompt_cache_key field (Responses API):

curl https://api.x.ai/v1/chat/completions \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "x-grok-conv-id: conv_abc123" \
  -d '{
    "model": "grok-4.3",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is prompt caching?"}
    ]
  }'

Check response.usage.prompt_tokens_details.cached_tokens or response.usage.input_tokens_details.cached_tokens to confirm cache hits.

🏎️ Priority Processing

Get lower latency by adding service_tier: "priority" to any Chat Completions or Responses request. Billed at a premium rate. Check response.service_tier to confirm:

curl https://api.x.ai/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
    "model": "grok-4.3",
    "input": "Explain the Riemann hypothesis.",
    "service_tier": "priority"
  }'

📦 Context Compaction

Shrink long conversations into a single opaque compaction item to reduce input cost and latency:

# Step 1: Compact
curl -X POST https://api.x.ai/v1/responses/compact \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
    "model": "grok-4.3",
    "input": [
      {"role": "system", "content": "You are a science tutor."},
      {"role": "user", "content": "What is the Higgs boson?"},
      {"role": "assistant", "content": "..."},
      # ... many more turns ...
    ]
  }'

# Step 2: Continue with compaction output
curl -X POST https://api.x.ai/v1/responses \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
    "model": "grok-4.3",
    "input": [
      {"type": "compaction", "id": "cmp_abc123", "encrypted_content": "<opaque blob>"},
      {"role": "user", "content": "Continue our discussion..."}
    ]
  }'

The xAI SDK also supports in-place compaction: chat.compact() replaces the chat's message list with the compaction item. Use use_encrypted_content=True on chat creation to preserve reasoning content across compactions.

🔒 mTLS Authentication

Enterprise-grade certificate-based authentication. Point to https://mtls.api.x.ai and attach your client certificate:

curl https://mtls.api.x.ai/v1/chat/completions \
  --cert /path/to/client-cert.pem \
  --key /path/to/client-key.pem \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{"model": "grok-4.3", "messages": [{"role": "user", "content": "Hello"}]}'

Contact support@x.ai with your team ID and CA certificate to enable.



🛠️ MCP TOOLS (31) 🛠️

Solana Market Data 🌊:

  • solana_price, solana_trending, solana_token_info, solana_wallet_pnl
  • solana_search, solana_top_traders, solana_wallet_tokens, sol_price

Helius Onchain ⛓️:

  • helius_account_info, helius_balance, helius_transactions
  • helius_priority_fee, helius_das_asset, helius_webhook_create

Agent Fleet 🤖:

  • agent_spawn, agent_list, agent_stop

Memory 🧠:

  • memory_recall, memory_write

Metaplex 🎭:

  • metaplex_mint_agent, metaplex_register_identity, metaplex_read_agent

Pump.fun 🎯:

  • pump_token_scan, pump_buy_quote, pump_sell_quote, pump_graduation


🔄 OODA TRADING LOOP 🔄

┌──────────────────────────────────────────────────────────────────────┐
│                                                                      │
│   OBSERVE  ═══►  ORIENT  ═══►  DECIDE  ═══►  ACT  ═══►  LEARN     │
│                                                                      │
│   👁️              🧠              ⚖️              🎯              📝   │
│                                                                      │
│   sol_price      score           confidence      trade_execute   write INFERRED│
│   trending       candidates      ≥ 60?           gated at        Dream agent  │
│   helius_priority_fee            size band       `ask`           → LEARNED    │
│   memory KNOWN   (trend +        (0.5x / 1.0x    permission                    │
│                   momentum +      / 1.25x /                              │
│                   liquidity +     1.5x)                                    │
│                   participation)                                              │
│                                                                      │
└──────────────────────────────────────────────────────────────────────┘

🤖 Agent Fleet

Agent Type Description
$CLAWD 🦞 Clawd Full autonomous agent — chat, vision, image gen, multi-agent, voice
Grok Researcher 🔬 GrokResearcher 16-agent deep research with web + X search
Explorer 🗺️ Explore Read-only Solana research (fast, cheap)
Scanner 👁️ Scanner Trend monitoring, surfaces high-signal opportunities
OODA 🔄 OODA Full trading cycle: Observe, Orient, Decide, Act, Learn
Dream 💭 Dream Memory consolidation (INFERRED to LEARNED promotion)
Analyst 📊 Analyst Deep structured research reports
Monitor 📡 Monitor Helius WebSocket event listeners


🧸 BLOCKCHAIN BUDDIES 🧸

Every nemoclawd user gets a companion — a procedurally generated Blockchain Buddy with its own wallet, trading personality, stats, and animated ASCII sprite.

nemoclawd birth   # 🥚 hatch yours now

Species (18 total)

Category Species Personality Risk Level
Solana Natives 🌊 SolDog, BONK Dog, dogwifhat, Jupiter Agg, Raydium LP Diamond Hands / Degen / Bot Low → Degen
DeFi Archetypes 🏦 Whale, Bull, Bear, MEV Shark, Octopus Whale / Sniper / Ninja Low → Medium
Memecoin Culture 🎭 Pepe, Pump.fun, Sniper Bot Degen / Sniper High → Degen

✉️ TELEGRAM TRADING BOT ✉️

Commands

Command Response
/sol 🌊 SOL price (CoinGecko)
/price <mint|symbol> 💰 Token price
/trending 🔥 Top 10 trending tokens
/wallet <address> 📊 Wallet PnL analysis
/scan 🔍 Toggle background pump scanner
/snipe [config] 🎯 Start sniper bot
/grok <question> 🧠 Chat with Grok
/xsearch <query> 🐦 Search X/Twitter live
/imagine <prompt> 🎨 Generate images

🚀 DEPLOY TO FLY.IO 🚀

cd MCP
fly launch --config fly.toml
fly secrets set HELIUS_API_KEY=your-key XAI_API_KEY=your-key MCP_API_KEY=optional-bearer-token

Then connect via:

{ "type": "http", "url": "https://your-app.fly.dev/mcp" }

🏗️ ARCHITECTURE 🏗️

                      ┌─────────────────────────────────────────────────────┐
                      │                  🚪 ENTRY POINTS                    │
                      │  nemoclawd CLI    MCP Server    Telegram Bot        │
                      │  (interactive/   (stdio/HTTP)   60+ commands       │
                      │   one-shot)                                        │
                      └────────┬──────────┬────────────────┬────────────────┘
                               │          │                │
                               ▼          ▼                ▼
                      ┌─────────────────────────────────────────────────────┐
                      │                  ⚙️ CORE ENGINE                     │
                      │  QueryEngine ──► xAI Grok ──► Tool Execution       │
                      │    │              │              │               │
                      │    │  Providers:   │   ┌──────────┤               │
                      │    │  - xAI/Grok   │   │          │               │
                      │    │  - OpenRouter │   ▼          ▼               │
                      │    │  - Anthropic  │  ToolExecutor  Permission     │
                      └─────┼──────────────┼──────────────────────────────┘
                            │              │
                ┌───────────┴──────────────┴──────────────────────────────┐
                │                              │                         │
                ▼                              ▼                         ▼
┌──────────────────────┐  ┌──────────────────────────┐  ┌────────────────┐
│     🧰 SUPPORT LAYER │  │      🧠 MEMORY SYSTEM     │  │   📡 DATA      │
│                      │  │                          │  │   SOURCES      │
│  AppState (Zustand)  │  │  KNOWN   (ephemeral,     │  │                │
│  - PermissionMode    │  │           ~60s TTL)      │  │  Helius RPC   │
│  - OODA phase        │  │                          │  │  Helius DAS   │
│  - PumpSignals       │  │  LEARNED (persistent,    │  │  Pump.fun     │
│                      │  │           cross-session)  │  │  Jupiter      │
│  Risk Engine         │  │                          │  │                │
└──────────────────────┘  │  INFERRED (tentative,    │  │  Solana       │
                            │           markdown)       │  │  Tracker      │
                            └──────────────────────────┘  └────────────────┘

🔑 ENVIRONMENT VARIABLES 🔑

# 🔵 Core (free at helius.dev)
HELIUS_API_KEY=               # RPC, DAS, enhanced txs, webhooks
HELIUS_RPC_URL=               # Helius mainnet RPC

# 🟢 xAI Grok (one key unlocks everything)
XAI_API_KEY=                  # Grok: chat, voice, vision, search, multi-agent, tools
XAI_MANAGEMENT_API_KEY=       # Required for Collections API management

# 🟡 OpenRouter (optional — multi-model LLM routing)
OPENROUTER_API_KEY=           # Multi-model LLM routing

# 🔴 ZK primitives (optional)
ZK_SHARK_RPC_URL=             # RPC for ZK instruction construction
CLAWD_ZK_RPC_URL=             # Legacy alias accepted by zk-primitives

# ✉️ Telegram
TELEGRAM_BOT_TOKEN=           # From @BotFather

# 👛 Wallet (optional — signal-only mode works without)
SOLANA_PRIVATE_KEY=           # Base58 keypair for live trades
SOLANA_PUBLIC_KEY=            # Default wallet address

A ready-to-use .env.local file ships with the repo — copy it to .env and fill in your values:

cp .env.local .env
# Edit .env with your API keys

🧪 TEST STATUS — 84/84 PASSING 🧪

Every commit. Every PR. Every time.

Suite Tests Status
CLI dispatch 17 ✅ All pass
DFlow routing defaults 4 ✅ All pass
Installer runtime preflight 1 ✅ Passes
Magic router v2.0 🪄 17 ✅ All pass
NIM (NVIDIA Inference Microservice) 6 ✅ All pass
Policies 8 ✅ All pass
CGroup config 7 ✅ All pass
Registry 15 ✅ All pass
Docker helpers 3 ✅ All pass
Total 94 ✅ 0 failures, 0 skipped
npm test

# Expected output:
# ℹ tests 94
# ℹ suites 24
# ℹ pass 94
# ℹ fail 0
# ℹ duration_ms ~1305

🤖 ALL MODELS LIVE & DEPLOYED 🤖

🔥 Historic Milestone: First Wallet-Bearing LLM
ordlibrary/clawd-trading-wallet — A Qwen2.5-1.5B model that carries
its own encrypted Solana wallet — generates BIP39 seeds, derives Ed25519
keypairs, holds the encrypted key in session state. Never exposes raw private keys.


# Model Size Pull Command Status
ordlibrary/clawd-trading-wallet 986 MB ollama run hf.co/ordlibrary/clawd-trading-wallet Live — Historic
🧠 ordlibrary/hauhau-qwen36-onchain 11 GB ollama run hf.co/ordlibrary/hauhau-qwen36-onchain Live
🧠 ordlibrary/hauhau-qwen36-uncensored 11 GB ollama run hf.co/ordlibrary/hauhau-qwen36-uncensored Live
🦞 ordlibrary/core-ai-clawd-1.5b 986 MB ollama run hf.co/ordlibrary/core-ai-clawd-1.5b Live
🦞 ordlibrary/core-ai-clawd-1.5b (finetuned) 4.9 GB ollama run ordlibrary/core-ai-clawd-1.5b:finetuned Live

Trading Wallet Demo

ollama run hf.co/ordlibrary/clawd-trading-wallet
# > create a wallet
# > buy 100 SOL
# > short ETH 5x

The model generates a BIP39 seed phrase, derives an Ed25519 keypair, encrypts the key in session state, and executes natural-language trading commands — all without ever exposing the raw private key.

Where to Find Everything

Resource URL Status
Train2Earn Frontend traintoearn.vercel.app Vercel — Live
Hugging Face Org huggingface.co/ordlibrary Live
Clawd Trading Wallet HF huggingface.co/ordlibrary/clawd-trading-wallet Live (Model Card)
Hauhau Qwen3.6 Onchain huggingface.co/ordlibrary/hauhau-qwen36-onchain Live
Hauhau Qwen3.6 Uncensored huggingface.co/ordlibrary/hauhau-qwen36-uncensored Live
Core AI Clawd 1.5B huggingface.co/ordlibrary/core-ai-clawd-1.5b Live

Full Clawd Model Family (7 models)

Model Base Params Trained On
clawd-trading-wallet Qwen2.5-1.5B 1.5B Fable-5-traces + Core AI + Trading Factory
core-ai-clawd-1.5b Qwen2.5-1.5B 1.5B Core AI Instruct (35K) + Realtime Research (29K)
solana-clawd-core-ai-1.5b-lora Qwen2.5-1.5B LoRA ~9M Core AI Instruct (35K)
solana-tx-foundation-1.5b Qwen2.5-1.5B 1.5B TX Foundation CPT (19K)
solana-nvidia-trading-factory-8b-lora Hermes-3-8B LoRA ~9M Trading Factory (142)
clawd-fable Fable Traces Agent interaction traces
clawd-fable-lora Fable Traces LoRA Distilled reasoning

Training Datasets (7 total)

Dataset Examples Source
Fable-5-traces 5K Agent interaction traces for reasoning
Core AI Instruct 35,173 Solana, DeFi, ZK, Agent Architecture
Realtime Research 29,058 PDFs, notebooks, ZK skills
TX Foundation CPT 19,542 Solana mainnet transactions
NVIDIA Trading Factory 142 Perps, cuML, cuFOLIO, Mean-CVaR
TX Foundation Unified 82,169 Combined transaction foundation
Clawd Fable SFT 3,052 Fable trace training

Security Model

User Command ──► LLM (session wallet) ──► Encrypted Key (memory only)
                    │
                    ├── BIP39 Seed Generation (never stored to disk)
                    ├── Ed25519 Keypair Derivation (RAM only)
                    ├── Natural Language Trading (create wallet, buy, sell, short)
                    └── Raw Private Key Exposure (❌ blocked by architecture)

The wallet-bearing LLM represents a paradigm shift: the model carries authority in encrypted form, not the user's infrastructure. No key files on disk. No .env secrets. No clipboard leaks. The model is the wallet.



📊 TRAINING DATA & STRATEGIES 📊

121,860 training examples + 10 trading strategies — fully integrated

npm run training:status
npm run training:strategy:list
npm run training:strategy:plan
npm run training:strategy:vulcan
npm run training:strategy:read
=== Training Data (121,860 total examples) ===
   35,173  core_ai_clawd_sft.jsonl
   30,365  solana_clawd_merged.jsonl
   29,058  realtime_research_sft.jsonl
   19,542  tx_foundation_cpt.jsonl
    3,052  clawd_fable_sft.jsonl
    2,195  nemo_clawd_master_sft.jsonl
    1,485  clawd_code_deepsol_sft.jsonl
      500  jupiter_txs.jsonl
      197  nemo_clawd_combined_sft.jsonl
      195  nvidia_trading_factory_sft.jsonl
       85  solana_clawd_seed.jsonl

=== 10 Trading Strategies ===
cufolio_mean_cvar_handoff.json             sol_ema_adx_trend_paper.json
nemo_clawd_blueprint.json                  sol_macd_adx_trim_paper.json
nemo_clawd_core_inventory.json             sol_rsi_mean_reversion_paper.json
nvidia_clawd_agent_plan.json               strategy_manifest.json
rise_market_data_plan.json                 vulcan_command_plans.json

📜 LICENSE 📜

Licensed under Apache 2.0.


$CLAWD
8cHzQHUS2s2h8TzCmfqPKYiM4dSt4roa3n7MyRLApump

🦞 Powered by xAI Grok from xAI
🌊 Built on Solana
🎯 Trading. Research. Autonomy. Lobster.

Go hatch your buddy → nemoclawd birth

About

nemoClawd now integrates solana-clawd — the full xAI Grok-powered agentic framework for Solana trading, research, and autonomous agent operations.

Resources

License

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors