Docs

InferNode developer docs

Everything you need to submit inference jobs as a buyer or earn as a provider. This is a hybrid marketplace: payments and registry on Solana, execution off-chain.

Buyer API

Create a job via the REST API or the web app. Funds are locked in an Anchor escrow PDA until the result is delivered.

HTTPcopy
POST /v1/jobs
Authorization: Wallet <signed-message>

{
  "task": "text-generation",
  "model": "llama3.1:8b",
  "input": "Summarize the Solana whitepaper.",
  "max_output_tokens": 512
}

201 Created
{
  "id": "job_a91b",
  "escrow_pda": "7Hk2...fQp9",
  "price_lamports": 285000,
  "status": "PENDING_PAYMENT"
}

Worker CLI

The worker authenticates as a provider, polls for matching jobs, runs inference against your configured endpoint, and submits the result.

bashcopy
# Install
npm i -g infernode-worker

# Init & register
infernode provider init
infernode provider set-endpoint --url http://localhost:11434 --mode ollama
infernode provider register --stake 5 --model llama3.1:8b --price 0.00048

# Run
infernode worker start
infernode worker status

Anchor program

On-chain logic lives in a single Anchor program: provider registry, job escrows, payout release, and refund / slash paths.

rustcopy
initialize_registry(treasury)
register_provider(stake_amount)
deactivate_provider()

create_job(job_id_hash, amount, protocol_fee, expires_at)
assign_provider(job_id_hash, provider)
submit_result_hash(job_id_hash, result_hash)
release_payment(job_id_hash)
refund_job(job_id_hash)
slash_provider(provider, amount)