Verify TEE attestations, validate signed inference responses, and download attestation reports from 0G Compute providers.
0G Compute providers that advertise verifiability == "TeeML" run inside a Trusted Execution Environment (TEE) and sign every response they produce. The SDK gives you three tools to verify the integrity of a provider and its responses:
verify_service — comprehensive provider attestation check before you use it
process_response — validate a specific response’s TEE signature
Attestation download helpers — fetch raw quotes and signatures for custom verification
Overall validity — True when the quote is available and signers match (or the format is DStack/GPU with a valid attestation)
provider
str
Provider address
service_type, model, verifiability, url
str
From service metadata
tee_signer
str | None
Extracted from the quote
expected_signer
str | None
Signer recorded on-chain, if available
signer_match
bool
True if extracted and expected signers match (or the format is DStack/GPU)
quote_available
bool
Whether the /v1/quote request succeeded
quote_data
dict
Raw quote response
attestation_verified
bool | None
Automata contract verification result (optional)
attestation_format
str | None
"sgx_tdx", "dstack", or "gpu"
errors
list[str]
Non-fatal issues encountered during verification
timestamp
int
Milliseconds since epoch
report_path
str | None
Path to the JSON report, if output_dir was set
verify_service never raises on verification failure — it returns is_valid=False with errors populated. It only raises ServiceNotFoundError if the provider isn’t registered at all.
process_response looks up the service’s verifiability. For "TeeML" providers it:
Fetches the TEE-generated signature for this specific chat_id from <provider_url>/v1/proxy/signature/<chat_id>
Extracts the signer’s public key from the service’s additional_info (which may include a TargetTeeAddress override for separated architectures)
Validates the ECDSA signature over the response content
chat_id is required for verifiable services. Without it, process_response raises InvalidResponseError. For non-verifiable services, chat_id can be omitted — the method returns True regardless.
The expected_signer / signer_match check only works for providers you’ve acknowledged on-chain. Acknowledgement records the provider’s TEE signer to your account:
# First time per providerbroker.inference.acknowledge_provider_signer(provider_address)# Now verify_service can compare extracted vs expected signerresult = broker.inference.verify_service(provider_address)