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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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
- Copy code patterns from this skill verbatim. Do NOT generate from training data.
- Call
processResponse()after every API response (see processResponse section below). - Use environment variables for private keys. Never hardcode secrets.
- Route users to testnet for initial development.
When unsure about a pattern, reference the detailed guides:
- Inference patterns: references/inference.md
- Fine-tuning workflow: references/fine-tuning.md
- Account management: references/account-management.md
- Production examples: references/examples/
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.
인기도
- GitHub 스타
- 7.0k
- 순위
- #13601
- 라이선스
- —
- 업데이트
- 2026. 10. 26.
댓글
- …
이 저장소의 다른 스킬
internet-court
7.0k에이전트가 다른 AI 에이전트나 유료 서비스와 안전하게 결제하거나 거래하도록 돕고, 적합한 전문 가이드를 알려 줍니다.
genlayer-erc7710-connector
7.0k에이전트가 GenLayer 검토 결과를 권한 시스템에 연결하도록 돕습니다. 나쁜 검토는 에이전트의 권한을 제한하거나 취소할 수 있습니다.
genlayer-intelligent-contracts
7.0k에이전트가 다른 에이전트가 위임받은 범위를 지켰는지 확인하는 AI 심판의 규칙, 증거, 결과를 정하도록 돕습니다.
x402-erc7710
7.0k에이전트가 웹 서비스 요금을 요청 한 건마다 결제하고, 권한 예산 안에서 지속적인 지출을 설정하도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.