You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build-with-0g/compute-network/provider.md
+4-33
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,9 @@ Please visit the [releases page](https://github.com/0glabs/0g-serving-broker/rel
85
85
- Copy the `config.example.yaml` file.
86
86
- Modify `servingUrl` to point to your publicly exposed URL.
87
87
- Set `privateKeys` to your wallet's private key for the 0G blockchain.
88
+
- Set `servingUrl` to your service's public URL.
89
+
- Set `targetUrl` to your internal URL corresponding to the prepared LLM service.
90
+
- Set `model` to the model name of your LLM service.
88
91
- Save the file as `config.local.yaml`.
89
92
- Replace `#PORT#` in `docker-compose.yml` with the port you want to use. It should be the same as the port of `servingUrl` in `config.local.yaml`.
90
93
@@ -94,36 +97,4 @@ Please visit the [releases page](https://github.com/0glabs/0g-serving-broker/rel
94
97
docker compose -f docker-compose.yml up -d
95
98
```
96
99
97
-
### Key Commands
98
-
99
-
1.**Register the Service**
100
-
101
-
The compute network currently supports `chatbot` services. Additional services are in the pipeline to be released soon.
102
-
103
-
```bash
104
-
curl -X POST http://127.0.0.1:<PORT>/v1/service \
105
-
-H "Content-Type: application/json" \
106
-
-d '{
107
-
"URL": "<endpoint_of_the_prepared_service>",
108
-
"inputPrice": "10000000",
109
-
"outputPrice": "20000000",
110
-
"Type": "chatbot",
111
-
"Name": "llama8Bb",
112
-
"Model": "llama-3.1-8B-Instruct",
113
-
"verifiability":"TeeML"
114
-
}'
115
-
```
116
-
117
-
-`inputPrice` and `outputPrice` vary by service type, for `chatbot`, they represent the cost per token. The unit is in neuron. 1 A0GI = 1e18 neuron.
118
-
119
-
2.**Settle the Fee**
120
-
121
-
```bash
122
-
curl -X POST http://127.0.0.1:<PORT>/v1/settle
123
-
```
124
-
125
-
- The provider broker has an automatic settlement engine that ensures you can collect fees promptly before your customer's account balance is insufficient, while also minimizing the frequency of charges to reduce gas consumption.
126
-
127
-
### Additional API Information
128
-
129
-
For more details, please refer to the <ahref="/html/compute-network-provider-api.html"target="_blank"rel="noopener noreferrer">API Page</a>.
100
+
The provider broker has an automatic settlement engine that ensures you can collect fees promptly before your customer's account balance is insufficient, while also minimizing the frequency of charges to reduce gas consumption.
Copy file name to clipboardExpand all lines: docs/build-with-0g/compute-network/sdk.md
+50-28
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';
9
9
10
10
## Overview
11
11
12
-
The 0G Compute Network SDK enables developers to integrate AI inference services from the 0G Compute Network into their applications. Currently, the 0G Compute Network SDK supports Large Language Model (LLM) inference services, with fine-tuning and additional features planned for future releases.
12
+
The 0G Compute Network SDK enables developers to integrate AI inference services from the 0G Compute Network into their applications. Currently, the 0G Compute Network SDK supports Large Language Model (LLM) inference services, with fine-tuning and additional features planned for future releases.
13
13
14
14
In just five minutes, you can initialize your broker to manage operations, set up and fund your account to pay for services, and learn how to send requests and handle responses.
@@ -80,57 +83,70 @@ async function initializeBrokerWithWallet() {
80
83
The 0G Compute Network hosts multiple AI service providers. The service discovery process helps you find and select the appropriate services for your needs.
outputPrice:bigint; // Price for output generation
95
-
updatedAt:bigint; // Last update timestamp
96
-
model:string; // Model identifier
97
-
verifiability:string// Indicates how the service's outputs can be verified. 'TeeML' means it runs with verification in a Trusted Execution Environment. An empty value means no verification.
98
+
updatedAt:bigint; // Last update timestamp
99
+
model:string; // Model identifier
100
+
verifiability:string;// Indicates how the service's outputs can be verified. 'TeeML' means it runs with verification in a Trusted Execution Environment. An empty value means no verification.
The 0G Compute Network uses a prepaid account system for each provider. Before using any services, you need to set up and fund an account for each provider you want to use.
0 commit comments