Mirror chat/completions from Python SDK; drop ML inference#5
Merged
adambalogh merged 4 commits intomainfrom May 5, 2026
Merged
Mirror chat/completions from Python SDK; drop ML inference#5adambalogh merged 4 commits intomainfrom
adambalogh merged 4 commits intomainfrom
Conversation
Replaces the on-chain ML inference / Web3 client with a TEE LLM client that mirrors opengradient.client.llm: chat (streaming + non-streaming), completion, tool calling, and x402SettlementMode. Implements a minimal x402 client for the og-evm network using viem to sign EIP-3009 TransferWithAuthorization payloads. Drops web3, ABIs, and the ML inference test/utility code.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Mirrors examples/run_x402_llm.py and run_x402_llm_stream.py from the Python SDK so TS users have a copy-paste starting point for chat and streaming chat against TEE-hosted models with x402 settlement.
Drops the custom x402 client (src/x402.ts) and switches to the official x402-fetch package now that the actual settlement network is Base, which x402-fetch supports out of the box. - Default network is now \`base\` (was \`og-evm\`) - LLM lazily builds a wrapped fetch via createSigner + wrapFetchWithPayment - ClientConfig: drop \`rpcUrl\`, add \`maxPaymentValue\` (atomic units) - Switch dep from viem to x402-fetch (viem stays as a transitive dep) - tsconfig: module/moduleResolution to node16 so x402-fetch's exports field is honored
- eslint.config.js: ESLint v9 flat config wired to @typescript-eslint - src/__tests__/client.test.ts: smoke tests for Client construction and the public exports (TEE_LLM, X402SettlementMode, defaults) - package.json test script: --passWithNoTests so empty branches stay green - tsconfig.json: exclude tests from the published build - .github/workflows/ci.yml: lint + test + build on Node 18/20 Drops some now-unused eslint-disable directives left over from the custom x402 client.
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.
Replaces the on-chain ML inference / Web3 client with a TEE LLM client that mirrors opengradient.client.llm: chat (streaming + non-streaming), completion, tool calling, and x402SettlementMode.
Implements a minimal x402 client for the og-evm network using viem to sign EIP-3009 TransferWithAuthorization payloads. Drops web3, ABIs, and the ML inference test/utility code.