본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)7.0k · #13601

0g-compute

하는 일

이 가이드는 AI 모델을 실행하고 미세 조정하기 위한 공유 GPU 컴퓨터 마켓플레이스인 0G Compute Network를 에이전트가 사용하는 방법을 보여 줍니다. 설정 단계, 복사해 쓸 코드 패턴, 명령줄 도구를 포함합니다.

사용하는 경우

  • ✓0G 네트워크에서 실행되는 AI 챗봇이나 이미지 도구를 추가하고 싶을 때.
  • ✓코드나 명령줄에서 0G 추론을 호출해야 할 때.
  • ✓메인 네트워크를 쓰기 전에 테스트넷에서 시작하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/internet-court/internet-court-skill/blob/main/vendored/0g/0g-compute/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“0G Compute에서 실행되는 간단한 챗봇을 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 추측하지 않고 복사해 쓸 수 있는 코드 패턴을 에이전트에게 줍니다. 네트워크 연결, 요청 전송, 사용 가능한 모델 확인, 각 응답 처리를 다룹니다. 또한 개인 키는 환경 변수에 보관하라고 말합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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

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

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 Type chatID Source Fallback
Chatbot ZG-Res-Key header data.id from response body
Text-to-Image ZG-Res-Key header none
Speech-to-Text ZG-Res-Key header none
Chatbot Streaming ZG-Res-Key header id from stream chunk
Audio Streaming ZG-Res-Key header none

Fine-tuning

Fine-tuning is available on both mainnet and testnet. It is a 6-step CLI process: list pro

자주 묻는 질문

어떤 네트워크부터 시작해야 하나요?

스킬은 처음 개발할 때는 테스트넷을, 실제 사용에는 메인넷을 추천합니다.

왜 에이전트는 각 응답 후 processResponse를 호출해야 하나요?

스킬은 모든 응답에 대해 이를 규칙으로 정해 두었으므로, 에이전트는 이를 건너뛰면 안 됩니다.

에이전트는 어떤 AI 모델을 쓸 수 있는지 어떻게 아나요?

네트워크의 현재 목록을 확인합니다. 사용 가능한 모델은 자주 바뀌기 때문입니다.

상세 정보

작성자의 원본 설명

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.

repo: internet-court/internet-court-skill

인기도

GitHub 스타
7.0k
순위
#13601
라이선스
—
업데이트
2026. 10. 26.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