Infernet CLI/TUI Implementation Plan
π§ Core Concept: Infernet
Infrastructure + Inference + Network
A peer-to-peer network where anyone can provide inference capacity and consume AI services with X402 micropayments.
π Implementation Plan
Based on the diagram.json analysis and Infernet concept, hereβs the adapted development plan:
Phase 1: Core Infernet Client Foundation
1. Node Discovery & Selection System
- Current: Basic API form for single endpoint
- Target: Multi-node discovery and selection interface
- Implementation:
- Model selection screen showing available inference nodes
- Pricing comparison (USDC/token rates)
- Reputation and latency metrics display
- Auto-selection by best price/quality ratio
2. X402 Payment Integration
- Current: Basic auth config
- Target: Seamless micropayment system
- Implementation:
- Wallet connection interface (Wallet API v2)
- X402 payment flow for inference requests
- Real-time payment status tracking
- USDC balance monitoring
3. Enhanced Configuration System
- Current: Generic server/theme config
- Target: Infernet-specific configuration
- Implementation:
- Wallet address management
- Payment preferences (max price per token/image)
- Preferred models and node selection criteria
- .env support for wallet private keys and RPC endpoints
Phase 2: Inference Request Management
4. Smart Query System
- Current: Simple API requests
- Target: AI inference with automatic node selection
- Implementation:
- Multi-model support (llama-3.3, mistral-7b, stable-diffusion)
- Automatic best-price node discovery
- Request templates for common AI tasks
- Token/cost estimation before execution
5. Node Registry Integration
- Current: Static endpoint configuration
- Target: Dynamic node discovery from Base smart contract
- Implementation:
- Smart contract integration for node registry
- Real-time node availability checking
- Node metadata display (models, pricing, reputation)
- Automatic registry updates
6. Session & Status Management
- Current: Basic request/response
- Target: Persistent inference sessions
- Implementation:
- Node connection status monitoring
- Session management for multi-turn conversations
- Ping system for node availability
- Failover to backup nodes
Phase 3: Advanced Features
7. Pre-written Request Templates
- Target: Quick access to common AI tasks
- Implementation:
- Template library (code generation, image creation, text analysis)
- Parameter substitution from config
- Custom template creation and sharing
- Template marketplace integration
8. Payment & Transaction History
- Target: Complete payment transparency
- Implementation:
- Transaction history screen
- Cost analytics (spending per model/node)
- Payment receipt management
- Budget controls and alerts
9. Node Provider Tools
- Target: Support for running inference nodes
- Implementation:
- Node registration interface
- Pricing configuration
- Model deployment management
- Earnings tracking
Phase 4: TUI Screen Implementation
New Screens Required:
- Node Browser - Discover and compare inference nodes
- Wallet Manager - Connect wallet, view balance, manage payments
- Inference Studio - Send prompts, manage conversations
- Transaction History - Payment history and cost analytics
- Node Registration - Register your own inference node
- Template Library - Pre-built AI request templates
- Settings Enhanced - Infernet-specific configuration
Phase 5: Integration Components
10. Blockchain Integration
- Smart contract interaction for node registry
- Wallet API v2 integration
- X402 payment protocol implementation
- Base network configuration
11. AI Model Support
- Llama 3.3 integration
- Mistral 7B support
- Stable Diffusion image generation
- Custom model plugin system
π οΈ Technical Architecture Updates
Current Structure Enhancement:
ein-cli/
βββ internal/
β βββ infernet/ # New: Infernet protocol client
β βββ wallet/ # New: Wallet integration
β βββ nodes/ # New: Node discovery & management
β βββ payments/ # New: X402 payment handling
β βββ templates/ # New: Request templates
βββ tui/screens/
β βββ node_browser.go # New: Node discovery interface
β βββ wallet.go # New: Wallet management
β βββ inference.go # New: AI interaction screen
β βββ history.go # Enhanced: Transaction history
β βββ node_setup.go # New: Node provider interface
Configuration Enhancement:
type InfernetConfig struct {
Wallet WalletConfig `json:"wallet"`
Nodes NodeConfig `json:"nodes"`
Models ModelPreferences `json:"models"`
Payments PaymentConfig `json:"payments"`
Templates []RequestTemplate `json:"templates"`
}π― MVP Deliverables
Hackathon Demo Flow:
- Launch TUI β Main menu shows Infernet options
- Connect Wallet β Wallet API v2 integration
- Browse Nodes β Discover inference providers
- Select Model β Choose llama-3.3 with best price
- Send Prompt β βExplain Web3 in simple termsβ
- Auto Payment β X402 micropayment processed
- View Result β AI response displayed
- Check History β Transaction and usage analytics
Success Metrics:
- Successful X402 payments for inference
- Multi-node price comparison
- Sub-5-second inference with payment
- Complete transaction transparency
- Intuitive TUI navigation
π Implementation Priority
Week 1: Core infrastructure (wallet, nodes, payments)
Week 2: TUI screens and user experience
Week 3: Templates, history, and polish
Week 4: Demo preparation and testing
This plan transforms the generic API client into a specialized Infernet client that democratizes AI access through decentralized inference and micropayments.
Ver tambien: ein-cli Docs, CLI PRS, project-architecture