Back to Discover

aimarket-hub

connector

alexar76

Search and invoke real AI capabilities on modelmarket.dev. Free trial, then USDC on Base.

View on GitHub
0 starsSynced Aug 16, 2026

Install to Claude Code

/plugin marketplace add alexar76/aimarket-hub

README

πŸ“– Read-only mirror. aimarket-hub is published from the canonical AI-Factory monorepo. Pull requests are not accepted β€” any commit pushed here is overwritten by scripts/mirror_satellites.sh on the next sync. 🐞 Found a bug or have a request? Please open an issue.

AIMarket Hub

CI Release Protocol Test coverage License: Apache-2.0

Ecosystem: AICOM overview & live demos Β· Package version: 3.2.1 (pyproject) Β· Community: Discord Β· Pollux Β· Telegram Β· Castor

Federation hub for AI capability discovery, micropayment routing, and plugin-extensible invoke.

Reference implementation of AIMarket Protocol v2. One HTTP surface to search a federated catalog, open payment channels, invoke capabilities with safety and compliance hooks, and settle on-chain β€” without custodial wallets.

Live hubmodelmarket.dev
Well-known/.well-known/ai-market.json
Plugin demo/plugins/demo
Widget demo/widget/demo
Plain-language valuedocs/value.md

Demo


Table of contents


Overview

AIMarket Hub sits between capability providers (factory-shipped products, oracles, peer hubs, data-cap publishers) and consumers (Flutter desktop apps, agents, embeddable widgets, MCP clients).

Problems it solves

ProblemHub answer
Fragmented AI APIsFederated search over .well-known/ai-market.json peers
Per-call payment frictionPre-funded channels β€” one deposit, N micro-invokes, one settlement
Trust in anonymous sellersReputation scores + stake bonds (plugin)
Compliance & auditProvenance receipts on every invoke (Ed25519 + W3C VC)
Unsafe promptsSafety pre-check with signed rejection + refund

Zero-Trust Agent Discovery

No human app-store reviewer. Agents find peers over federation, pass safety + attestation gates, and invoke only verified capabilities β€” cryptographic trust replaces marketing trust.

WhatFederated discover β†’ safety / reputation / TEE plugins β†’ routed invoke
WhyScales to millions of micro-capabilities; malicious listings can’t drain channels
Deep divedocs/killer-feature-zero-trust-discovery.md Β· Ecosystem capabilities

Architecture

System context

C4Context
  title AIMarket Hub β€” system context

  Person(consumer, "Consumer", "App, agent, or widget user")
  Person(provider, "Provider", "Lists capabilities on a hub")

  System(hub, "AIMarket Hub", "Search, route, invoke, settle")
  System_Ext(peers, "Peer hubs", "Federated catalogs")
  System_Ext(factory, "AI-Factory", "Shipped products β†’ capabilities")
  System_Ext(chain, "Base L2", "USDT channels")

  Rel(consumer, hub, "discover Β· channel Β· invoke")
  Rel(provider, hub, "manifest Β· capabilities")
  Rel(hub, peers, "crawl Β· route")
  Rel(hub, factory, "import shipped products")
  Rel(hub, chain, "open/close channel")

Container diagram (this repository)

flowchart TB
  subgraph hub_process["aimarket_hub (FastAPI)"]
    API["api.py β€” REST /ai-market/v2/*"]
    CRW["crawler.py β€” BFS federation"]
    DB["database.py β€” capability index"]
    CH["channels.py β€” ledger + settle"]
    SG["safety_gate.py"]
    PR["plugin.py β€” PluginRegistry"]
    FB["factory_bridge.py"]
    SIG["signing.py β€” Ed25519 manifests"]
  end

  subgraph plugins["plugins/ (entry_points)"]
    P1["safety Β· provenance Β· channels …"]
  end

  subgraph storage["Persistence"]
    SQL[("SQLite / PostgreSQL")]
  end

  API --> CRW
  API --> DB
  API --> CH
  API --> SG
  API --> PR
  API --> FB
  CRW --> DB
  FB --> DB
  DB --> SQL
  PR --> P1
  P1 -.->|"pre/post hooks"| API

Factory import path

