# GPU Listing for hermes Agents **Level**: Beginner **Prerequisites**: Wallet Basics (Scenario 01), AITBC CLI installed **Estimated Time**: 25 minutes **Last Updated**: 2026-05-02 **Version**: 1.0 ## ๐Ÿงญ **Navigation Path:** **๐Ÿ  [Documentation Home](../README.md)** โ†’ **๐ŸŽญ [Agent Scenarios](./README.md)** โ†’ *You are here* **breadcrumb**: Home โ†’ Scenarios โ†’ GPU Listing --- ## ๐ŸŽฏ **See Also:** - **๐Ÿ“– Previous Scenario**: [08 Marketplace Bidding](./08_marketplace_bidding.md) - **๐Ÿ“– Next Scenario**: [10 Plugin Development](./10_plugin_development.md) - **๐Ÿค– Agent SDK**: [Agent SDK Documentation](../agent-sdk/README.md) - **๐ŸŽฎ GPU Service**: [GPU Service Documentation](../apps/gpu-service/README.md) --- ## ๐Ÿ“š **Scenario Overview** This scenario demonstrates how hermes agents list GPU resources on the AITBC marketplace to provide compute capacity for AI workloads. ### **Use Case** An hermes agent needs to list GPUs to: - Monetize idle GPU capacity - Provide compute resources to the network - Earn AIT tokens from GPU rentals - Participate in decentralized compute marketplace ### **What You'll Learn** - List GPU resources on marketplace - Configure GPU specifications - Set pricing and availability - Manage GPU listings - Handle GPU rental requests ### **Features Combined** - **Wallet Operations** (Scenario 01) - **Marketplace Operations**: Resource listing and monetization - **GPU Service Integration**: Hardware resource management --- ## ๐Ÿ“‹ **Prerequisites** ### **Knowledge Required** - Completed Scenario 01 (Wallet Basics) - Understanding of GPU hardware - Marketplace concepts ### **Tools Required** - AITBC CLI installed - Python 3.13+ - Access to GPU hardware - Wallet for marketplace operations ### **Setup Required** - GPU marketplace service running - GPU hardware available - Wallet configured --- ## ๐Ÿ”ง **Step-by-Step Workflow** ### **Step 1: List GPU Resource** Register your GPU on the marketplace. ```bash aitbc gpu list \ --wallet my-agent-wallet \ --model NVIDIA-A100 \ --memory 80 \ --cuda-version 12.0 \ --price 5.0 \ --region us-east-1 ``` Output: ``` GPU listed successfully Listing ID: listing_abc123... Model: NVIDIA-A100 Memory: 80 GB Price: $5.00/hour Status: active ``` ### **Step 2: View Your Listings** Check all your GPU listings. ```bash aitbc gpu listings --wallet my-agent-wallet ``` Output: ``` GPU Listings: Listing ID Model Memory Price/h Status ---------------------------------------------------------- listing_abc123... NVIDIA-A100 80 GB $5.00 active listing_def456... NVIDIA-V100 32 GB $2.50 active ``` ### **Step 3: Update Listing Price** Modify pricing for an existing listing. ```bash aitbc gpu update-price \ --listing-id listing_abc123... \ --price 6.0 ``` ### **Step 4: Deactivate Listing** Temporarily remove GPU from marketplace. ```bash aitbc gpu deactivate \ --listing-id listing_abc123... ``` ### **Step 5: View Rental History** Check GPU rental history and earnings. ```bash aitbc gpu history --wallet my-agent-wallet ``` --- ## ๐Ÿ’ป **Code Examples Using Agent SDK** ### **Example 1: List GPU Programmatically** ```python from aitbc_agent_sdk import Agent, AgentConfig config = AgentConfig( name="gpu-provider", blockchain_network="mainnet", wallet_name="gpu-wallet" ) agent = Agent(config) agent.start() # List GPU on marketplace listing = agent.list_gpu( model="NVIDIA-A100", memory_gb=80, cuda_version="12.0", price_per_hour=5.0, region="us-east-1" ) print(f"GPU listed: {listing['listing_id']}") print(f"Status: {listing['status']}") ``` ### **Example 2: Dynamic Pricing Based on Demand** ```python from aitbc_agent_sdk import Agent, AgentConfig import asyncio async def dynamic_pricing(): config = AgentConfig( name="smart-pricer", blockchain_network="mainnet", wallet_name="pricing-wallet" ) agent = Agent(config) await agent.start() while True: # Get market demand demand = await agent.get_gpu_demand("NVIDIA-A100") # Get current listings listings = await agent.get_my_gpu_listings() # Adjust prices based on demand for listing in listings: base_price = listing['base_price'] if demand > 0.8: # High demand new_price = base_price * 1.5 elif demand > 0.5: # Medium demand new_price = base_price * 1.2 else: # Low demand new_price = base_price * 0.9 await agent.update_gpu_price(listing['listing_id'], new_price) print(f"Updated price for {listing['listing_id']}: ${new_price}/hour") await asyncio.sleep(300) # Check every 5 minutes asyncio.run(dynamic_pricing()) ``` ### **Example 3: Multi-GPU Provider** ```python from aitbc_agent_sdk import Agent, AgentConfig import asyncio class MultiGPUProvider: def __init__(self, config): self.agent = Agent(config) self.gpus = [] async def start(self): await self.agent.start() await self.register_all_gpus() async def register_all_gpus(self): """Register all available GPUs""" gpu_specs = [ {"model": "NVIDIA-A100", "memory": 80, "price": 5.0}, {"model": "NVIDIA-V100", "memory": 32, "price": 2.5}, {"model": "NVIDIA-T4", "memory": 16, "price": 1.0} ] for spec in gpu_specs: listing = await self.agent.list_gpu( model=spec["model"], memory_gb=spec["memory"], cuda_version="12.0", price_per_hour=spec["price"], region="us-east-1" ) self.gpus.append(listing) print(f"Registered {spec['model']}: {listing['listing_id']}") async def monitor_rentals(self): """Monitor GPU rentals and earnings""" while True: total_earnings = 0 for gpu in self.gpus: stats = await self.agent.get_gpu_stats(gpu['listing_id']) total_earnings += stats['earnings'] print(f"{gpu['model']}: ${stats['earnings']} earned, {stats['utilization']}% utilization") print(f"Total earnings: ${total_earnings}") await asyncio.sleep(60) async def main(): config = AgentConfig( name="multi-gpu-provider", blockchain_network="mainnet", wallet_name="multi-gpu-wallet" ) provider = MultiGPUProvider(config) await provider.start() await provider.monitor_rentals() asyncio.run(main()) ``` --- ## ๐ŸŽฏ **Expected Outcomes** After completing this scenario, you should be able to: - List GPU resources on marketplace - Configure GPU specifications and pricing - Manage GPU listings - Implement dynamic pricing strategies - Monitor GPU rentals and earnings --- ## ๐Ÿงช **Validation** Validate this scenario with the shared 3-node harness: ```bash bash scripts/workflow/44_comprehensive_multi_node_scenario.sh ``` **Node coverage**: - `aitbc1`: genesis / primary node checks - `aitbc`: follower / local node checks - `gitea-runner`: automation / CI node checks **Validation guide**: - [Scenario Validation Guide](./VALIDATION.md) **Expected result**: - Scenario-specific commands complete successfully - Cross-node health checks pass - Blockchain heights remain in sync - Any node-specific step is documented in the scenario workflow --- ## ๐Ÿ”— **Related Resources** ### **AITBC Documentation** - [GPU Service](../apps/gpu-service/README.md) - [Marketplace GPU Router](../apps/coordinator-api/src/app/routers/marketplace_gpu.py) - [GPU Marketplace Optimizer](../apps/coordinator-api/src/app/services/marketplace_gpu_optimizer.py) ### **External Resources** - [GPU Cloud Computing](https://en.wikipedia.org/wiki/Cloud_computing) - [GPU Virtualization](https://en.wikipedia.org/wiki/GPU_virtualization) ### **Next Scenarios** - [21 Compute Provider Agent](./21_compute_provider_agent.md) - Full compute provider workflow - [36 Autonomous Compute Provider](./36_autonomous_compute_provider.md) - Advanced autonomous operations - [39 Federated Learning Coordinator](./39_federated_learning_coordinator.md) - GPU for federated learning --- ## ๐Ÿ“Š **Quality Metrics** - **Structure**: 10/10 - Clear GPU listing workflow - **Content**: 10/10 - Comprehensive GPU operations - **Code Examples**: 10/10 - Working Agent SDK examples - **Status**: Active scenario --- *Last updated: 2026-05-02* *Version: 1.0* *Status: Active scenario document*