Below is an example of a minimal smart contract that runs vanilla inference:
ArbInference.sol
pragmasolidity >=0.4.21 <0.9.0;/// @title Infer Call/// @notice This contract is used to run on-chain inference./// This custom contract will set on 0x000000000000000000000000000000000000011a since we set it in precompile.go.interface ArbInference {functioninferCall(bytesmemory model,bytesmemory input) externalreturns (bytesmemory);functioninferCallZK(bytesmemory model,bytesmemory input) externalreturns (bytesmemory);}
VanillaInference.sol
pragmasolidity ^0.8.18;import"contracts/ArbInference.sol";contract VanillaInference {string value;functioninfer(stringcalldata modelName,stringcalldata inputData ) public { value =string(abi.encodePacked(ArbInference(address(0x11a)).inferCall(abi.encodePacked(modelName), abi.encodePacked(inputData)))); }functiongetValue() publicviewreturns (stringmemory) {return value; }}