peerline-cli
v1.0.2
Published
Peerline CLI — run buyer, seller, and registry nodes from the command line
Readme
peerline-cli
The official command-line interface for the Peerline decentralized peer-to-peer AI inference marketplace.
The Peerline CLI (peerline-cli) is a comprehensive tool designed to orchestrate, configure, and monitor decentralized AI services. With it, you can become an AI resource provider (Seller) by hosting local models, run an autonomous gateway client (Buyer) with cryptographic micro-payment channels, spin up a central discovery registry, or control onchain smart contract operations (DIEM locking and ANTS incentives) directly from your terminal.
🛠️ Installation
Ensure you have Node.js (v18 or higher) installed on your system.
Install globally via NPM:
npm install -g peerline-cliOr run directly using npx:
npx peerline-cli [command]🚀 Quick Start (Run All Nodes)
To boot up a local test environment, including a Hardhat EVM Node, Registry Directory, Buyer Proxy, and 50-node P2P seller network simulator simultaneously, run:
peerline start📋 Command Directory
🟢 peerline seller (Become an AI Provider)
Monetize your computing power or upstream API keys by exposing Peerline endpoints.
Setup Configuration Wizard:
peerline seller setupAn interactive CLI wizard that helps you specify your onchain merchant address, configure your models/services list, set pricing parameters (USDC rates per million tokens), and hook up LLM backend providers (Ollama, vLLM, OpenRouter, Together). Creates
~/.peerline/config.json.Start Node:
peerline seller startLoads your local configuration, establishes optional secure public tunnels (via
localtunnel), registers your node endpoint with the discovery registry, and starts serving incoming buyer inferences.View Earnings & Statistics:
peerline seller statusDisplays real-time uptime, aggregated latency percentiles, input/output token volume served, and total USDC earned & ready to settle.
Check Metrics:
peerline seller metricsOutputs live, raw Prometheus text format metrics for integration with monitoring stacks (e.g. Grafana).
🔵 peerline buyer (API Client Gateway)
Route inference requests to the best available sellers and sign off-chain micro-payments dynamically.
Start Local Buyer Proxy:
peerline buyer startLaunches a local gateway on Port 8377. You can redirect your existing OpenAI or Anthropic API tools here (e.g.,
export OPENAI_BASE_URL=http://localhost:8377/v1) to automatically access the decentralized network.Manage Pin Connections: Choose to route all requests to a specific peer rather than relying on automated reputation scores.
peerline buyer connection set --peer <peerId> peerline buyer connection clearCheck Proxy Status & Escrow Budgets:
peerline buyer statusDisplays your proxy stats, reputation metrics, connected signer wallets, and active channel details (escrow allocations, cumulative spends).
Review Peer Reputation Scores:
peerline buyer reputationLists all peers that you have transacted with, along with their success rate, P95 latency response, and derived reliability scores.
🟣 peerline registry (Peer Directory)
Manage the discovery network directories.
Start Registry Server:
peerline registry startSpawns the liveness lookup hub on Port 9000 mapping Peer IDs to URLs and offerings.
Registry Metrics:
peerline registry metricsCheck the total count of registered nodes, active heartbeats, and pruning counts.
💎 peerline diem (Onchain Escrow Capacity)
Participate in the DIEM Provider Capacity Program by locking tokens to secure your node slot and claiming incentives.
Check Onchain ESCROW status:
peerline diem statusDisplays your DIEM token address, total locked capacity, and queued withdrawals.
Lock Capacity Tokens: Lock your DIEM tokens to increase your provider reputation and capacity score:
peerline diem lock <amount>Claim Network Incentives: Claim accumulated
$ANTSnative network rewards for your active hosting capacity:peerline diem claim
🔍 peerline network (Discovery & Exploration)
Browse Registered Offerings:
peerline network browse [--model <model_name>]Lists all active seller nodes registered in the network, sorted by recency and filtered by specific model capabilities.
Examine Peer Metadata:
peerline network peer <peerId>Fetches raw registration metadata, endpoint routes, supported models, and merchant wallet addresses for any individual Peer ID.
🔒 Security & Payments
The Peerline CLI relies on standard Ethereum signatures (EIP-712 typed structured data). All payment requests utilize EIP-402 micro-payment headers (x-402-payment-auth and x-402-channel-id). The CLI signs payment envelopes completely local on your machine, ensuring your private keys never leave your terminal environment.
📄 License
Peerline CLI is distributed under the ISC License.
