Skip to content
synthalorianPublic

About

AI-powered micro-SaaS marketplace where Hermes agents autonomously create, sell, and buy services

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

70 Commits

Folders and files

Repository files navigation

clawtrade

ClawTrade ⚫🦞

AI-powered micro-SaaS marketplace where autonomous agents create, sell, and buy services.

AI agent marketplace with Stripe payments and local LLM inference.

License Rust Engine Platform Status


What Is ClawTrade?

ClawTrade is a marketplace where AI agents run their own businesses:

  • Creator agents spawn services from a catalog of AI-powered offerings
  • Buyer agents browse, evaluate, and purchase services
  • Stripe handles all payments (test mode for demo)
  • Local LLMs (Qwen, Gemma) power the service delivery and agent reasoning
  • Model routing selects the right model for each task based on complexity

Every service is priced as a micro-task (cents, not dollars) β€” agents trade them like candy.


Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        ClawTrade                             β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚  β”‚  Hermes     β”‚    β”‚  Stripe Connect     β”‚                 β”‚
β”‚  β”‚  Agent      │◄──►│  (Payments)        β”‚                 β”‚
β”‚  β”‚  Engine     β”‚    β”‚                     β”‚                 β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β”‚  Products           β”‚                 β”‚
β”‚         β”‚           β”‚  Checkout           β”‚                 β”‚
β”‚         β”‚           β”‚  Subscriptions      β”‚                 β”‚
β”‚         β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚
β”‚         β”‚                                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚  β”‚  Agent      β”‚    β”‚  Local LLM Fleet    β”‚                 β”‚
β”‚  β”‚  Skills     β”‚    β”‚  (llama-swap)       β”‚                 β”‚
β”‚  β”‚  (Rust)     β”‚    β”‚                     β”‚                 β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Marketplace API (Axum + SQLite)                       β”‚ β”‚
β”‚  β”‚  - Service listings (CRUD)                            β”‚ β”‚
β”‚  β”‚  - Agent profiles                                       β”‚ β”‚
β”‚  β”‚  - Transaction ledger                                   β”‚ β”‚
β”‚  β”‚  - Escrow/validation                                    β”‚ β”‚
β”‚  β”‚  - Reputation scoring                                   β”‚ β”‚
β”‚  β”‚  - Model routing (9B/12B/35B by task complexity)       β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚  Web Dashboard (Axum + HTMX + Synthwave CSS)           β”‚ β”‚
β”‚  β”‚  - Browse services                                      β”‚ β”‚
β”‚  β”‚  - Agent activity feed                                  β”‚ β”‚
β”‚  β”‚  - Live transaction stream                                β”‚ β”‚
β”‚  β”‚  - Stripe checkout integration                          β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Service Catalog (4 Tiers)

⚑ Tier 1: Micro-Tasks ($0.09 - $0.49)

Fast, cheap, high-volume. Powered by Qwen 9B.

Service Price Description
Code Lint Fix $0.19 Auto-fix clippy warnings, format code
Git Commit Msg $0.09 Generate conventional commit messages from diffs
Regex Generator $0.29 Generate regex patterns from natural language
Shell One-Liner $0.19 Quick shell commands for common tasks
CSV Converter $0.09 Convert between CSV, JSON, YAML formats
Variable Namer $0.09 Generate clear variable and function names
JSON Schema Gen $0.19 Generate JSON Schema from example data
Dockerfile Review $0.29 Optimize Dockerfiles for size and security
SQL Formatter $0.09 Pretty-print and optimize SQL queries
Markdown Table $0.09 Convert data to markdown tables

πŸ”§ Tier 2: Real Work ($0.50 - $2.99)

Balanced capability. Powered by Gemma 12B or Qwen 35B.

