0g-compute
यह क्या करती है
यह गाइड एजेंट को 0G Compute Network इस्तेमाल करना सिखाती है, जो AI मॉडल चलाने और फ़ाइन-ट्यून करने के लिए साझा GPU कंप्यूटरों का बाज़ार है। इसमें सेटअप के चरण, नकल करने लायक कोड पैटर्न और कमांड-लाइन टूल शामिल हैं।
कब इस्तेमाल करें
- ✓जब आप 0G नेटवर्क पर चलने वाला AI चैटबॉट या इमेज टूल जोड़ना चाहते हों।
- ✓जब आपको कोड से या कमांड लाइन से 0G inference कॉल करना हो।
- ✓जब आप मुख्य नेटवर्क इस्तेमाल करने से पहले testnet पर शुरुआत करना चाहते हों।
Skill का लिंक
https://github.com/internet-court/internet-court-skill/blob/main/vendored/0g/0g-compute/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मुझे एक सरल चैटबॉट चाहिए जो 0G Compute पर चले।”
हर हफ़्ते 5 नई skills, 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
अक्सर पूछे जाने वाले सवाल
किस नेटवर्क से शुरुआत करनी चाहिए?
स्किल पहले विकास के लिए testnet और असली उपयोग के लिए mainnet की सिफ़ारिश करती है।
हर जवाब के बाद 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
- लाइसेंस
- —
- अपडेट की गई
- 26/10/2026
कमेंट
- …
इस repository की और skills
internet-court
7.0kयह आपके एजेंट को AI एजेंट या पेड सेवा से सुरक्षित तरीके से भुगतान और लेन-देन की शुरुआती दिशा देती है, और सही विशेष गाइड बताती है।
genlayer-erc7710-connector
7.0kयह आपके एजेंट को AI समीक्षा के नतीजे को अनुमति प्रणाली से जोड़ने देती है, ताकि खराब समीक्षा एजेंट की अनुमतियाँ सीमित कर सके।
genlayer-intelligent-contracts
7.0kयह आपके एजेंट को AI जज के नियम, सबूत और नतीजे तय करने में मदद करती है, जो जाँचता है कि दूसरा एजेंट अपने अधिकार के दायरे में रहा या नहीं।
x402-erc7710
7.0kयह आपके एजेंट को हर अनुरोध पर वेब सेवा का भुगतान करने और तय सीमा के भीतर लगातार खर्च करने की व्यवस्था में मदद करती है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।