Shipped AI-Factory products are indexed as local capabilities on hub startup:

sequenceDiagram
  participant Factory as AI-Factory pipeline.db
  participant Loader as factory_products_loader
  participant Bridge as factory_bridge
  participant Index as database (SQLite)

  Note over Factory,Index: On hub startup or sync script
  Factory->>Loader: COMPLETED / DEPLOYED products
  Loader->>Bridge: normalize capabilities
  Bridge->>Index: upsert source_hub=local
  Index-->>Bridge: indexed count

Sync ops: ../scripts/sync_pipeline_mirror_and_hub.py


Repository layout

aimarket-hub/
β”œβ”€β”€ aimarket_hub/           # Core package
β”‚   β”œβ”€β”€ api.py              # HTTP routes (search, invoke, federation, plugins)
β”‚   β”œβ”€β”€ crawler.py          # Peer discovery (SSRF-hardened BFS)
β”‚   β”œβ”€β”€ database.py         # Capability + peer index
β”‚   β”œβ”€β”€ channels.py         # Payment channel ledger
β”‚   β”œβ”€β”€ plugin.py           # setuptools aimarket.plugins loader
β”‚   β”œβ”€β”€ factory_bridge.py   # AI-Factory product import
β”‚   β”œβ”€β”€ safety_gate.py      # Built-in safety fallback
β”‚   └── …
β”œβ”€β”€ plugins/                # Hub-local plugins (e.g. aimarket-provenance)
β”œβ”€β”€ tests/                  # pytest suite
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ LICENSE                 # Apache-2.0
β”œβ”€β”€ CONTRIBUTORS.md
β”œβ”€β”€ SECURITY.md
└── docs/
    └── value.md

Sibling packages (monorepo root plugins/): 15 plugins β€” top-5 on PyPI (install guide); full set bundled in Docker.


Quick start

Prerequisites

  • Python 3.11+
  • Optional: Docker for container deploy

Install & run

pip install aimarket-hub
# optional core plugins (TEE, channels, reputation, safety, MCP packager):
pip install "aimarket-hub[plugins]"
aimarket serve
# β†’ http://localhost:9083

Verify discovery and search:

curl -s http://localhost:9083/.well-known/ai-market.json | jq .
curl -s "http://localhost:9083/ai-market/v2/search?intent=translate&budget=1" | jq .
curl -s http://localhost:9083/ai-market/v2/plugins | jq '.plugins | length'

Publish a capability (community providers)

Third-party developers list an HTTP endpoint in the catalog and earn USDC when agents invoke it. Production hubs require stake, LUMEN trust scoring, and Ed25519-signed provider responses β€” see docs/supply-security.md.

cd examples/hello-capability && python3 server.py   # terminal 1 β€” prints provider_pubkey
export AIMARKET_ALLOW_LOCAL_PUBLISH=1               # dev only
# production: POST /ai-market/v2/supply/stake first, with your own credential and a
# tx_hash for EVERY positive amount β€” the deposit is verified on-chain and single-use,
# whatever its size, so sub-minimum drip-feeding cannot reach the stake gate.
aimarket publish capability.json --hub http://127.0.0.1:9083
aimarket invoke demo-hello/greet@v1 --input '{"name":"dev"}'

Full walkthrough (20 languages): ARGUS developer guide Β· supply security Β· example in examples/hello-capability/.

Docker

Production (this monorepo): always redeploy Hub from repo root:

./scripts/deploy_hub.sh
# or full fleet: ./scripts/deploy_ecosystem.sh

See docs/deploy-ecosystem.md. Do not use cd aimarket-hub && docker compose up for production redeploy (wrong build context).

Recovery (factory hold, backup/restore, fleet redeploy): docs/recovery-mechanisms.md in the factory monorepo.

Manual build (same as deploy script):

docker build -f aimarket-hub/Dockerfile -t modelmarket-hub .
docker run -p 9083:9083 \
  -e AIMARKET_HUB_NAME="My Hub" \
  -e AIMARKET_HUB_URL="https://my-hub.example.com" \
  -e AIMARKET_PAYMENT_RECIPIENT="0xYourWallet" \
  modelmarket-hub

Core API

MethodPathDescription
GET/.well-known/ai-market.jsonRoot discovery β€” chain, token, peers, signer key
GET/ai-market/v2/manifestEd25519-signed capability catalog
GET/ai-market/v2/searchNL federated search (intent, budget, category)
POST/ai-market/v2/supply/stakeDeposit publisher stake (unlock community publish)
POST/ai-market/v2/supply/registerPublish community capability + invoke_url
POST/ai-market/v2/invokeInvoke capability (plugin hooks, safety gate)
POST/ai-market/v2/channel/openOpen pre-funded payment channel
POST/ai-market/v2/channel/closeClose channel β€” settle + refund remainder
POST/ai-market/v2/federation/announcePeer hub announcement
GET/ai-market/v2/federation/peersKnown peers + trust scores
POST/ai-market/v2/federation/crawlTrigger BFS crawl of seed peers
GET/ai-market/v2/pluginsLoaded plugin catalog
GET/ai-market/v2/reputation/{hub_url}Trust score breakdown
GET/ai-market/v2/stats/liveReal-time invocation feed

Authorization. /supply/register takes the shared AIMARKET_PUBLISH_TOKEN. The routes that move or encumber stake β€” /supply/stake and /self-bond/register β€” take the caller's OWN credential from AIMARKET_PUBLISHER_TOKENS (or AIMARKET_ADMIN_TOKEN), because a shared token cannot prove which publisher is calling; in production a hub with neither configured refuses them with 503. /self-bond/slash and every settlement/federation route are admin-only.

