본문으로 건너뛰기
cccskills
무료GitHub에 공개

0g-compute

Build chat, image generation, and speech transcription features on 0G Compute Network, a distributed GPU marketplace. This skill guides SDK integration, model fine-tuning, response processing for billing, and account funding through code patterns and CLI commands.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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.

연동 도구Discord

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Integrating chat and image generation into an application
  • Preparing model fine-tuning jobs
  • Checking balances and funding provider accounts
  • Finding available models and service providers

포함된 파일(11)

  • SKILL.md7.3 KB
  • .github/workflows/claude-code-review.yml4.5 KB
  • LICENSE345 B
  • README.md2.5 KB
  • references/account-management.md20.3 KB
  • references/examples/README.md4.9 KB
  • references/examples/speech-to-text.md17.5 KB
  • references/examples/streaming-chat.md17.1 KB
  • references/examples/text-to-image.md14.9 KB
  • references/fine-tuning.md18.1 KB
  • references/inference.md12.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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:

Network Information

NetworkRPC URLInferenceFine-tuning
Mainnethttps://evmrpc.0g.aiYesYes
Testnethttps://evmrpc-testnet.0g.aiYesYes

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

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

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)

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

const RPC_URL = process.env.NODE_ENV === 'production'
  ? "https://evmrpc.0g.ai"
  : "https://evmrpc-testnet.0g.ai";

const provider = new ethers.JsonRpcProvider(RPC_URL);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
const broker = await createZGComputeNetworkBroker(wallet);

// Discover services
const services = await broker.inference.listService();
services.forEach(s => {
  console.log(`${s.provider} | ${s.model} | ${s.serviceType}`);
});

// Make inference request
const { endpoint, model } = await broker.inference.getServiceMetadata(providerAddress);
const headers = await broker.inference.getRequestHeaders(providerAddress);

const response = await fetch(`${endpoint}/chat/completions`, {
  method: "POST",
  headers: { "Content-Type": "application/json", ...headers },
  body: JSON.stringify({ messages, model })
});

const data = await response.json();

// Extract chatID (see chatID table below)
let chatID = response.headers.get("ZG-Res-Key") || response.headers.get("zg-res-key");
if (!chatID) chatID = data.id;

// CRITICAL: Always call processResponse
await broker.inference.processResponse(
  providerAddress,              // 1st: provider address
  chatID,                       // 2nd: response identifier for verification
  JSON.stringify(data.usage)    // 3rd: usage data for fee calculation
);

For streaming, browser SDK, cURL, and Python examples, see references/inference.md.

processResponse (CRITICAL)

Call broker.inference.processResponse() after EVERY API response for fee settlement and TEE verification.

await broker.inference.processResponse(
  providerAddress,              // 1st: provider address
  chatID,                       // 2nd: response identifier for verification
  JSON.stringify(data.usage)    // 3rd: usage data for fee calculation
);

Parameter order: provider, chatID, usageData. Do NOT reorder.

chatID Retrieval by Service Type

Always try ZG-Res-Key response header first. Use fallback only when header is absent.

Service TypechatID SourceFallback
ChatbotZG-Res-Key headerdata.id from response body
Text-to-ImageZG-Res-Key headernone
Speech-to-TextZG-Res-Key headernone
Chatbot StreamingZG-Res-Key headerid from stream chunk
Audio StreamingZG-Res-Key headernone

Fine-tuning

Fine-tuning is available on both mainnet and testnet. It is a 6-step CLI process: list providers, upload dataset, calculate tokens, create task, monitor, download and decrypt.

For the complete workflow, see references/fine-tuning.md.

Account Management

The 0G Compute Network uses Main Accounts (deposits/withdrawals) and Provider Sub-Accounts (service payments). Sub-account refunds have a 24-hour lock period.