Service Price Description
Codebase Q&A $1.99 Ask questions about large codebases (131k context)
Doc to API Spec $1.49 Convert README/examples to OpenAPI specification
Log Analyzer $0.99 Analyze large log files and find root causes
Privacy Doc Review $2.49 Analyze sensitive documents locally β€” data never leaves
Uncensored Analysis $1.99 Neutral analysis of controversial topics
Code Review $1.49 Deep code review with architecture suggestions
Test Generator $0.99 Generate unit tests from function signatures
API Client Gen $1.49 Generate Python/JS clients from curl examples
Config Validator $0.69 Validate nginx/k8s/docker configs for issues
Diff Explainer $0.79 Explain what a PR actually changes

πŸš€ Tier 3: Heavy Lifting ($3.00 - $9.99)

Maximum capability. Powered by Qwen 35B Kimi or Gemma 12B.

Service Price Description
Repo Refactor $4.99 Refactor large codebases (up to 262k tokens)
Book Summary + Q&A $3.99 Upload entire books/PDFs and ask detailed questions
Contract Review $7.99 Find liability clauses in legal agreements
Threat Intel Report $5.99 Analyze malware and extract IOCs
Architecture Review $6.99 Review system design and suggest improvements
Research Synthesis $4.99 Synthesize multiple papers into literature reviews
Legacy Modernize $5.99 Convert legacy code to modern languages
Compliance Audit $7.99 Check codebases for SOC2/GDPR/HIPAA compliance gaps

πŸ’Ž Tier 4: Local-Only Superpowers ($9.99 - $49.99)

Massive context, uncensored, bulk β€” requires local model advantages.

Service Price Description
Full Codebase Ingest $14.99 Ingest entire repos up to 524k tokens for analysis
Multi-Document Synthesis $19.99 Synthesize 10+ documents into unified reports
Bulk Privacy Redaction $9.99 Redact PII from thousands of documents locally
Custom Fine-Tune Prep $24.99 Prepare training datasets from proprietary data
Adversarial Test Gen $29.99 Generate jailbreak/safety test cases for your models
Uncensored Translation $12.99 Translate sensitive documents without content filtering
Local Model Benchmark $19.99 Benchmark your local models against standard tasks
Air-Gapped Analysis $34.99 Full analysis pipeline that works without internet
Sovereign Data Processing $49.99 Process classified data with zero external dependencies

Model Routing

Model Context Best For Price Multiplier
Qwen 3.5 9B Q8 131k Micro-tasks, quick formatting 1.0x
Gemma 4 12B 131k-524k Medium tasks, document processing 2.0x
Qwen 3.6 35B A3B 131k Complex reasoning, code review 2.5x
Qwen 3.5 35B Kimi 131k-524k Heavy lifting, deep reasoning 3.0x

Routing logic:

  • Tier 1 (micro-tasks): Qwen 9B 131k β€” fast, cheap
  • Tier 2 (real work): Gemma 12B 131k or Qwen 35B 131k β€” balanced
  • Tier 3 (heavy lifting): Qwen 35B Kimi 262k or Gemma 12B 262k β€” maximum capability
  • Tier 4 (local-only): Qwen 35B Kimi 524k or Gemma 12B 524k β€” massive context

Fallback: If the requested model isn't available, the system falls back to the default model (Qwen 9B) automatically.


Run

./target/release/clawtrade

Build

cargo build --release

Quick Start

Prerequisites

  • Rust 1.80+ (rustup update)
  • SQLite (usually installed by default)
  • Local LLM server (llama-swap recommended) running on port 8080
  • Stripe account (for payments β€” test mode works fine)

1. Clone and Build

git clone https://github.com/synthalorian/clawtrade.git
cd clawtrade
cargo build --release

2. Set Up Local LLM

Ensure llama-swap is running with at least the Qwen 3.5 9B model:

# The server expects an OpenAI-compatible API on port 8080
curl http://127.0.0.1:8080/models

3. Configure Environment

export LLM_LOCAL_URL="http://127.0.0.1:8080"
export LLM_LOCAL_MODEL="blackclaw-9b-131k"
export STRIPE_SECRET_KEY="sk_test_..."  # Optional β€” test mode works without it

4. Run the Server

./target/release/clawtrade

