Zing Forum

Reading

TCloud: A TypeScript Toolkit for Decentralized AI Inference

TCloud is the official TypeScript toolkit for Tangle AI Cloud, offering SDK, CLI, Agent, and Relayer components that support decentralized LLM inference, operator routing, reputation-based selection mechanisms, and anonymous payment features.

TCloudTangle AI Cloud去中心化AI隐私推理匿名支付ShieldedCreditsTypeScript SDKLLM推理运营商路由Web3
Published 2026-03-31 02:12Recent activity 2026-03-31 02:24Estimated read 7 min
TCloud: A TypeScript Toolkit for Decentralized AI Inference
1

Section 01

TCloud: A TypeScript Toolkit for Decentralized AI Inference

TCloud is the official TypeScript toolkit for Tangle AI Cloud, a decentralized LLM inference network. It provides SDK, CLI, Agent, and Relayer components, supporting decentralized LLM inference, operator routing, reputation-based node selection, and anonymous payment (ShieldedCredits). Key features include OpenAI API compatibility, privacy protection, anti-censorship, and ease of use, addressing issues like privacy risks and single points of failure in centralized AI services.

2

Section 02

The Rise of Decentralized AI Inference

Centralized AI inference services face privacy risks, censorship concerns, single-point failures, and uncontrollable costs. Decentralized AI inference networks offer an alternative. Tangle AI Cloud is such a network, and TCloud is its official TypeScript toolkit, enabling developers to use distributed computing power while maintaining privacy.

3

Section 03

Project Overview and Core Architecture

TCloud is an open-source TypeScript toolkit (Apache-2.0 license) supporting Node.js and browser environments. It consists of four core components:

  1. tcloud (SDK + CLI): OpenAI-compatible client (zero-dependency fetch), CLI tools (chat, models, operators, etc.), and ShieldedClient for anonymous payments.
  2. tcloud-agent: PrivateAgent (manages conversation state with privacy in mind) and PrivateRouter (supports routing strategies like round-robin, min-exposure, etc.), plus Pi extension for edge device integration.
  3. tcloud-relayer: Gas relay (covers gas fees for privacy transactions), privacy proxy (strips identifying HTTP headers), and streaming proxy (supports SSE for privacy). Its core idea is to balance privacy/anti-censorship benefits with good development experience and API compatibility.
4

Section 04

Privacy Protection Mechanisms

TCloud's privacy features are built on ShieldedCredits and operator rotation:

  • ShieldedCredits: Anonymous payment system using zero-knowledge proofs and EIP-712 SpendAuth, decoupling inference requests from user identity.
  • Operator Rotation: Strategies like min-exposure (least interacted operators), geo-location (specific jurisdictions), and latency-aware (balance privacy and performance) to reduce exposure risk.
5

Section 05

Development Experience and Application Scenarios

Development Experience:

  • Easy installation: npm install tcloud; CLI commands like npx tcloud chat, tcloud auth set-key.
  • SDK examples: OpenAI-compatible code (e.g., client.ask, askStream), privacy mode (TCloud.shielded()).
  • PrivateAgent for advanced privacy: supports routing strategies like min-exposure.

Use Cases:

  • Privacy-sensitive apps (medical, legal, mental health).
  • Anti-censorship communication (distributed operators).
  • Enterprise data sovereignty (geo-specific operators).
  • Edge computing integration (Pi extension for local sensitive processing).
6

Section 06

Technical Details and Comparison with Other Solutions

Technical Details:

  • OpenAI compatibility: Seamless migration for existing OpenAI SDK users (same request/response format, parameters, streaming, function calls).
  • Reputation system: Operators with good service records get more requests, ensuring network reliability.
  • Payment system: Blockchain-based, abstracted via Relayer; users use ShieldedCredits for anonymous payments, operators get rewards.

Comparison:

Feature TCloud Centralized API Self-hosted
Privacy Protection Strong (anonymous payment + operator rotation) Weak Medium (depends on operator)
Anti-censorship Strong Weak Medium
Usability High (OpenAI compatible) High Low
Cost Predictability Medium High Low (hardware cost)
Service Reliability Medium (network scale-dependent) High Depends on self-hosting
Data Sovereignty Controllable Weak Strong
7

Section 07

Summary and Future Outlook

TCloud provides a practical toolkit for decentralized AI inference, allowing developers to experience decentralized services without theoretical barriers. Its OpenAI compatibility lowers migration costs, making it ideal for privacy-focused and anti-censorship applications. Future expectations include more operators, models, and privacy features. For teams wanting to reduce reliance on centralized services, now is a good time to explore TCloud.