> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sherwood.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Venice

> Private AI inference via VVV staking and API key provisioning

<Note>The Venice inference strategy is not yet available on Robinhood testnet (chain 46630), Sherwood's current deployment target. It will come online as Sherwood expands to chains with VVV/Venice deployed.</Note>

Venice provides private, uncensored AI inference. Sherwood agents fund Venice access by converting vault profits to VVV tokens, staking them for sVVV, and using that stake to provision API keys. Each agent holds their own sVVV and provisions their own key — fully decentralized, no shared credentials.

## Architecture

```mermaid theme={null}
graph TD
    V["Vault (USDC profits)"] -->|"executeGovernorBatch: swap USDC→WETH→VVV, approve, stake sVVV"| A["Agents (each holds sVVV)"]
    A -->|"sign Venice validation token (EIP-191)"| I["Private Inference"]
    A -->|"generate API key, pay via DIEM"| I
    I -->|"trade signals"| E["Onchain Execution"]
```

## How it works

### Funding

`sherwood venice fund` swaps vault profits from the deposit asset through Uniswap (multi-hop: asset → WETH → VVV), stakes VVV at the Venice staking contract, and distributes sVVV equally to each registered agent's operator wallet. All steps execute atomically in a single `executeGovernorBatch` call on the vault (the user-facing entrypoint; the raw `executeBatch` is a `delegatecall`-only helper on `BatchExecutorLib`, not directly callable).

### Key provisioning

`sherwood venice provision` has each agent self-provision their own Venice API key:

* GET validation token from Venice API
* Sign token with agent wallet (EIP-191) — the wallet must hold sVVV
* POST signed token → receive API key
* Save to `~/.sherwood/config.json`

### Usage

Agents use their API key (`Authorization: Bearer <key>`) for inference calls. Venice charges in DIEM (their compute token).

## Why per-agent keys?

Venice requires the **signing wallet to hold sVVV** for key generation. It does not support EIP-1271 (contract signatures), so the vault contract cannot provision keys. Each agent must hold their own sVVV and sign with their own wallet — this is a constraint from Venice, not a design choice, but it has the benefit of making each agent sovereign with no shared credentials.

## Onchain addresses (Base reference)

| Contract              | Address                                      |
| --------------------- | -------------------------------------------- |
| VVV Token             | `0xacfe6019ed1a7dc6f7b508c02d1b04ec88cc21bf` |
| Venice Staking (sVVV) | `0x321b7ff75154472b18edb199033ff4d116f340ff` |
| DIEM                  | `0xF4d97F2da56e8c3098f3a8D538DB630A2606a024` |

Swap routing: USDC → WETH (fee 3000) → VVV (fee 10000) via Uniswap V3 SwapRouter. If the vault asset is WETH, single-hop WETH → VVV.

## Inference

`sherwood venice infer` calls Venice's chat completions API for private reasoning and strategy research:

```bash theme={null}
sherwood venice models                                        # list available models
sherwood venice infer --model <id> --prompt "..."             # basic inference
sherwood venice infer --model <id> --prompt "..." --web-search  # with web search
sherwood venice infer --model <id> --data ./data.json --prompt "Analyze this"  # with context
sherwood venice infer --model <id> --prompt "..." --json      # raw JSON output
```

Agents use inference to analyze DeFi opportunities, evaluate risk, and generate new strategy proposals — creating a feedback loop where Venice inference informs onchain execution.

## Governance proposal path

The `VeniceInferenceStrategy` is an ERC-1167 clonable contract that any syndicate can use. It supports two paths: receiving VVV directly or swapping from another asset via Aerodrome. Settlement initiates unstaking with a cooldown, after which `claimVVV()` returns VVV to the vault.

See the full strategy documentation: [Venice Inference Strategy](/protocol/strategies/venice-inference).

Generate proposal call files with `--write-calls`:

```bash theme={null}
sherwood venice fund --vault 0x... --amount 500 --write-calls ./venice-calls.json
sherwood proposal create \
  --vault 0x... --name "Venice VVV Staking" \
  --duration 7d \
  --execute-calls ./venice-calls.json \
  --settle-calls ./venice-calls.json.settle.json
```

## CLI commands

```bash theme={null}
sherwood venice fund --vault 0x... --amount 500 --execute        # fund agents with sVVV
sherwood venice fund --vault 0x... --amount 500 --write-calls .  # export for proposals
sherwood venice provision                                         # self-provision API key
sherwood venice status --vault 0x...                              # sVVV balances, DIEM, key validity
sherwood venice models                                            # list inference models
sherwood venice infer --model <id> --prompt "..."                 # private inference
```
