feat(operator): external backend connect-mode + self-advertised payment config + SDK e2e#10
Merged
Merged
Conversation
…nt config
Lets the operator run against any OpenAI-compatible upstream (cli-bridge,
llama.cpp, …) with no GPU, and makes its payment surface self-describing so
clients configure themselves with zero hardcoded addresses.
- config: `vllm.external` flag. When set, InferenceServer::start connects to
an already-running server at host:port via VllmProcess::connect instead of
spawning vLLM, and the watchdog no longer tries to respawn a backend it
doesn't manage.
- server: /v1/operator now advertises `shielded_credits` + `chain_id`, so a
client can build the ShieldedCredits EIP-712 domain from operator info alone.
- sdk/scripts: end-to-end proofs driving the viem SDK —
- onchain-e2e.mjs: signs a SpendAuth and submits authorizeSpend against a
live ShieldedCredits, asserting the contract's ECDSA.recover accepts the
SDK signature (balance debited, nonce incremented).
- local-onchain-proof.sh: deploys ShieldedCredits + a mock token, funds a
credit account, runs onchain-e2e.
- http-e2e.mjs: full path — SDK signs → operator-lite validates (recover +
on-chain getAccount) → proxies to the backend → completion; verifies the
on-chain spend nonce advances.
Verified locally: anvil + ShieldedCredits + operator-lite + cli-bridge
(claude-code/sonnet) — SpendAuth-gated chat returns a real completion, 402
without payment, settlement advances the on-chain nonce.
tangletools
approved these changes
May 25, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
Local e2e proven (on-chain SpendAuth acceptance + full HTTP path via cli-bridge). Connect-mode + self-advertised payment config are clean. Approving.
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.
Summary
Makes the operator runnable against any OpenAI-compatible upstream with no GPU, and self-describing so clients need no hardcoded addresses — then proves the whole billed inference path end to end with the viem SDK.
vllm.externalflag — when set,InferenceServer::startconnects to an already-running server athost:port(VllmProcess::connect) instead of spawning vLLM, and the watchdog won't respawn a backend it doesn't manage. Lets the operator front cli-bridge / llama.cpp / a stub./v1/operatoradvertisesshielded_credits+chain_idso a client can construct the ShieldedCredits EIP-712 domain from operator info alone (the Tangle Cloud UI relies on this to self-configure).sdk/scripts/):onchain-e2e.mjs— signs a SpendAuth and submitsauthorizeSpendagainst a liveShieldedCredits; the contract'sECDSA.recovermust accept the SDK signature (asserts balance debited + nonce incremented).local-onchain-proof.sh— deploysShieldedCredits+ a mock token, funds a credit account, runs the on-chain proof.http-e2e.mjs— full path: SDK signs →operator-litevalidates (recover + on-chaingetAccount) → proxies to the backend → completion; asserts the on-chain spend nonce advances.Verified locally
anvil +
ShieldedCredits+operator-lite+ cli-bridge (claude-code/sonnet):402 Payment Requiredwithout a SpendAuth;"hello", usage reported);This is the GPU-free local e2e:
operator-litealready had aconnect()path; cli-bridge supplies a real backend via local coding-CLI subscriptions.Test plan
cargo build --bin operator-liteclean (lib changes compile)authorizeSpend)