# A local model that pays, on QVAC and WDK

Run an agent whose model lives on the same machine under Tether QVAC with outbound network denied, sees three slim tools and no keys, and still pays in USDT through Abazi.

<ShortProductTruth>**The model chooses. Abazi decides.** A small model on your own machine picks what to buy. It holds no key and no credential, it cannot reach the internet, and every payment it asks for still goes through the owner's mandate.</ShortProductTruth>

## What you end up with [#what-you-end-up-with]

A reference agent on one computer. Its language model is served locally by Tether QVAC and cannot open a network connection to anything but the same machine. You give it a task in plain words; it searches the Catalog, asks to buy one service, and comes back with the result and a receipt link. The payment is a direct USDT transfer on Ethereum or Tron, built on Tether's Wallet Development Kit. The copy-paste setup, with the QVAC configuration and the full agent program, is on [Local model on Tether QVAC](/docs/agents/local-model-qvac).

## How the pieces sit [#how-the-pieces-sit]

| Piece | Runs where | Holds |
| --- | --- | --- |
| Local model (Qwen3 1.7B, 4-bit) | Served by QVAC on the same machine, inside an operating-system sandbox that allows only local connections | Nothing: no key, no credential, no limits |
| Agent program | The same machine | The agent's credential |
| Abazi | Abazi's servers | The mandate, the policy, the budget and the signer |
| USDT spending wallet | Abazi's signer zone, built on Tether WDK | The agent's USDT, funded by the owner and sweepable |

## Steps [#steps]

<Steps>
<Step>

### Start the model locally [#start-the-model-locally]

QVAC serves the model on the same machine through an OpenAI-compatible endpoint (`qvac serve --openai`), with tool calling on. The model is downloaded once. The serving process runs in a sandbox that denies every connection that does not stay on the machine, so the model cannot send your task, or anything else, out.

</Step>
<Step>

### Give the model three slim tools [#give-the-model-three-slim-tools]

The model does not see Abazi's full tool list. It sees three tools with the smallest possible inputs:

| Tool | The model fills in |
| --- | --- |
| `search_catalog` | the search text |
| `request_purchase` | a service id |
| `get_spending_status` | nothing |

The agent program, not the model, adds the task id, the idempotency key, the wait time and the purpose, and attaches the agent credential. The model never sees any of them.

</Step>
<Step>

### Let the model choose [#let-the-model-choose]

Given a task such as "get tomorrow's forecast for Tbilisi", the model calls `search_catalog`, picks a service from the results and calls `request_purchase` with its id.

```text title="Agent output"
QVAC real: local model local-agent (QWEN3_1_7B_INST_Q4) is choosing tools
model -> search_catalog({"query": "weather forecast"})
model -> request_purchase({"service_id": "svc_..."})
{"status": "paid", "intent_id": "pi_...", "receipt_id": "rcpt_..."}
model -> get_spending_status({})
Receipt rcpt_...  verify: <public verification link>
```

</Step>
<Step>

### Abazi decides and pays in USDT [#abazi-decides-and-pays-in-usdt]

Abazi runs the same policy as for any agent. In the reference run, the purchase is paid as a direct USDT transfer from the agent's spending wallet on Tron, or on Ethereum when that is the funded network, and confirmed on chain before the merchant releases the resource.

</Step>
<Step>

### Check the receipt [#check-the-receipt]

The agent prints the receipt id and its public link. Anyone can run the four checks on it. See [Verify a receipt](/docs/guides/verify-a-receipt).

</Step>
</Steps>

## Why the model gets no wallet [#why-the-model-gets-no-wallet]

A wallet tool in the model's hands would let it send money itself, outside Abazi's reserve, sign and confirm sequence, and outside the receipt chain. Keeping the wallet in the signer zone means a confused or manipulated local model can, at worst, ask for a purchase the mandate then refuses.

## Failure cases [#failure-cases]

| Situation | Result |
| --- | --- |
| QVAC is not running | The agent says so and follows a fixed, scripted plan instead of the model; nothing about payments changes. |
| The model asks for something the mandate does not allow | Abazi denies with a reason code, for example <ReasonCode code="RAIL_NOT_ALLOWED" /> or <ReasonCode code="HARD_CAP_EXCEEDED" />. |
| The model tries to reach the internet | The sandbox refuses the connection. |
| The spending wallet runs dry | Denied with <ReasonCode code="NO_FUNDED_CHAIN" />; the owner funds the wallet. |

## Next steps [#next-steps]

<Cards>
  <Card title="Set it up" href="/docs/agents/local-model-qvac" description="QVAC configuration and the agent program, ready to run." />
  <Card title="Supported rails" href="/docs/platform/supported-rails#direct-usdt" description="Compare direct USDT with x402 USDC and virtual cards." />
  <Card title="Custody and keys" href="/docs/concepts/custody-and-keys" description="See who holds the spending wallet and how the owner takes funds back." />
  <Card title="First purchase through MCP" href="/docs/guides/first-purchase-mcp" description="Connect a full agent to all six MCP tools." />
</Cards>

