feat: add Prism Network action provider - #1474
Open
akimstacks wants to merge 1 commit into
Open
Conversation
Gives an agent metered GPU compute on Prism Network, paid per call with USDC on Base over x402. No account and no API key: the agent reads the price from the 402 response, pays from the wallet it already has, and gets the result in the same request. Five actions: get_models and get_gpu_job are free, run_inference and run_batch generate text on a rented GPU, and run_gpu_command runs a shell command on one. Prism prices inference by the token cap requested, so a large cap on a large batch is the one way an agent can spend more than it meant to. maxPaymentUsdc bounds that: any payment option quoted above the cap is dropped before the wallet signs anything. It defaults to 1 USDC. When no GPU is warm the paid endpoints answer with a retry notice and take no payment. The provider reports that as charged: false with the wait in seconds, so an agent waits instead of treating it as a failure. A 429 reads as a cold pool too.
🟡 Heimdall Review Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
prismaction provider for Prism Network: metered GPU compute an agent pays for per call with USDC on Base over x402. No account and no API key sits between the agent and the machine; the agent reads the price from the 402 response, pays from the wallet it already has, and gets the result in the same request.Five actions, no new dependencies (the workspace already ships
@x402/fetchand@x402/evm):get_models(free): the models available for inference and their pricesrun_inference(paid): text generation on a rented GPUrun_batch(paid): several prompts in one request, one payment, with a per-item audit pathrun_gpu_command(paid): a shell command on a rented GPUget_gpu_job(free): poll a submitted jobPrism prices inference by the token cap requested, so a large cap on a large batch is the one way an agent can spend more than it meant to.
maxPaymentUsdc(default 1) drops any payment option quoted above the cap before the wallet signs anything. When no GPU is warm the paid endpoints answer with a retry notice and take no payment; the provider reports that ascharged: falsewith the wait in seconds, and treats a 429 the same way, so an agent waits instead of reading a cold pool as a failure.Tests
16 unit tests alongside the provider; the full typescript suite passes. Proven end to end on Base mainnet through the LangChain example:
Each settlement was submitted by a different Coinbase facilitator address, which is the check that payment went through CDP rather than through Prism itself.