Skip to main content

prismnetwork

Headless GPU leasing on Prism Network for autonomous agents, the Python counterpart to @prismnetwork/agent-sdk. Give it a wallet; it authenticates with a signature, pays on-chain in USDG, provisions a GPU, and runs over SSH. No browser, no dashboard.

pip install prismnetwork
from prismnetwork import PrismAgent, DEFAULT_IMAGE

agent = PrismAgent(private_key=AGENT_KEY, escrow="0xfD4228eEEfC49e4b76A0CD40af9fdd546220B2FD")
agent.authenticate()

lease = agent.lease(image=DEFAULT_IMAGE, duration_seconds=600, min_vram_mib=16000)
out = agent.run(lease, "nvidia-smi")
print(out["stdout"])
agent.end_lease(lease)

What it does

authenticate() signs a challenge with the wallet and exchanges it for a bearer session. lease() gets a quote, funds an on-chain USDG escrow bound to the quote (createLease), waits for the GPU to provision, and returns SSH access. run() executes a command over SSH, retrying through the host's sshd warmup. Metering is per-second; each lease settles on-chain with a verifiable receipt.

Read-only helpers: offers(), balances(), leases(), quote(...), access(id).

Which machine answered

Every session run() opens checks the SSH host key on the far end, and host_key_policy(lease.access) says what that check was worth:

from prismnetwork import host_key_policy

host_key_policy(lease.access)
# {"mode": "attested" | "reported" | "unverified", "fingerprint": ..., "source": ...}

attested means the fingerprint comes out of a hardware report whose signed data commits to the key the guest generated at boot. Prism walks that report and puts the fingerprint on the access grant, and the SDK refuses a session whose host key does not match it, so the operator cannot put a different machine on the other end. The report is checked in our control plane rather than here, so attested says we checked it and this client holds the session to what we published.

reported means the node named the key on the signed report that opened access, which rules out the relay and the network path but not the operator, whose bond is what a dispute reaches instead.

unverified means nobody published a key: capacity brokered from a public cloud has its host key generated by the cloud and never shown to the network, so the key is recorded on first sight and held for the rest of the lease.

Your own ~/.ssh/known_hosts is never touched. The record sits beside the lease's private key and is removed with it by end_lease().

PrismAgent(..., require_host_key=True) refuses to open a session on a lease that publishes no key, rather than trusting whichever machine answers first.

Batch

Pass command= to lease() and the node runs that one command and reports its output instead of granting SSH access:

batch = agent.lease(image=DEFAULT_IMAGE, duration_seconds=600, command="nvidia-smi")
print(batch.result["stdout"])

Batch leases match only suppliers at trust class isolated or above, because the broker path has no signed result channel. Commands are capped at 8 KiB and output at 64 KiB per stream. result(lease_id) and wait_for_result(lease_id) read the output of an already-funded batch lease.

Paying an x402 endpoint

Prism's pay-per-call endpoints take a transfer plus a signature over what the transfer buys, so a payment can only be redeemed against the request it was made for. payment_header builds the X-PAYMENT value:

from prismnetwork import payment_header

body = json.dumps({"model": "llama3.2:3b", "prompt": "what is a prism"}).encode()
header = payment_header(agent.account, tx_hash, body)

Pass the bytes the request actually carries. bound_message and hash_request are exported for a client that builds the envelope itself; they produce the same message the Node SDK signs.

The wallet needs USDG (0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168, 6 decimals) and native Robinhood-Chain gas.

Requires ssh, ssh-keygen and ssh-keyscan on PATH. Chain id 4663, RPC https://rpc.mainnet.chain.robinhood.com.

Prism is pre-production and unaudited. A permissionless supplier is not a trusted computing environment; do not lease with a wallet or workload you cannot lose.

Metadata

Release files for prismnetwork 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prismnetwork 0.3.2
File Size Uploaded
prismnetwork-0.3.2.tar.gz 17.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prismnetwork 0.3.2
File Interpreter ABI Platform
prismnetwork-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 33.6 kB

Release files / prismnetwork-0.3.2.tar.gz

Download URL prismnetwork-0.3.2.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f79bb1940da0b727cca6b7a6cb2cee7742beded2cb5ae65cf52bedf0b397e5d5
BLAKE2b-256 checksum
How to use checksums
7c3ce1d6ee103d6da93f3f8da877b3172fe61e3ad5405dcb39dc8cd4534f6d51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / prismnetwork-0.3.2-py3-none-any.whl

Download URL prismnetwork-0.3.2-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0cfef8bc0df9c239202d4755fe97e5697eacf0814e4f0b690c321944a6dc5a7
BLAKE2b-256 checksum
How to use checksums
4dd7dfba4af532f357a40c782d67fb925253e1d55e6b443bedbde25db07ced18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page