Skip to main content

Compute Providers

Register your GPU infrastructure as a compute node in the Lucid network. Compute providers serve inference requests routed by TrustGate’s passport matching engine.

Prerequisites

  • GPU server with NVIDIA drivers installed
  • A running inference server (vLLM, TGI, or Ollama)
  • A Lucid API key with compute scope

Register a Compute Node

Create a compute passport representing your GPU node:
const passport = await lucid.passports.create({
  name: "my-gpu-node",
  type: "compute",
  metadata: {
    gpu: "NVIDIA A100",
    vram: "80GB",
    region: "us-east-1",
    inferenceUrl: "http://your-gpu:8080/v1",
    capabilities: ["inference", "fine-tuning"],
    maxConcurrency: 8,
  },
});

console.log("Compute node registered:", passport.id);

Heartbeat

Send regular heartbeats so TrustGate knows your node is alive and can route requests to it:
async function startHeartbeat(passportId: string) {
  setInterval(async () => {
    try {
      await lucid.compute.heartbeat({
        passportId,
        status: "healthy",
        load: await getGPUUtilization(), // 0.0 - 1.0
        availableModels: ["llama-3-70b", "mistral-7b"],
        queueDepth: await getQueueDepth(),
      });
    } catch (err) {
      console.error("Heartbeat failed:", err);
    }
  }, 30_000); // Every 30 seconds
}

startHeartbeat(passport.id);
If heartbeats stop for 2 minutes, the node is marked unhealthy and excluded from routing.

Health Check

const health = await lucid.compute.health(passport.id);
console.log("Status:", health.status);       // healthy | unhealthy | draining
console.log("Uptime:", health.uptimeSeconds);
console.log("Jobs completed:", health.jobsCompleted);
console.log("Avg latency:", health.avgLatencyMs, "ms");
console.log("Error rate:", health.errorRate);

Supported Models

Declare which models your node can serve. TrustGate uses this to match inference requests:
await lucid.compute.updateModels(passport.id, {
  models: [
    { id: "llama-3-70b", maxTokens: 4096, quantization: "fp16" },
    { id: "mistral-7b", maxTokens: 8192, quantization: "awq-4bit" },
    { id: "deepseek-coder-33b", maxTokens: 16384, quantization: "gptq" },
  ],
});

Drain and Deregister

To safely remove a node (e.g., for maintenance):
// Stop accepting new requests, finish in-flight ones
await lucid.compute.drain(passport.id);

// Wait for in-flight requests to complete, then deregister
await lucid.compute.deregister(passport.id);

Monitoring

Track your node’s performance in the Dashboard → Compute section:
  • Request throughput and latency
  • GPU utilization over time
  • Error rates and failure reasons
  • Revenue earned (if participating in the payout system)