Metadata-Version: 2.4
Name: prism-agentkit
Version: 0.1.3
Summary: Coinbase AgentKit action provider for renting real NVIDIA GPUs on Prism Network.
Project-URL: Homepage, https://prismnetwork.tech
Project-URL: Repository, https://github.com/prismnetwork-tech/prism
License: Apache-2.0
Keywords: agent,agentkit,coinbase,compute,gpu,langchain,prism
Requires-Python: <4.0,>=3.10
Requires-Dist: coinbase-agentkit<0.8,>=0.7
Requires-Dist: prismnetwork>=0.4.0
Requires-Dist: pydantic>=2
Requires-Dist: solana<0.40,>=0.36.6
Description-Content-Type: text/markdown

# prism-agentkit

A [Coinbase AgentKit](https://github.com/coinbase/agentkit) action provider that lets an agent rent and run on real NVIDIA GPUs through [Prism Network](https://prismnetwork.tech). One `pip install` gives your AgentKit agent GPU actions that work in LangChain, LangGraph, and any other AgentKit adapter.

The provider carries its own funded wallet (`PRISM_AGENT_KEY`) and settles onchain in USDG. It never touches the agent's primary wallet, so it composes with any AgentKit wallet provider you already run.

## Install

```bash
pip install prism-agentkit
```

## Actions

- `budget` - the spending limits in force and what the wallet has spent in the last 24 hours.
- `wallet` - the Prism agent's address and USDG/ETH balances.
- `list_gpus` - GPUs available to rent now, with model, VRAM, and price per hour.
- `lease_and_run` - rent a GPU, run a command, return the output (one shot, pays onchain).
- `run` - run another command on a GPU already leased this session.
- `end_lease` - release a lease; billing stops at the release, and the unused deposit returns after settlement.

## Use

```python
import os
from coinbase_agentkit import (
    AgentKit, AgentKitConfig,
    EthAccountWalletProvider, EthAccountWalletProviderConfig,
)
from coinbase_agentkit_langchain import get_langchain_tools
from eth_account import Account
from prism_agentkit import prism_action_provider

# Prism pays with its own wallet (PRISM_AGENT_KEY). AgentKit still wants a wallet
# provider in its config; Prism ignores it, so pass whichever you already use.
wallet = EthAccountWalletProvider(EthAccountWalletProviderConfig(
    account=Account.create(), chain_id="8453", rpc_url="https://mainnet.base.org"))

kit = AgentKit(AgentKitConfig(
    wallet_provider=wallet,
    action_providers=[prism_action_provider()],
))
tools = get_langchain_tools(kit)
```

`tools` are standard LangChain tools; hand them to a LangGraph agent (see `examples/langgraph_gpu_agent.py`), a Vercel AI agent, or any AgentKit adapter.

## Configure

Set the Prism agent's wallet:

```bash
export PRISM_AGENT_KEY=0x...   # agent wallet private key, funded with USDG + gas on Robinhood Chain
export PRISM_ESCROW=0xfD4228eEEfC49e4b76A0CD40af9fdd546220B2FD   # optional, this is the default
```

Set what it may spend:

```bash
export PRISM_MAX_USDG=1              # per lease or generation; the default
export PRISM_DAILY_BUDGET_USDG=5     # rolling 24 hours; the default. 0 removes it
export PRISM_LEDGER_PATH=~/.prism/spend.json   # optional, this is the default
```

The real ceiling is the wallet balance, so fund it with what you are willing to
lose. These limits are the second line, and they exist because a `max_usdg` on
one call says nothing about the fortieth in a row. A model can pass `max_usdg`
to lower the per-call cap for a single lease; it cannot raise it. The MCP server
and the Python SDK write the same ledger, so one wallet has one daily ceiling
however many clients are holding it.

The wallet needs USDG (`0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168`) and Robinhood-Chain ETH for gas. See the [Prism SDK](https://github.com/prismnetwork-tech/prism) for how to fund a fresh wallet.

## Notes

- `lease_and_run` blocks while the machine provisions, usually one to four minutes. Give your agent a long tool-call timeout.
- AgentKit emits a harmless `cca-lite.coinbase.com` analytics warning when it runs offline; it does not affect the actions.
