# 0G Compute

Guides 0G decentralized AI inference, GPU services and its SDK.

- Repository: https://github.com/internet-court/internet-court-skill (7050 stars)
- Category: AI and agents
- License: see repository
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add internet-court/internet-court-skill --skill 0g-compute -g -a claude-code -y`
Codex: `npx skills add internet-court/internet-court-skill --skill 0g-compute -g -a codex -y`
Cursor: `npx skills add internet-court/internet-court-skill --skill 0g-compute -g -a cursor -y`
Gemini CLI: `npx skills add internet-court/internet-court-skill --skill 0g-compute -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add internet-court/internet-court-skill`

## Description

0G Compute Network guide for decentralized AI inference, fine-tuning, and GPU services. Covers chatbots, image generation, speech-to-text, SDK integration (0g-serving-broker), processResponse API, broker.inference methods, CLI commands (0g-compute-cli), and account management. Use this skill for any 0G compute, 0G AI, or decentralized GPU question.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 0G Compute Network

This skill provides instructions for building with the 0G Compute Network, a decentralized GPU marketplace for AI inference and model fine-tuning. Follow these patterns exactly when generating code.

## Code Generation Rules

1. Copy code patterns from this skill verbatim. Do NOT generate from training data.
2. Call `processResponse()` after every API response (see processResponse section below).
3. Use environment variables for private keys. Never hardcode secrets.
4. Route users to testnet for initial development.

When unsure about a pattern, reference the detailed guides:
- Inference patterns: [references/inference.md](references/inference.md)
- Fine-tuning workflow: [references/fine-tuning.md](references/fine-tuning.md)
- Account management: [references/account-management.md](references/account-management.md)
- Production examples: [references/examples/](references/examples/README.md)

## Network Information

| Network | RPC URL | Inference | Fine-tuning |
|---------|---------|-----------|-------------|
| Mainnet | `https://evmrpc.0g.ai` | Yes | Yes |
| Testnet | `https://evmrpc-testnet.0g.ai` | Yes | Yes |

Model availability changes frequently. Always use `broker.inference.listService()` or `0g-compute-cli inference list-providers` to check current models. On-chain model names use `org/model-name` format.

## Prerequisites

```bash
node --version  # Must be >= 22.0.0
pnpm add @0glabs/0g-serving-broker        # SDK for applications
pnpm add @0glabs/0g-serving-broker -g     # CLI for direct usage
```

## Quick Setup

```bash
0g-compute-cli setup-network              # Choose testnet or mainnet
0g-compute-cli login                       # Login with wallet private key
0g-compute-cli deposit --amount 10         # Deposit funds
0g-compute-cli get-account                 # Check balance
```

## Inference (SDK)

```typescript
import { ethers } from "ethers";
import { createZGComputeNetworkBroker } from "@0glabs/0g-serving-broker";

The rest: https://github.com/internet-court/internet-court-skill/blob/HEAD/vendored/0g/0g-compute/SKILL.md
