Jobs

       

    Submit an inference job — selects the best available node and returns routing info.

    Routes an inference request to the highest-reputation node that meets the model's GPU tier requirement. Returns the assigned node address, estimated cost, and on-chain instructions for calling the JobRegistry contract. The input is hashed for on-chain verification. If no eligible nodes are online, the request is rejected with a 503.

    Endpoint

    POST/api/jobs/submit

    Headers

    KeyValueRequired
    Content-Typeapplication/jsonRequired

    Request Body

    FieldTypeRequiredDescription
    modelIdstringRequiredID of the compressed model (e.g. llama-3.1-8b-compressed).
    inputstringRequiredThe inference prompt or input text.
    requesterAddressstringRequiredEthereum address of the requester.

    Response

    FieldTypeDescription
    modelIdstringConfirmed model ID.
    assignedNodestringEthereum address of the selected node.
    nodeReputationnumberReputation score of the assigned node.
    estimatedCostWeistringEstimated job cost in wei.
    estimatedCostEthstringEstimated job cost in ETH.
    inputHashstringHash of the input for on-chain reference.
    instructionsobjectStep-by-step on-chain instructions.

    Example Usage

    Request

    {
      "modelId": "llama-3.1-8b-compressed",
      "input": "Explain quantum computing in simple terms.",
      "requesterAddress": "0xAbC1230000000000000000000000000000000001"
    }

    Response

    {
      "ok": true,
      "data": {
        "modelId": "llama-3.1-8b-compressed",
        "assignedNode": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
        "nodeReputation": 87,
        "estimatedCostWei": "1200000000000000",
        "estimatedCostEth": "0.0012",
        "inputHash": "4578706c61696e207175616e74756d20636f6d70...",
        "instructions": {
          "step1": "Call JobRegistry.submitJob(\"llama-3.1-8b-compressed\", inputHash) with 0.0012 ETH as msg.value",
          "step2": "Wait for the assigned node to complete the inference"
        }
      }
    }