Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
/**
* #3116 — NVIDIA key validation probed the first catalog model (`z-ai/glm-5.1`), which
* requires the "Public API Endpoints" account permission and can hang/be DEGRADED,
* making a *valid* key fail with a misleading "Upstream Error". The probe now defaults to
* a lightweight model from the current hosted catalog, with a per-connection override.
*/
import test from "node:test";
import assert from "node:assert/strict";
import {
NVIDIA_DEFAULT_VALIDATION_MODEL,
resolveNvidiaValidationModel,
} from "../../src/lib/providers/nvidiaValidationModel.ts";
test("defaults to a lightweight model in the current NVIDIA catalog", () => {
assert.equal(NVIDIA_DEFAULT_VALIDATION_MODEL, "nvidia/nemotron-3.5-lightning-30b-a3b");
assert.equal(resolveNvidiaValidationModel(), "nvidia/nemotron-3.5-lightning-30b-a3b");
assert.equal(resolveNvidiaValidationModel({}), "nvidia/nemotron-3.5-lightning-30b-a3b");
assert.notEqual(resolveNvidiaValidationModel(undefined), "z-ai/glm-5.1");
});
test("honors a per-connection validationModelId override", () => {
assert.equal(
resolveNvidiaValidationModel({ validationModelId: "nvidia/llama-3.3-nemotron-super-49b" }),
"nvidia/llama-3.3-nemotron-super-49b"
);
// blank/whitespace override falls back to the default
assert.equal(
resolveNvidiaValidationModel({ validationModelId: " " }),
NVIDIA_DEFAULT_VALIDATION_MODEL
);
});