Skip to content

Benchmarks API ​

The Benchmarks API exposes the benchmark system that validates GPU hosts: recent benchmark runs, per-market metric aggregates and thresholds, and the metric/operation definitions behind them. It also contains the routes nodes use to submit their benchmark results.

Benchmark data ​

ts
import { 
function createNosanaClient(network: NosanaNetwork | undefined, customConfig: PartialClientConfig & {
    connect: ConnectFactoryConfig & {
        clientSecret: string;
    };
}): NosanaClient & {
    connect: ServerConnect;
} (+3 overloads)
createNosanaClient
,
type NosanaNetwork = "mainnet" | "devnet" | "localnet"
const NosanaNetwork: {
    readonly MAINNET: "mainnet";
    readonly DEVNET: "devnet";
    readonly LOCALNET: "localnet";
}
NosanaNetwork
} from '@nosana/kit';
const const client: NosanaClientclient = function createNosanaClient(network?: NosanaNetwork, customConfig?: PartialClientConfig): NosanaClient (+3 overloads)createNosanaClient(
const NosanaNetwork: {
    readonly MAINNET: "mainnet";
    readonly DEVNET: "devnet";
    readonly LOCALNET: "localnet";
}
NosanaNetwork
.type MAINNET: "mainnet"MAINNET, {
PartialClientConfig.api?: Partial<APIConfig> | undefinedapi: { apiKey?: string | undefinedapiKey:
const process: {
    env: Record<string, string>;
}
process
.env: Record<string, string>env.stringNOSANA_API_KEY },
}); // Recent benchmark runs across the network const const recent: Record<string, unknown>recent = await const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.benchmarks: NosanaBenchmarksApibenchmarks.NosanaBenchmarksApi.getRecent: () => Promise<Record<string, unknown>>getRecent(); // Per-market metric aggregates const const aggregates: Record<string, unknown>aggregates = await const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.benchmarks: NosanaBenchmarksApibenchmarks.NosanaBenchmarksApi.getMarketMetricAggregates: (request?: MarketMetricAggregatesRequest) => Promise<Record<string, unknown>>getMarketMetricAggregates(); // Current benchmark version const const version: Record<string, unknown>version = await const client: NosanaClientclient.NosanaClient.api: NosanaApiClientapi.benchmarks: NosanaBenchmarksApibenchmarks.NosanaBenchmarksApi.getVersion: () => Promise<Record<string, unknown>>getVersion();
MethodHTTPPathDescription
benchmarks.getRecent()GET/benchmarks/recentRecent benchmarks
benchmarks.getMarketMetricAggregates(query?)GET/benchmarks/market-metric-aggregatesPer-market metric aggregates
benchmarks.getVersion()GET/benchmarks/benchmark-versionCurrent benchmark version

Thresholds & definitions ​

The thresholds a host must meet, and the definitions of the metrics and operations they are computed from:

MethodHTTPPathDescription
benchmarks.getThresholds(query?)GET/benchmarks/thresholdsBenchmark thresholds
benchmarks.getMarketThresholds(query?)GET/benchmarks/market-thresholdsPer-market thresholds
benchmarks.getMetrics(query?)GET/benchmarks/metricsMetric definitions
benchmarks.getOperations()GET/benchmarks/operationsOperation definitions
benchmarks.getMetricProcessors()GET/benchmarks/metric-processorsMetric processors
benchmarks.getTemplatesConfig()GET/benchmark-templates/configStored benchmark template config
benchmarks.getTemplatesRefresh()GET/benchmark-templates/refreshPreview benchmark template diff

Node-facing routes ​

Used by the node software during benchmarking — you normally don't call these unless you are building or operating a host:

MethodHTTPPathDescription
benchmarks.getPrediction(id, body)POST/benchmarks/{id}/predictionBenchmark prediction for a node
benchmarks.seed(id, body)POST/benchmarks/{id}/seedSeed a node benchmark
benchmarks.submitResults(id, body)POST/benchmarks/{id}/submit-resultsSubmit benchmark results

Recent benchmark runs for one specific node are available on the Hosts API as hosts.getRecentBenchmarks(id).