Skip to content

Mirror chat/completions from Python SDK; drop ML inference#5

Merged
adambalogh merged 4 commits intomainfrom
claude/add-ts-chat-completions-ZkER1
May 5, 2026
Merged

Mirror chat/completions from Python SDK; drop ML inference#5
adambalogh merged 4 commits intomainfrom
claude/add-ts-chat-completions-ZkER1

Conversation

@adambalogh
Copy link
Copy Markdown
Contributor

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.

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.
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 5, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedx402-fetch@​1.2.08410010092100

View full report

claude added 3 commits May 5, 2026 14:06
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.
@adambalogh adambalogh merged commit 5d6c37c into main May 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants