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();| Method | HTTP | Path | Description |
|---|---|---|---|
benchmarks.getRecent() | GET | /benchmarks/recent | Recent benchmarks |
benchmarks.getMarketMetricAggregates(query?) | GET | /benchmarks/market-metric-aggregates | Per-market metric aggregates |
benchmarks.getVersion() | GET | /benchmarks/benchmark-version | Current benchmark version |
Thresholds & definitions
The thresholds a host must meet, and the definitions of the metrics and operations they are computed from:
| Method | HTTP | Path | Description |
|---|---|---|---|
benchmarks.getThresholds(query?) | GET | /benchmarks/thresholds | Benchmark thresholds |
benchmarks.getMarketThresholds(query?) | GET | /benchmarks/market-thresholds | Per-market thresholds |
benchmarks.getMetrics(query?) | GET | /benchmarks/metrics | Metric definitions |
benchmarks.getOperations() | GET | /benchmarks/operations | Operation definitions |
benchmarks.getMetricProcessors() | GET | /benchmarks/metric-processors | Metric processors |
benchmarks.getTemplatesConfig() | GET | /benchmark-templates/config | Stored benchmark template config |
benchmarks.getTemplatesRefresh() | GET | /benchmark-templates/refresh | Preview 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:
| Method | HTTP | Path | Description |
|---|---|---|---|
benchmarks.getPrediction(id, body) | POST | /benchmarks/{id}/prediction | Benchmark prediction for a node |
benchmarks.seed(id, body) | POST | /benchmarks/{id}/seed | Seed a node benchmark |
benchmarks.submitResults(id, body) | POST | /benchmarks/{id}/submit-results | Submit benchmark results |
Recent benchmark runs for one specific node are available on the Hosts API as hosts.getRecentBenchmarks(id).