0g-compute-cli get-account                                    # Check balance
0g-compute-cli deposit --amount 10                             # Deposit to main
0g-compute-cli transfer-fund --provider <ADDR> --amount 5      # Transfer to sub-account
0g-compute-cli retrieve-fund                                   # Retrieve from sub (24h lock)
0g-compute-cli refund --amount 5                               # Withdraw to wallet

For detailed account management, see references/account-management.md.

CLI Quick Reference

# Inference
0g-compute-cli inference list-providers                        # List all providers
0g-compute-cli inference verify --provider <ADDR>              # Verify TEE attestation
0g-compute-cli inference acknowledge-provider --provider <ADDR> # Required before first use
0g-compute-cli inference get-secret --provider <ADDR>          # Get API key for direct calls
0g-compute-cli inference serve --provider <ADDR> --port 3000   # Local OpenAI-compatible proxy

# Fine-tuning
0g-compute-cli fine-tuning list-providers                      # List fine-tuning providers
0g-compute-cli fine-tuning list-models                         # List available models

# Web UI
0g-compute-cli ui start-web                                    # Launch at localhost:3090

Troubleshooting

ProblemSolution
Insufficient balancedeposit --amount 5 then transfer-fund --provider <ADDR> --amount 2
Provider not acknowledgedinference acknowledge-provider --provider <ADDR>
Provider busy (fine-tuning)Wait and retry, or choose a different provider
Web UI port conflictui start-web --port 3091

Resources

Note: A unified skill covering all 0G services (Compute, Storage, Chain) exists at 0g-agent-skills.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Build servers and clients for A2A, an open protocol that lets AI agents communicate across frameworks. Publish agent capabilities, exchange tasks and results, stream progress, and add notifications for workflows involving multiple agents.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Connect agents built with different frameworks
  • Publish agent capabilities through an Agent Card
  • Build a research, writing, and review workflow
internet-court/internet-court-skill7천2026년 8월 20일 업데이트

Give an AI agent a wallet with administrator-defined transaction limits. The skill covers encrypted key storage, balance checks, and sending funds through code-enforced rules for destinations, amounts, transaction frequency, and emergency shutdown.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Give an agent a wallet with transaction limits
  • Restrict transfers to approved chains and addresses
  • Check balances and active rules before sending
internet-court/internet-court-skill7천2026년 8월 20일 업데이트

Manage a crypto wallet with the awal CLI, including sign-in, balance checks, transfers, swaps, and funding. Also find and pay for APIs through x402, a payment protocol, set up paid endpoints, and query blockchain data on Base.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Check wallet balances across supported networks
  • Send tokens to an address or ENS name
  • Swap tokens or add wallet funds
internet-court/internet-court-skill7천2026년 8월 20일 업데이트

Write TypeScript, Rust, or Python code for Alkahest escrow contracts, which hold assets until conditions are met. Covers creating escrows, submitting fulfillment, collecting payments, and building custom contracts that decide whether requirements have been satisfied.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Integrate Alkahest escrow into an application
  • Build a bot that creates escrows and submits fulfillment
  • Implement payment collection and fulfillment monitoring
internet-court/internet-court-skill7천2026년 8월 20일 업데이트

Use the Alkahest CLI to manage escrow, where assets are held until agreed conditions are met. It covers buyer deposits, seller fulfillment and collection, third-party decisions, token swaps, and reclaiming expired, unfulfilled deposits.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating escrow with release conditions
  • Submitting work and collecting escrowed assets
  • Approving or rejecting fulfillment as an oracle
internet-court/internet-court-skill7천2026년 8월 20일 업데이트

Manage AltLLM Portal API keys for external agents and applications through the local CLI. Covers creation, model access limits, disabling, and revocation, while documenting production failures that currently restrict working operations to listing and creating keys.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • List active and disabled API keys
  • Create an API key for an external application
  • Specify which models a new key can access
internet-court/internet-court-skill7천2026년 8월 20일 업데이트

internet-court의 스킬 모두 보기

이 스킬의 문제 신고