← Protocols
Giza
AI Agent / Web3·Starknet · Ethereum · EVM L2s

Giza

01Description

Verifiable on-chain ML and agent framework. Transpiles PyTorch/sklearn models to Cairo via ONNX, runs inference with proofs, and exposes a Python Agent SDK for trust-minimized DeFi strategies.

02Best for
  • 01verifiable ML agents
  • 02on-chain DeFi strategies
  • 03Cairo zkML transpilation
  • 04agent memory and reflection
  • 05Starknet AI integrations
03Install
  • pip install giza-agents giza-cli
  • giza users login
04Environment variables
VariableScopeDescription
GIZA_API_KEYServerGiza Platform API key for model deployment and proving.
GIZA_AGENT_PASSPHRASEServerPassphrase for the Ape account used by the Agent to sign on-chain transactions.
05Prompt snippet
Use Giza to deploy verifiable ML agents. Train in PyTorch/sklearn, export to ONNX, then `giza transpile model.onnx` to produce Cairo + an Orion-compatible model. `giza models deploy` exposes a proving endpoint. In Python, instantiate `GizaAgent.from_id(id=..., contracts={...}, account=...)` and call `agent.predict(input_feed=...)` — the framework returns the prediction plus a verifiable proof you can post on-chain before executing `agent.execute()` to call your target contract.
06Gotchas
  • Cairo transpilation only supports a subset of ONNX ops (Orion library) — exotic layers (custom attention, dynamic shapes) will fail; stick to feed-forward, conv, and supported activations.
  • Proof generation cost is real: complex models can take seconds-to-minutes per inference; cache predictions where possible and batch on-chain settlements.
  • Model quantization is required — Cairo is a finite-field VM, so float weights are scaled to fixed-point and rounding can shift outputs vs. the PyTorch reference.
  • Agent signing relies on Ape accounts unlocked with `GIZA_AGENT_PASSPHRASE`; never log it and rotate keys when moving to mainnet.
  • On-chain verification gas on Ethereum L1 is high; prefer Starknet or aggregate proofs via the Giza prover network.
07Alternatives