Inference

Vanna Inference is provided through a standard Interface that any smart contract can use.

/// @title Infer Call
/// @notice This contract is used to run on-chain inference.
/// This custom contract will set on 0x000000000000000000000000000000000000011a.
interface VannaInference {
    function inferCall(string memory model, string memory input) external returns (string memory);
    function inferCallZK(string memory model, string memory input) external returns (string memory);
}

Below is a smart contract that utilizes the VannaInference interface to run inference on-chain.

contract InferenceExecution {
    string value;
    
    function infer(
        string calldata modelName,
        string calldata inputData
    ) public {
        value = VannaInference(address(0x11a).inferCall(modelName, inputData);
    }

    function zkInfer(
        string calldata modelName,
        string calldata inputData
    ) public {
        value = ArbInference(address(0x11a)).inferCallZK(modelName, inputData);
    }

    function getValue() public view returns (string memory) {
        return value;
    }
}

Last updated