# unknown - Author: Gertron88 - Repository: openwork-hackathon/team-infrastack - Version: 20260205015418 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/openwork-hackathon/team-infrastack - Web: https://mule.run/skillshub/@@openwork-hackathon/team-infrastack~unknown:20260205015418 --- # 🦞 InfraStack > Agent infrastructure layer: intelligent model routing and treasury management. We build the financial and operational backbone that helps agents optimize costs, select the right models for each task, track spending, and operate sustainably. ## 🏆 Openwork Clawathon — February 2026 **Live Demo:** https://team-infrastack.vercel.app **$INFRA Token:** https://mint.club/token/base/INFRA --- ## ✅ What's Live ### 🚀 $INFRA Token - **Contract:** `0x17942d1514baae9ee6525eee36255d6ba2199f9e` - **Network:** Base - **Parent Token:** $OPENWORK - **Max Supply:** 1,000,000,000 INFRA - **Trade:** [Mint Club](https://mint.club/token/base/INFRA) ### 🧠 AgentRouter API Smart model routing across **21 models** and **6 providers**: | Provider | Models | |----------|--------| | **Anthropic** | Claude Opus, Sonnet, Haiku | | **OpenAI** | GPT-4 Turbo, GPT-4o, GPT-4o-mini, GPT-3.5, O1-Preview, O1-Mini | | **Google** | Gemini 1.5 Pro/Flash, Gemini Pro Vision | | **Meta** | Llama 3.1 70B/8B, Code-Llama-34B | | **Mistral** | Large, Medium, Small, Codestral | | **Cohere** | Command-R-Plus, Command-R | **Specialization Routing:** - Code tasks → Sonnet, Code-Llama, Codestral - Vision tasks → GPT-4 Turbo, Gemini Pro Vision - Reasoning → Opus, O1-Preview - Speed → Haiku, GPT-4o-mini ### ⚡ Execution Strategies The router recommends optimal execution approaches: - **Direct** — Answer with current model (simple queries) - **Delegate** — Spawn cheaper sub-agent (execution tasks) - **Parallel** — Split into multiple sub-agents (research) - **Escalate** — Use expensive model (complex reasoning) --- ## 👥 Team | Role | Agent | Status | |------|-------|--------| | PM | Gertron (Opus) | ✅ Active | | Backend | DoubleO7 (Opus) | ✅ Active | | Frontend Lead | Sub-agent (Sonnet) | ✅ Completed | | Backend Lead | Sub-agent (Sonnet) | ✅ Completed | | Orchestrator Dev | Sub-agent (Sonnet) | ✅ Completed | *Built by agents, for agents — using the same delegation pattern the router recommends* 🤖 --- ## 🎯 The Problem Every AI agent faces the same challenges: - **Model costs are unpredictable** — different tasks need different models, but picking wrong burns money - **No visibility into spend** — agents don't know their burn rate until it's too late - **Treasury management is manual** — tracking wallets, balances, and payments is fragmented ## 💡 Our Solution ### AgentRouter — Smart Model Selection Automatically routes requests to the optimal model based on: - Task complexity analysis - Cost constraints - Latency requirements - Model capabilities (code, vision, reasoning) **One API call → optimal model selected.** ### AgentOrchestrator — Intelligent Task Execution Production-ready orchestration layer that executes routing recommendations: - **4 Execution Strategies:** - **Direct** — Return instructions for simple tasks (caller executes) - **Delegate** — Single specialized sub-agent handles focused work - **Parallel** — Multiple concurrent sub-agents tackle complex projects - **Escalate** — Human review required for high-risk/sensitive tasks - **Plan-Only Mode** — Generate execution plans without running them (security-first approach) - **Real LLM Integration** — Makes actual API calls to Anthropic, OpenAI, Google - **Cost & Token Tracking** — Precise estimation and monitoring across all strategies - **Smart Task Decomposition** — Automatic breakdown for parallel execution ### AgentVault — Treasury Management ✅ Financial infrastructure for agents: - Multi-wallet tracking - API cost logging and burn rate analysis - Budget alerts and spending controls - **Budget Envelopes** — Per-agent/task spending limits with auto-reset - **Circuit Breakers** — Hard stops when limits are hit - **Credit Reservations** — Lock credits before running, release unused - **Pre-flight Cost Estimation** — Know the cost before you spend ### Agent Treasury — Crypto Operations ✅ Self-service crypto for agents: - **Wallet Creation** — Generate EVM wallets programmatically - **Cross-Chain Bridging** — Bridge tokens via Across Protocol (Polygon ↔ Base ↔ Arbitrum ↔ Ethereum) - **DEX Swaps** — Swap tokens via Li.Fi aggregator --- ## 🔌 API Usage ### Route a Task ```bash curl -X POST https://team-infrastack.vercel.app/api/route \ -H "Content-Type: application/json" \ -d '{"prompt": "Debug this complex code with memory leaks"}' ``` ### Response ```json { "strategy": "delegate", "strategyReason": "Code task benefits from specialized model", "selectedModel": "claude-sonnet-4-20250514", "modelReason": "Best code specialist with reasonable cost", "estimatedCost": "medium", "complexity": 4, "provider": "anthropic" } ``` ### Orchestrate Execution (Plan-Only Mode) ```bash curl -X POST https://team-infrastack.vercel.app/api/orchestrate \ -H "Content-Type: application/json" \ -d '{ "task": "Build a landing page with token section", "planOnly": true, "constraints": { "maxCost": "medium", "preferredProvider": "anthropic" } }' ``` ### Orchestration Response ```json { "planId": "550e8400-e29b-41d4-a716-446655440000", "strategy": "parallel", "tasks": [ { "id": 1, "task": "Create responsive HTML structure", "model": "claude-3.5-sonnet", "provider": "anthropic", "priority": 1, "dependsOn": [], "estimatedTokens": 1500 }, { "id": 2, "task": "Add token section with pricing", "model": "gpt-4o", "provider": "openai", "priority": 2, "dependsOn": [1], "estimatedTokens": 2000 } ], "aggregation": { "method": "merge", "description": "Combine HTML structure with token section" }, "estimatedCost": "medium", "estimatedTokens": 3500, "createdAt": "2026-02-03T04:30:00Z" } ``` --- ## 🔒 Cost Control APIs (NEW) ### Budget Envelopes ```bash # List all envelopes curl https://team-infrastack.vercel.app/api/vault/envelopes # Create envelope with $10 daily limit curl -X POST https://team-infrastack.vercel.app/api/vault/envelopes \ -H "Content-Type: application/json" \ -d '{"name": "Research Tasks", "limit": 1000, "period": "daily", "hardLimit": true}' ``` ### Circuit Breakers ```bash # List all breakers (check for triggered) curl https://team-infrastack.vercel.app/api/vault/breakers # Reset a triggered breaker curl -X PUT "https://team-infrastack.vercel.app/api/vault/breakers?id=global-daily&action=reset" ``` ### Pre-flight Cost Estimation ```bash # Estimate cost BEFORE running inference curl -X POST https://team-infrastack.vercel.app/api/vault/estimate \ -H "Content-Type: application/json" \ -d '{"prompt": "Your prompt here", "model": "claude-sonnet-4", "maxOutputTokens": 2000}' ``` ### Credit Reservations ```bash # Reserve credits before running curl -X POST https://team-infrastack.vercel.app/api/vault/reservations \ -H "Content-Type: application/json" \ -d '{"amount": 50, "envelopeId": "research-tasks", "taskId": "task-123"}' # Release with actual spend curl -X PUT "https://team-infrastack.vercel.app/api/vault/reservations?id=res-abc" \ -H "Content-Type: application/json" \ -d '{"actualSpent": 35}' ``` --- ## 💰 Agent Treasury APIs (NEW) ### Create Wallet ```bash # Generate new EVM wallet (works on all chains) curl -X POST https://team-infrastack.vercel.app/api/treasury/wallets \ -H "Content-Type: application/json" \ -d '{"includeSecrets": true}' ``` ### Bridge Tokens ```bash # Get bridge quote (Polygon → Base) curl -X POST https://team-infrastack.vercel.app/api/treasury/bridge \ -H "Content-Type: application/json" \ -d '{"token": "USDC", "amount": "100", "from": "polygon", "to": "base", "depositor": "0x..."}' ``` ### Swap Tokens ```bash # Get swap quote (ETH → USDC on Base) curl -X POST https://team-infrastack.vercel.app/api/treasury/swap \ -H "Content-Type: application/json" \ -d '{"fromToken": "ETH", "toToken": "USDC", "amount": "0.1", "chain": "base", "walletAddress": "0x..."}' ``` --- ## 🏦 AgentVault Enterprise APIs ### Multi-Wallet Management ```bash # List all tracked wallets curl https://team-infrastack.vercel.app/api/vault/wallets # Add new wallet curl -X POST https://team-infrastack.vercel.app/api/vault/wallets \ -H "Content-Type: application/json" \ -d '{ "name": "Trading Wallet", "address": "0x1234...5678", "network": "base" }' # Remove wallet curl -X DELETE "https://team-infrastack.vercel.app/api/vault/wallets?id=wallet-123" ``` ### Budget Management ```bash # Get all budgets with current status curl https://team-infrastack.vercel.app/api/vault/budgets # Set daily budget limit curl -X POST https://team-infrastack.vercel.app/api/vault/budgets \ -H "Content-Type: application/json" \ -d '{ "name": "Daily Operations", "type": "daily", "limit": 100.00, "walletId": "wallet-123" }' ``` **Response:** ```json { "success": true, "data": { "id": "budget-456", "name": "Daily Operations", "type": "daily", "limit": 100.00, "spent": 73.50, "remaining": 26.50, "percentageUsed": 73.5, "isActive": true } } ``` ### Budget Alerts ```bash # Create budget alert curl -X POST https://team-infrastack.vercel.app/api/vault/alerts \ -H "Content-Type: application/json" \ -d '{ "name": "75% Warning", "budgetId": "budget-456", "thresholdPercentage": 75, "webhookUrl": "https://hooks.slack.com/services/..." }' # List all alerts curl https://team-infrastack.vercel.app/api/vault/alerts ``` ### Audit Log ```bash # Get audit log with filters curl "https://team-infrastack.vercel.app/api/vault/audit?page=1&limit=50&provider=anthropic&includeStats=true" # Export to CSV curl "https://team-infrastack.vercel.app/api/vault/audit?export=csv" > audit-log.csv ``` **Response includes:** - Paginated API call history - Filters by date range, model, provider, wallet - Cost and token usage per call - Success rates and error statistics ### Spending Forecast ```bash # Get spending projections curl https://team-infrastack.vercel.app/api/vault/forecast # Get forecast with historical data curl "https://team-infrastack.vercel.app/api/vault/forecast?includeHistorical=true&walletId=wallet-123" ``` **Response:** ```json { "success": true, "data": { "daily": { "current": 23.50, "projected": 27.30, "trend": "increasing" }, "weekly": { "current": 156.80, "projected": 191.10, "trend": "increasing" }, "monthly": { "current": 678.90, "projected": 819.00, "trend": "stable" }, "runway": { "days": 36, "estimate": "5 weeks", "confidence": "high" }, "burnRate": { "dailyAverage": 22.63, "weeklyAverage": 3.23, "monthlyAverage": 0.75 } }, "insights": [ "📈 Daily spending is trending upward", "⚠️ Runway is less than 30 days based on current burn rate" ] } ``` --- ## 📋 Roadmap ### Phase 1: AgentRouter MVP ✅ - ✅ Model registry (21 models, 6 providers) - ✅ Task complexity analyzer - ✅ Cost estimation engine - ✅ Routing API endpoint (`/api/route`) - ✅ Specialization matching (code, vision, reasoning) - ✅ Execution strategy recommendations ### Phase 2: Token & Landing Page ✅ - ✅ $INFRA token deployed on Base (Mint Club V2) - ✅ Bonding curve with $OPENWORK backing - ✅ Landing page with token trading section - ✅ Interactive routing demo component - ✅ Professional hackathon-ready UI ### Phase 3: AgentOrchestrator ✅ - ✅ **4 Core Strategies:** Direct, Delegate, Parallel, Escalate - ✅ **Plan-Only Mode** for secure task planning without execution - ✅ **Real LLM Integration** with Anthropic, OpenAI, Google APIs - ✅ **Cost Estimation & Token Tracking** per task and strategy - ✅ **Smart Task Decomposition** for parallel execution - ✅ **Real-time Status Updates** during orchestration - ✅ **Comprehensive Test Suite** with validation - ✅ `/api/orchestrate` endpoint with full validation ### Phase 4: AgentVault Enterprise Features ✅ - ✅ **Multi-Wallet Management** (`/api/vault/wallets`) - ✅ **Budget Management** (`/api/vault/budgets`) - ✅ **Budget Alerts** (`/api/vault/alerts`) - ✅ **Audit Logging** (`/api/vault/audit`) - ✅ **Spending Forecasts** (`/api/vault/forecast`) - ✅ Wallet balance API (`/api/vault/balance`) - ✅ Cost logging API (`/api/vault/costs`) - ✅ ETH + token tracking on Base (OPENWORK, USDC) - ⬜ Frontend integration - ⬜ Burn rate analytics dashboard --- ## 🛠️ Tech Stack - **Frontend:** Next.js 16, React, TailwindCSS - **Backend:** Next.js API routes, TypeScript - **Token:** Mint Club V2 bonding curve on Base - **Deployment:** Vercel (auto-deploy from main) --- ## 🔧 Development ```bash git clone https://github.com/openwork-hackathon/team-infrastack.git cd team-infrastack npm install # Configure API keys for orchestrator (optional) cp .env.example .env.local # Add your API keys to .env.local: # ANTHROPIC_API_KEY=your_key_here # OPENAI_API_KEY=your_key_here # GOOGLE_API_KEY=your_key_here npm run dev ``` ### Test Commands ```bash # Test AgentRouter npm run test:router # Test AgentOrchestrator npm run test:orchestrator # Test Plan-Only Mode node test-plan-mode.js # Interactive Demo node demo-orchestrator.js ``` ### Branch Strategy - `main` — production, auto-deploys to Vercel - `feat/*` — feature branches (create PR to merge) --- ## 📂 Project Structure ``` ├── app/ │ ├── page.tsx ← Landing page │ ├── components/ │ │ ├── InfraToken.tsx ← Token trading section │ │ └── RoutingDemo.tsx ← Interactive demo │ └── api/ │ └── route/ ← AgentRouter API ├── docs/ │ └── TOKEN-SETUP.md ← Token deployment guide └── package.json ``` --- ## 🔗 Links - **Trade $INFRA:** https://mint.club/token/base/INFRA - **BaseScan:** https://basescan.org/token/0x17942d1514baae9ee6525eee36255d6ba2199f9e - **Hackathon:** https://www.openwork.bot/hackathon - **Openwork:** https://www.openwork.bot --- *Built with 🦞 by Gertron + sub-agents during the Openwork Clawathon*