Repository navigation
fix(onboard): smoke test inference before success #3603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c108c07
57769e4
b91f668
6ee069f
4c3bd0f
68d9be9
33b3136
9af9c3b
ef02afb
70144c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2041,6 +2041,46 @@ | |
| return Boolean(live && live.provider === provider && live.model === model); | ||
| } | ||
|
|
||
| function shouldSmokeOpenAiLikeOnboardRoute(provider: string): boolean { | ||
| if (provider === "nvidia-nim" || provider === "nvidia-router") return true; | ||
| return Object.values(REMOTE_PROVIDER_CONFIG).some( | ||
| (entry) => entry.providerName === provider && entry.providerType === "openai", | ||
| ); | ||
| } | ||
|
|
||
| function verifyOnboardInferenceSmoke(options: { | ||
| provider: string; | ||
| model: string; | ||
| endpointUrl?: string | null; | ||
| credentialEnv?: string | null; | ||
| }): void { | ||
| if (!shouldSmokeOpenAiLikeOnboardRoute(options.provider)) return; | ||
| if (process.env.VITEST === "true") return; | ||
|
|
||
| const endpointUrl = options.endpointUrl || INFERENCE_ROUTE_URL; | ||
| const credentialEnv = options.credentialEnv || null; | ||
| const apiKey = credentialEnv | ||
| ? hydrateCredentialEnv(credentialEnv) || getCredential(credentialEnv) || "" | ||
| : ""; | ||
| const probe = probeOpenAiLikeEndpoint(endpointUrl, options.model, apiKey, { | ||
| authMode: getProbeAuthMode(options.provider), | ||
| skipResponsesProbe: true, | ||
| }); | ||
|
|
||
| if (probe.ok) { | ||
| console.log(` ✓ Inference smoke passed: ${options.provider} / ${options.model}`); | ||
| return; | ||
| } | ||
|
|
||
| console.error(" Onboard inference smoke check failed."); | ||
| console.error(` Provider: ${options.provider}`); | ||
| console.error(` Model: ${options.model}`); | ||
| console.error(` API base: ${endpointUrl}`); | ||
| if (credentialEnv) console.error(` Credential env: ${credentialEnv}`); | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| console.error(` Upstream error: ${compactText(redact(probe.message || "unknown inference failure"))}`); | ||
| process.exit(1); | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| function verifyCompatibleEndpointSandboxSmoke(options: { | ||
| sandboxName: string; | ||
| provider: string; | ||
|
|
@@ -7708,6 +7748,7 @@ | |
| } | ||
|
|
||
| verifyInferenceRoute(provider, model); | ||
| verifyOnboardInferenceSmoke({ provider, model, endpointUrl, credentialEnv }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Run the smoke probe on the resume fast-path too. These probes run in Suggested fix if (isRoutedInferenceProvider(provider)) {
try {
await reconcileModelRouter();
} catch (err) {
console.error(
` ✗ Failed to reconcile model router: ${err instanceof Error ? err.message : String(err)}`,
);
process.exit(1);
}
}
skippedStepMessage("inference", `${provider} / ${model}`);
+ verifyOnboardInferenceSmoke({ provider, model, endpointUrl, credentialEnv });
if (nimContainer && sandboxName) {
registry.updateSandbox(sandboxName, { nimContainer });
}Also applies to: 7989-7989 🤖 Prompt for AI Agents |
||
| if (sandboxName) { | ||
| registry.updateSandbox(sandboxName, { model, provider }); | ||
| } | ||
|
|
@@ -7983,6 +8024,7 @@ | |
| } | ||
|
|
||
| verifyInferenceRoute(provider, model); | ||
| verifyOnboardInferenceSmoke({ provider, model, endpointUrl, credentialEnv }); | ||
| if (sandboxName) { | ||
| registry.updateSandbox(sandboxName, { model, provider }); | ||
| } | ||
|
|
@@ -10878,4 +10920,6 @@ | |
| checkTelegramReachability, | ||
| TELEGRAM_NETWORK_CURL_CODES, | ||
| verifyCompatibleEndpointSandboxSmoke, | ||
| verifyOnboardInferenceSmoke, | ||
| shouldSmokeOpenAiLikeOnboardRoute, | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this page.