Ziro is an autonomous AI service agent running on the Fetch.ai mainnet. It serves AI-generated responses via local Ollama models and accepts verified on-chain FET payments per request.
Built as a reference implementation for pay-per-use AI agents in the ASI ecosystem.
Client Ziro Agent Blockchain
│ │ │
├─── AIRequest (prompt) ──────────>│ │
│<── PaymentRequest (0.01 FET) ────┤ │
│ │ │
├─── send 0.01 FET on-chain ───────┼─────────────────────────────>│
├─── PaymentConfirm (tx_hash) ────>│ │
│ ├── verify tx on-chain ───────>│
│ │<─ confirmed ─────────────────┤
│ ├── call Ollama │
│<── AIResponse (result) ──────────┤ │
| Mode | Cost | How |
|---|---|---|
| ASI:One chat | Free | Chat directly at asi1.ai |
| Agent-to-agent | 0.01 FET/request | Direct protocol (see below) |
agent1qtyl39w7mepqkddkvm4xdez20gp6z4kf2gtxrdxewr72kdyvdgy4zr9mlqn
| Model | Used for |
|---|---|
llama3.1:8b |
Short prompts (< 80 chars), fast responses |
qwen2.5:14b |
Long/complex prompts, creative tasks |
llava:13b |
Multimodal (images) |
Model is selected automatically based on prompt length and content.
from uagents import Agent, Context, Model
class AIRequest(Model):
prompt: str
model: str = "qwen2.5:14b"
class PaymentRequest(Model):
wallet: str
amount_afet: int
amount_fet: float
request_id: str
class PaymentConfirm(Model):
request_id: str
tx_hash: str
class AIResponse(Model):
request_id: str
result: str
ZIRO = "agent1qtyl39w7mepqkddkvm4xdez20gp6z4kf2gtxrdxewr72kdyvdgy4zr9mlqn"
# 1. Send request
await ctx.send(ZIRO, AIRequest(prompt="Your question here"))
# 2. On PaymentRequest: send 0.01 FET on-chain, get tx_hash
# 3. Confirm payment
await ctx.send(ZIRO, PaymentConfirm(request_id=req_id, tx_hash=tx_hash))
# 4. Receive AIResponse with resultgit clone https://github.com/YOUR_USERNAME/ziro-agent
cd ziro-agent
python -m venv .venv && source .venv/bin/activate
pip install uagents cosmpy aiohttp
python agent.pyRequires Ollama running locally with at least one model pulled.
- uAgents 0.24.2 — Fetch.ai agent framework
- Ollama — local LLM inference
- Fetch.ai mainnet (fetchhub-4) — on-chain payment verification
- Agentverse mailbox — always-on message delivery