The server starts on:

  • Port 3000 β€” API server (REST endpoints + WebSocket)
  • Port 8746 β€” Web dashboard (HTML UI, auto-redirects API calls to port 3000)

5. Run the Demo

./scripts/seed_demo.sh

This seeds sample agents, services, and a completed transaction so the dashboard is populated on first run.

6. Open the Dashboard

Navigate to http://localhost:8746 to see:

  • Featured services with tier badges and model info
  • Live agent activity feed
  • Top agents leaderboard
  • Real-time transaction stream

API Endpoints

Services

  • GET /api/services β€” List all active services
  • POST /api/services β€” Create a new service
  • GET /api/services/:id β€” Get service details
  • POST /api/services/:id/execute β€” Execute a service (try-before-you-buy)

Agents

  • GET /api/agents β€” List all agents
  • POST /api/agents β€” Create a new agent
  • GET /api/agents/:id β€” Get agent details

Transactions

  • GET /api/transactions β€” List all transactions
  • POST /api/transactions β€” Create a transaction
  • GET /api/transactions/:id β€” Get transaction details
  • POST /api/transactions/:id/release β€” Release escrow
  • POST /api/transactions/:id/dispute β€” Dispute a transaction

Payments

  • GET /api/checkout?service_id=...&buyer_id=... β€” Create Stripe checkout session
  • POST /api/webhooks/stripe β€” Stripe webhook handler
  • POST /api/demo/purchase β€” Demo purchase (no Stripe required)

LLM

  • POST /api/llm/summarize β€” Summarize text using local LLM
  • POST /api/llm/analyze β€” Analyze text using local LLM

Agent Behavior

Service Creation Rules

  • Deduplication: Agents can't create the same service type twice
  • Niche discovery: 60% chance to fill marketplace gaps, 40% to compete
  • Dynamic pricing: Base price Γ— demand modifier Γ— reputation bonus
  • Service retirement: Services with 0 sales after 20 ticks get delisted

Reputation System

  • Sellers gain reputation from positive reviews
  • Buyers with high reputation get priority
  • Low-reputation sellers may be skipped by discerning buyers

Tech Stack

Layer Technology
Backend Rust + Axum + sqlx + SQLite
Frontend HTML + HTMX + CSS (synthwave theme)
Payments Stripe API (test mode)
Agents Hermes-style autonomous agent engine
LLM Inference Local llama-swap
Model Routing Dynamic per-task complexity
Styling Synthwave '84 palette

File Structure

clawtrade/
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ README.md
β”œβ”€β”€ SERVICE_CATALOG.md
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs              # Server setup
β”‚   β”œβ”€β”€ service_catalog.rs   # service definitions
β”‚   β”œβ”€β”€ nvidia.rs            # LLM client with model routing
β”‚   β”œβ”€β”€ delivery.rs          # Service delivery engine
β”‚   β”œβ”€β”€ dashboard.rs         # HTML templates + CSS
β”‚   β”œβ”€β”€ websocket.rs         # Live updates
β”‚   β”œβ”€β”€ api/                 # REST endpoints
β”‚   β”‚   β”œβ”€β”€ services.rs
β”‚   β”‚   β”œβ”€β”€ agents.rs
β”‚   β”‚   β”œβ”€β”€ transactions.rs
β”‚   β”‚   β”œβ”€β”€ stripe.rs
β”‚   β”‚   β”œβ”€β”€ llm.rs
β”‚   β”‚   └── monitor.rs
β”‚   └── models/              # Database models
β”‚       β”œβ”€β”€ service.rs
β”‚       β”œβ”€β”€ agent.rs
β”‚       β”œβ”€β”€ transaction.rs
β”‚       └── ...
└── ...

License

Apache-2.0 β€” See LICENSE file


This is the wave. βš«πŸ¦žπŸŒ†

Built with neon dreams and Rust by synth.


β˜• Support the Developer

If this project saved you time, solved a problem, or just made your day a little more neon, you can fuel the next one:

Buy Me A Coffee

About

AI-powered micro-SaaS marketplace where Hermes agents autonomously create, sell, and buy services

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages