DIM · Dagon Inference Marketplace

Sell inference on DIM

You run a model on hardware you control, put the DIM gateway in front of it, and publish a signed listing. Agents find your route through an indexer, call your endpoint directly, and pay per token from a USDC channel they funded themselves. The marketplace never proxies your traffic and never holds anyone's money.

What you run

Component Where it lives What it does
Inference server Your host (vLLM, SGLang, TensorRT-LLM, llama.cpp, a hosted OpenAI-compatible or Anthropic Messages API) Generates tokens. It never sees payment headers.
Gateway (services/gateway) In front of the inference server, behind your TLS edge Serves the signed listing and capacity, admits only funded Holds, signs one receipt per request, accepts vouchers and redeems them on Solana.
Three keys Private files next to the gateway config Listing key (your seller identity), receipt key (signs receipts), settler key (pays transaction fees to redeem). The gateway refuses to start if any two are the same.
Payout token account Solana, any wallet you control Receives USDC when a voucher is redeemed.

Everything else (discovery, probes, rankings) is run by other parties and only reads what your gateway publishes.

How you get paid

  1. A buyer opens a channel. The buyer moves a budget from its own on-chain vault into a channel that names your settler key and your payout token account. Funds stay in the program's vault until redeemed; no marketplace account touches them.
  2. Each request carries a Hold. The buyer signs a 275-byte IM/HOLD/1 message with the channel's session key. It names your route, your price schedule digest and a cap. The gateway checks it against the channel before any token is generated (admission rules).
  3. You sign a receipt. When the request ends, the gateway computes the charge from your signed schedule and the upstream usage, caps it at the Hold's cap, and returns a signed IM/RECEIPT/1 (receipts).
  4. The buyer signs a voucher. A voucher is a cumulative total over receipts the buyer accepts. The gateway checks it against the receipts it issued and stores it (vouchers).
  5. The settler redeems it. Every two seconds by default, the gateway's settler submits the latest voucher per channel in one Solana transaction. The program pays the difference between the voucher total and what was already redeemed straight into your payout token account (payouts).

One transaction settles any number of receipts on a channel: on a local validator, 32 receipts per voucher cost one transaction of 18,594 compute units instead of 32 (gateway README, settlement work across shapes).

The economics, exactly

  • Paid per token. Your schedule sets four rates in micro-USDC per million tokens (input, cached input, visible output, hidden output) plus a per-request fee. The charge is rounded up once per request (price schedules).
  • Billed by outcome. ok pays the full charge. cancelled pays input plus the fee. failed, not_served and policy_unhonored pay zero. Anything above the buyer's cap is yours to absorb.
  • No custody. Buyer funds sit in a program-owned vault and channel. Your money arrives in your own token account by on-chain transfer. There is no marketplace balance to withdraw from and no marketplace fee in the protocol.
  • No signup. There is no registration endpoint and no account. Your listing is a public document at /.well-known/inference-marketplace.json, signed by your listing key. That key is your seller ID.
  • Discovery is a separate fact. An indexer only lists sellers its operator has pinned (the discovery config's sellers list). Ask an indexer operator to add your origin and seller key; the self-check tells you whether a pinned indexer attests to your route.
  • Your costs. Solana fees for redemption, paid in SOL by the settler key (10,000 lamports per redemption transaction on a local validator), plus your own serving costs.

What is always true

  • A request is never served without a valid Hold that fits the channel's remaining funds.
  • No completion byte leaves the gateway before the Hold's claim is durable on disk, so a crash cannot serve unpaid tokens without a receipt.
  • Prompts, outputs, tool arguments and credentials never go on-chain or into receipts. The salt and request body are not persisted.
  • A buyer chooses which receipts to voucher. You protect yourself by refusing new Holds once unvouchered exposure would exceed the channel's funds, which the gateway does automatically.

Next