Introduction
Welcome to the Qulang documentation. Qulang is a decentralized AI marketplace built on the Qubic network, connecting compute providers with AI developers.
Decentralized Compute
Leverage the power of the Qubic network to run AI models efficiently and cost-effectively.
Open Marketplace
A transparent platform where providers can list models and developers can access them via a unified API.
Architecture
Qulang acts as a bridge between Qubic compute nodes and end-users. The architecture consists of three main components:
- 1Providers: Entities running high-performance hardware that host AI models and expose endpoints.
- 2The Registry: A smart contract system on Qubic that tracks active providers, models, and reputation scores.
- 3The Gateway: The Qulang API that routes user requests to the optimal provider based on latency, price, and availability.
Becoming a Provider
Monetize your hardware by running open-source AI models.
Prerequisites
- A Qubic wallet with a small amount of QUBIC for transaction fees.
- A server with a public static IP or domain name.
- GPU hardware capable of running LLMs (e.g., NVIDIA A100, H100, or consumer RTX 3090/4090 clusters).
Adding Models
Once registered, you can list models on the marketplace.
- Deploy the Model: Run your inference server (e.g., vLLM, TGI) and ensure it exposes an OpenAI-compatible endpoint.
- Register Endpoint: Use the Provider Dashboard to add your endpoint URL.
- Configure Metadata: Set the model name, description, and pricing (QUBIC per 1M tokens).
API Keys
To access the Qulang API programmatically, you need an API key.
Generation
Contact the team to get an API key. Store this key safely; it represents your wallet's balance.
API Reference
Qulang provides an OpenAI-compatible API. This means you can use most existing tools and libraries simply by changing the base URL.
/v1/chat/completionsGenerates a model response for the given chat conversation.
Code Examples
Curl
Standard HTTP request using curl. Replace YOUR_API_KEY with your actual key.
curl -N -X POST http://localhost:7421/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "x-ai/grok-4.1-fast:free",
"messages": [
{
"role": "user",
"content": "Explain quantum computing in one sentence."
}
],
"stream": true
}'Python
Using the official OpenAI Python library.
from openai import OpenAI
# Initialize client with Qulang base URL
client = OpenAI(
base_url="http://localhost:7421/v1",
api_key="YOUR_API_KEY"
)
# Create a streaming chat completion
stream = client.chat.completions.create(
model="x-ai/grok-4.1-fast:free",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a haiku about code."}
],
stream=True
)
# Print the response chunks
for chunk in stream:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="")