ai/build/ and build/guides/. If this file is wrong, the pages and the SDK source win. For the chain SDK generally, see palliora.skill.md.
Facts you must not guess
- Guardians run a small, curated Ollama model set, not an arbitrary one:
gemma3:1b,deepseek-r1:1.5b,llama3.2:1b,qwen3:0.6b. Any other model name submits fine and fails at execution. inferenceComputedoes not return the answer. It returns{ agreementId, blockNumber }. The answer lands later as a separatecompute.resultextrinsic you poll for withscanForBlockEvent.- Poll with a 300-block window, not the SDK’s 20-block default. Real inference is slower than a typical chain transaction.
staking.guardians(address).pubKeyis a guardian’s sr25519 signing key, not its Ed25519 result-decryption key. Using it withgen_shared_keythrows. There is no dynamic public lookup for the decryption key yet; use a known-good out-of-band map.//Bobis the dev-only account used in every example. It’s shared and unsuited to anything real.
Plain inference, the default starting point
Wrapping it as a chat-completions-compatible endpoint
Same call pattern, triggered fromPOST /v1/chat/completions using the request body’s model and messages directly, with the answer wrapped back into an chat-completions-shaped response object. Full example: Build a chat-completions-compatible service.
Threshold-encrypted (private) inference
Needs a 3-guardian group and several crypto helpers (createGuardianGroupAndWatch, testCrypt, gen_stretched_key, encrypt/decrypt, gen_shared_key). See Encrypted compute for the full worked example before attempting this from scratch, the parameter shapes are large and order-sensitive.
TEE execution (hiding the prompt from the compute node’s own operator, not just from other participants) is a separate, additional setting from encryption, live on testnet on Guardians with Intel TDX hardware. See Confidential compute.
Common failures
Full chain-wide table: Troubleshooting.
Do not
- Do not ship the dev-only
//Bobaccount into anything meant to run for real users. - Do not invent a
nodePubvalue for a guardian you haven’t confirmed against a working decrypt. - Do not use em dashes in docs or comments you write for this project.