OpenAPI: /docs (FastAPI's default β€” there is no AIMARKET_OPENAPI switch; put the hub behind your proxy if the schema should not be public). Full spec: ../aimarket-protocol/spec.md


Invoke lifecycle

Standard consumer flow (implemented by aimarket_agent):

sequenceDiagram
  autonumber
  participant Client
  participant Hub as AIMarket Hub
  participant Plugins
  participant Target as Provider / local invoke

  Client->>Hub: search(intent, budget)
  Hub-->>Client: plan[]

  Client->>Hub: channel/open(deposit_usd)
  Hub-->>Client: channel_id

  Client->>Hub: invoke(capability_id, input, channel_id)
  Hub->>Plugins: on_invoke_pre_check
  alt rejected
    Plugins-->>Hub: signed rejection
    Hub-->>Client: 403 + channel refund
  else ok
    Hub->>Target: forward or local execute
    Target-->>Hub: output, price_usd
    Hub->>Plugins: on_invoke_post_check
    Hub-->>Client: result + provenance_receipt
  end

  Client->>Hub: channel/close(channel_id)
  Hub-->>Client: settlement + unused balance

Plugin ecosystem

Plugins register via aimarket.plugins entry points (plugin.py). Each ships README + docs/ (value.md, user-guide.md, sdk-integration.md, user-cases.md).

Regenerate docs: python3 scripts/bootstrap_hub_plugin_docs.py Β· value text: python3 scripts/bootstrap_product_value.py

flowchart LR
  INV["POST /invoke"] --> PRE["pre-check"]
  PRE --> S["aimarket-safety"]
  PRE --> Z["aimarket-zk"]
  PRE --> PR["aimarket-promo"]
  PRE --> RUN["Execute"]
  RUN --> POST["post-check"]
  POST --> PV["aimarket-provenance"]
  POST --> T["aimarket-tee"]
  POST --> R["aimarket-reputation"]
  POST --> OUT["Response"]
PluginCategoryOne-line value
aimarket-provenancecomplianceCryptographic receipt per AI output
aimarket-safetysecurityBlock jailbreak / injection before billing
aimarket-reputationreputationStake-backed trust scores
aimarket-channelsinfrastructureOff-chain ledger, on-chain settlement
aimarket-teesecurityHardware attestation (Nitro / TDX)
aimarket-auctionmonetizationSpot bidding for scarce slots
aimarket-personastoolingBuyer-friendly agent personas
aimarket-streamingmonetizationSSE + per-token micro-billing
aimarket-nftmonetizationTransferable prepaid credit NFTs
aimarket-mcp-packagertoolingMCP bundle for Claude Desktop
aimarket-orchestratormonetizationNL task β†’ capability chain planner
aimarket-data-capmonetizationPrivate corpus β†’ paid search
aimarket-promomonetizationSigned time-locked discounts
aimarket-datasettoolingWeekly anonymized demand corpus
aimarket-zksecurityZK proofs without revealing input

Federation

Hubs discover each other without a central registry:

flowchart TB
  SEED["AIMARKET_SEED_LIST<br/>.well-known URLs"] --> CRAWL["crawler.py BFS"]
  CRAWL --> MANIFEST["Fetch signed manifests"]
  MANIFEST --> INDEX["database.py"]
  INDEX --> SEARCH["Unified federated search"]

  HUB_A["Hub A"] <-->|announce / peers| HUB_B["Hub B"]
  CRAWL --> HUB_A
  CRAWL --> HUB_B

  INV["invoke to remote capability"] --> ROUTE["Route to peer hub"]
  ROUTE --> FEE["Optional routing_fee_bps"]

Trust scoring: trust.py Β· Signing: signing.py

Deep dive: ../docs/FEDERATION_HUB_REPORT.md


Payments

sequenceDiagram
  participant User
  participant Hub
  participant Chain as Base (USDC)

  User->>Chain: deposit USDC
  User->>Hub: channel/open(deposit_usd)
  Note over Hub: Ledger tracks balance off-chain

  loop each invoke
    User->>Hub: invoke + X-Payment-Channel
    Hub->>Hub: decrement channel balance
  end

  User->>Hub: channel/close
  Hub->>Chain: settle spent + refund remainder
FieldDefaultNotes
ChainBase (L2)AIMARKET_PAYMENT_CHAIN
TokenUSDCAIMARKET_PAYMENT_TOKEN β€” the ledger's default; the advertised catalog is AIMARKET_PAYMENT_TOKENS (USDT,USDC,ETH)
Recipientenv requiredAIMARKET_PAYMENT_RECIPIENT

Protocol principle: no custody β€” channels are on-chain constructs; hub holds ledger state only.

Deposit authorization. In production (AIFACTORY_PROD=1, verify stub off) a channel is credited only by a deposit that is verified on-chain, bound to the wallet that actually paid, single-use (consumed_deposits), and proven by an EIP-191 signature from the paying wallet over payer_proof_challenge(...) β€” the deposit tx hash is public, so without that proof the channel secret would go to whoever quotes it first. AIMARKET_CHANNEL_ALLOW_UNPROVEN_PAYER=1 opts out of the proof (transition only) and logs loudly.


Pay-on-Verified

Opt-in quality escrow on invoke. With a verify block on the invoke body the channel debit becomes a hold; Metis judges the delivered output against the buyer's stated intent in the background β€” pass captures the hold, fail refunds it with a signed rejection receipt. The buyer keeps the output either way; only the money outcome changes.

Whatverify: { requested, intent, mode, wait } on POST /ai-market/v2/invoke β†’ hold_channel β†’ Metis verdict β†’ capture / release
WhyProviders are paid for verified work, not for responding; every verdict emits a reputation event
LookupGET /ai-market/v2/verification/{nonce} (nonce = receipt nonce)
Deep divedocs/pay-on-verified.md Β· Cross-component doc

Configuration

Every default below is the value the code falls back to today; where a default is derived from another variable, the rule is spelled out rather than a number.

Core

VariableDefaultDescription
AIMARKET_HUB_NAMEAIMarket HubDisplay name in manifests
AIMARKET_HUB_URLhttp://localhost:9083Public URL (receipts, well-known)
AIFACTORY_PRODβ€”1 puts every money gate on the production path (on-chain verification required, fail-closed defaults)
AIFACTORY_CRYPTO_ENABLED0Master crypto switch: off β‡’ channels/escrow/NFT disabled, capabilities served free; signing and sandbox trials keep working
AIMARKET_PAYMENT_CHAINbaseSettlement chain (AIMARKET_PAYMENT_CHAINS for the advertised list)
AIMARKET_PAYMENT_TOKENUSDCLedger settlement token (AIMARKET_PAYMENT_TOKENS advertises USDT,USDC,ETH)
AIMARKET_PAYMENT_RECIPIENTβ€”Required in production β€” the wallet deposits must pay
AIMARKET_CRAWL_INTERVAL_S3600Federation crawl period
AIMARKET_ROUTING_FEE_BPS100Routing fee (1% = 100 bps)
AIMARKET_MIN_TRUST_SCORE0.3Baseline trust floor (also the discover-gate default below)
AIMARKET_SEED_LISTcommitted federation_seeds.jsonComma-separated peer .well-known URLs; unset falls back to the shipped seed file, not to "no seeds"
AIMARKET_PLUGIN_WHITELISTβ€”Restrict loaded plugins
AIMARKET_ADMIN_TOKENβ€”Operator token. Unset β‡’ every admin route refuses (503), fail-closed
AIMARKET_PUBLISH_TOKENβ€”Shared token for /supply/register. Unset β‡’ publish disabled
AIMARKET_PUBLISHER_TOKENSβ€”pub-a:secretA,pub-b:secretB β€” per-publisher credentials for the stake/bond routes (see Security)
AIMARKET_CORS_ORIGINSβ€”Comma-separated allowlist. Empty means no cross-origin access (a * default enabled drive-by CSRF)

Databases

VariableDefaultDescription
DATABASE_URLSQLite filesPostgreSQL for production β€” when set, every subsystem shares it
AIMARKET_DB_PATHdata/hub.dbThe hub index database. It no longer overrides a path a subsystem passes explicitly (that silently aliased channels.db and provenance.db onto the hub file); a subsystem that must share the hub file now points its own variable at it
AIMARKET_CHANNELS_DB_PATHdata/channels.dbPayment-channel ledger (separate file from the hub index)
AIMARKET_VERIFY_SETTLEMENTS_DB_PATHAIMARKET_DB_PATH, else data/hub.dbWhere verified_settlements lives β€” the orphaned-hold reaper reads it and refuses to release anything it cannot read

Upgrading past the shared-database aliasing

This is a one-time migration step for any hub that already ran with AIMARKET_DB_PATH set β€” which includes every container here (Dockerfile, Dockerfile.standalone, docker-compose.yml, docker-compose.core.yml all export it).

Until this release the env var overrode the path a subsystem asked for, so the channel ledger (data/channels.db) and the provenance store (data/provenance.db) were created inside the hub file. Now that the explicit argument wins, those subsystems open their own files β€” and on an upgraded deployment those files start empty:

  • the channel ledger loses its open channels and, more seriously, consumed_deposits β€” the table that makes an on-chain deposit single-use. An empty one lets every deposit already spent be replayed into a new funded channel;
  • the provenance store loses its receipts.

The hub logs this at ERROR on startup (the requested file does not exist while the AIMARKET_DB_PATH file does), naming the file the data is still in. Do one of these before serving traffic:

# A. channel ledger β€” keep the shared file, no data moves, pre-upgrade behaviour exactly
export AIMARKET_CHANNELS_DB_PATH="$AIMARKET_DB_PATH"

# B. channel ledger β€” split it out: copy the file with the hub stopped
cp /app/data/hub.db /app/data/channels.db
export AIMARKET_CHANNELS_DB_PATH=/app/data/channels.db

Either way the tables the copy's owner does not use are simply never read. The provenance store has no path variable β€” it always derives provenance.db from the hub database's directory β€” so B is the only option there (cp /app/data/hub.db /app/data/provenance.db); skipping it starts an empty receipt store, which costs an audit trail but no money.

DATABASE_URL deployments are unaffected β€” PostgreSQL was always one shared database.

Channels

VariableDefaultDescription
AIMARKET_ALLOW_DEMO_CREDITβ€”1 credits a channel without on-chain verification (dev/demo). Outside production, without it, crediting fails closed
AIMARKET_CHANNEL_ALLOW_UNPROVEN_PAYER01 opts OUT of the payer proof-of-control requirement (transition only β€” leaves deposit front-running open)
AIMARKET_CHANNEL_ANON_OPENS_PER_HOUR200One shared cap for all wallet-less opens (they are not exempt)
AIMARKET_CHANNEL_ANON_CLOSES_PER_HOUR600Same, for closes
AIMARKET_CHANNEL_HOLD_REAP_AFTER_SECS86400Release a hold stuck held this long with no live verification; 0 disables the reaper
AIFACTORY_PAYMENT_MIN_CONFIRMATIONS2Confirmations a deposit needs before it counts
AIFACTORY_PAYMENT_VERIFY_STUB01 accepts any tx hash β€” development only

Pay-on-Verified

VariableDefaultDescription
AIMARKET_VERIFY_ENABLED1Pay-on-Verified master switch (per-invoke opt-in still required)
AIMARKET_VERIFY_MIN_PRICE_USD0.05Price floor β€” cheaper invokes are never verification-taxed
AIMARKET_VERIFY_SCORE_THRESHOLD0.7verify_score needed to capture the hold (a value outside 0.0–1.0 falls back to 0.7)
AIMARKET_VERIFY_COUNCIL_MIN_PRICE_USD0.50Route ceiling: council allowed at/above this price, else clamped to fast
AIMARKET_VERIFY_MAX_CONCURRENCY8Cap on simultaneous Metis calls across pending settlements
AIMARKET_VERIFY_ATTEMPT_TIMEOUT_S330Per-attempt Metis HTTP timeout (> Metis 300 s server cap)
AIMARKET_VERIFY_RETRY_BACKOFF_S5Initial transport-retry backoff (exponential, cap 300 s)
AIMARKET_VERIFY_ENGINE_RETRIES2Re-runs after an engine-error envelope before policy applies
AIMARKET_VERIFY_MAX_WAIT_S00 = no verdict deadline; >0 bounds resolution via policy
AIMARKET_VERIFY_FAIL_CLOSED1Indeterminate outcome β‡’ refund the buyer. Only an explicit 0/false/no/off captures instead; an unrecognised value is a typo and still fails closed
AIMARKET_VERIFY_METIS_URLhttp://127.0.0.1:8080Metis base URL (falls back to METIS_URL)
AIMARKET_VERIFY_METIS_KEYβ€”Metis bearer key (falls back to METIS_API_KEY)
AIMARKET_VERIFY_VERIFIER_IDmetis.verify@v1Envelope verifier attribution when a non-Metis verifier serves the slot

Supply security (community publishers)

Full model: docs/supply-security.md. A non-finite or non-numeric value in any threshold below is ignored with a warning and the documented default is used β€” a nan threshold would otherwise silently disable the gate it configures.

VariableDefaultDescription
AIMARKET_SUPPLY_SECURITY_RELAXED01 = dev bypass: zero minimum stake, no response-signature requirement, no slashing
AIMARKET_SUPPLY_MIN_STAKE_USD25 in production, else 10 (0 when relaxed)Stake required to publish
AIMARKET_SUPPLY_PUBLISH_PER_HOUR5Publishes per publisher per hour
AIMARKET_SUPPLY_MIN_TRUST_DISCOVERAIMARKET_MIN_TRUST_SCORE (0.3)Trust floor to appear in discover
AIMARKET_SUPPLY_MIN_TRUST_INVOKE0.35Trust floor to be invoked
AIMARKET_SUPPLY_REQUIRE_RESPONSE_SIGon iff production and not relaxedRequire an Ed25519 provider response signature
AIMARKET_SUPPLY_MAX_INPUT_KEYS32Top-level keys accepted in an invoke input
AIMARKET_SUPPLY_MAX_INPUT_JSON_BYTES32768Invoke input size cap
AIMARKET_SUPPLY_PRODUCT_ALLOWLISTβ€”Comma-separated product_id allowlist
AIMARKET_SUPPLY_SLASH_FAILURE_THRESHOLD3Provider faults within the window before stake is slashed
AIMARKET_SUPPLY_SLASH_FAILURE_WINDOW_S600Fault window (must be > 0; a non-positive value would disable slashing, so it falls back)
AIMARKET_SUPPLY_SLASH_COOLDOWN_S3600At most one failure-driven slash per window; 0 disables the cool-down
AIMARKET_SUPPLY_SLASH_DAILY_CAP_USD10Rolling 24 h cap on failure-driven slashing; 0 disables the cap
AIMARKET_SUPPLY_VERIFIED_FAIL_THRESHOLD3Paid Metis "failed" verdicts before escalation
AIMARKET_SUPPLY_VERIFIED_FAIL_WINDOW_S86400Window for those verdicts
AIMARKET_SUPPLY_VERIFIED_FAIL_MIN_CONSUMERS2Distinct PAYING consumers required β€” one buyer's repeated failures are one voice
AIMARKET_SUPPLY_TRUST_GRAPH_MAX_EDGES1000Trust-graph bound; truncation is logged with the publisher it affected
AIMARKET_ORACLE_FAMILY_URLhttps://oracles.modelmarket.dev/familyLUMEN trust oracle (falls back to ARGUS_ORACLE_FAMILY_URL)

Deployment

Production reference: ../docs/production-modelmarket-dev.md

Checklist itemAction
TLSTerminate at nginx / Caddy β†’ hub container
SecretsAIMARKET_PAYMENT_RECIPIENT, DB URL via env β€” not in git
Factory syncCron or webhook β†’ sync_pipeline_mirror_and_hub.py
Pluginspip install desired plugins before aimarket serve
HealthGET /.well-known/ai-market.json + /ai-market/v2/stats/live

Testing & coverage {#testing--coverage}

CI runs on every push (workflow); coverage badge is refreshed from pytest --cov on main.

cd aimarket-hub
pip install -e ".[dev]"
pytest tests/ -q --cov=aimarket_hub

Development

pip install -e ".[dev]"

Key test modules: test_api.py, test_crawler.py, test_plugin_system.py, test_channels.py, test_cross_hub_integration.py

Add a plugin: create package under ../plugins/ with pyproject.toml entry point aimarket.plugins.


Security

  • SSRF protection on federation crawler (crawler.py)
  • Signed manifests β€” Ed25519 (signing.py)
  • Safety gate on every invoke (safety_gate.py)
  • Verified, single-use stake deposits β€” in production every stake credit needs an on-chain deposit that pays the platform recipient, and the hash is burned by an atomic claim before the credit, so one deposit can never fund two publishers even under concurrent requests. The claim is keyed on the canonical transaction id (an EVM hash is case-insensitive at the JSON-RPC layer, so 0xAB… and 0xab… are one deposit, not two) (supply_security.py)
  • Residual β€” stake deposits are not payer-bound. The stake verifier answers "did somebody pay the platform?", not "did this publisher pay", so whoever submits a matching hash first gets the credit. Binding it needs a publisherβ†’wallet record the stake ledger does not yet have; channel deposits are already bound (see the entry below). Until then, treat a stake deposit hash as a bearer secret and submit it before it is public
  • Single-use channel deposits + payer proof β€” a verified deposit funds exactly one channel and only for the wallet that signed for it (channels.py)
  • Stake mutation is per-subject, slashing is operator-only β€” a shared token can neither credit a stranger's stake nor burn a rival's bond (api.py)
  • Vulnerability reports: SECURITY.md β†’ alexar76@rambler.ru

Related projects

ProjectRelationship
AICOM / AI-FactoryShips products β†’ hub index
aimarket-protocolNormative v2 spec
aimarket-sdksClient SDKs (Dart alpha)
aimarket-widgetEmbeddable UI
oraclesVerifiable math capabilities β€” randomness, VDF, consensus, reputation (listed on hub)
desktop-integrations8 Flutter consumer apps
Ecosystem architectureFull monorepo diagram
dioscuriTwin community agents β€” MNEMOSYNE Q&A

Community

The DIOSCURI twins answer questions from synced GitHub docs.

ChannelTwinBest for
DiscordPolluxHelp, ideas, show-and-tell
TelegramCastorReleases, digests, quick news

Ecosystem map: Alien Monitor Β· AICOM


License

Apache-2.0 β€” see LICENSE. Maintainers: CONTRIBUTORS.md.

Rendered live from alexar76/aimarket-hub's GitHub README β€” not stored, always reflects the source repo.

1 Install Method

NameDescriptionCategorySource
streamable-http remoteHosted streamable-http endpointmcp-serverhttps://modelmarket.dev/mcp

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet β€” be the first to share an update.