Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lucid.foundation/llms.txt

Use this file to discover all available pages before exploring further.

Compute SDK

Compute node heartbeat registration and health monitoring

Operations

MethodDescription
searchComputeSearch compute passports
heartbeatSubmit compute node heartbeat
getNodeHealthGet compute node health

Generated Reference

Overview

Compute node heartbeat registration and health monitoring

Available Operations

searchCompute

Search compute passports with ComputeMeta-specific filters including region, runtime, provider type, minimum VRAM, and GPU model. Returns paginated results with full passport details.

Example Usage

import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.compute.searchCompute();

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { computeSearchCompute } from "raijin-labs-lucid-ai/funcs/computeSearchCompute.js";

// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();

async function run() {
  const res = await computeSearchCompute(raijinLabsLucidAi);
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("computeSearchCompute failed:", res.error);
  }
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.LucidSearchComputeRequest:heavy_check_mark:The request object to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit:heavy_minus_sign:Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.LucidSearchComputeResponse>

Errors

Error TypeStatus CodeContent Type
errors.ErrorResponse500application/json
errors.RaijinLabsLucidAiDefaultError4XX, 5XX*/*

heartbeat

Submit a heartbeat from a compute node to register or update its live state. Compute nodes must send heartbeats within the 30-second TTL to remain eligible for matching. Includes queue depth and P95 latency estimates.

Example Usage

import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.compute.heartbeat({
    computePassportId: "<id>",
    status: "healthy",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { computeHeartbeat } from "raijin-labs-lucid-ai/funcs/computeHeartbeat.js";

// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();

async function run() {
  const res = await computeHeartbeat(raijinLabsLucidAi, {
    computePassportId: "<id>",
    status: "healthy",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("computeHeartbeat failed:", res.error);
  }
}

run();

Parameters

ParameterTypeRequiredDescription
requestmodels.ComputeHeartbeat:heavy_check_mark:The request object to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit:heavy_minus_sign:Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.LucidHeartbeatResponse>

Errors

Error TypeStatus CodeContent Type
errors.ErrorResponse400application/json
errors.ErrorResponse500application/json
errors.RaijinLabsLucidAiDefaultError4XX, 5XX*/*

getNodeHealth

Get the current health state of a compute node. Returns 503 if the node’s heartbeat has expired (>30s since last heartbeat).

Example Usage

import { RaijinLabsLucidAi } from "raijin-labs-lucid-ai";

const raijinLabsLucidAi = new RaijinLabsLucidAi();

async function run() {
  const result = await raijinLabsLucidAi.compute.getNodeHealth({
    computePassportId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:
import { RaijinLabsLucidAiCore } from "raijin-labs-lucid-ai/core.js";
import { computeGetNodeHealth } from "raijin-labs-lucid-ai/funcs/computeGetNodeHealth.js";

// Use `RaijinLabsLucidAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const raijinLabsLucidAi = new RaijinLabsLucidAiCore();

async function run() {
  const res = await computeGetNodeHealth(raijinLabsLucidAi, {
    computePassportId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("computeGetNodeHealth failed:", res.error);
  }
}

run();

Parameters

ParameterTypeRequiredDescription
requestoperations.LucidGetHealthRequest:heavy_check_mark:The request object to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit:heavy_minus_sign:Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.LucidGetHealthResponse>

Errors

Error TypeStatus CodeContent Type
errors.ErrorResponse500, 503application/json
errors.RaijinLabsLucidAiDefaultError4XX, 5XX*/*