Normalize inference endpoint URLs

This commit is contained in:
mmckeen-nv
2026-04-29 13:01:59 -07:00
parent 10f5a0b6aa
commit e55dc7b9e0
5 changed files with 63 additions and 7 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ import { existsSync } from "node:fs"
import { readFile, writeFile } from "node:fs/promises"
import path from "node:path"
import { promisify } from "node:util"
import { normalizeInferenceBaseUrlForGateway } from "@/app/lib/inferenceEndpointUrl"
import { inspectSandbox } from "@/app/lib/openshellHost"
import {
commandExists,
@@ -127,7 +128,8 @@ function applyConfiguredInferenceToOnboardEnv(env: NodeJS.ProcessEnv, route: Con
}
if (provider === "custom") {
const endpointUrl = process.env.NEMOCLAW_ENDPOINT_URL || process.env.OPENAI_BASE_URL || process.env.VLLM_BASE_URL || ""
if (endpointUrl) env.NEMOCLAW_ENDPOINT_URL = endpointUrl
const normalizedEndpointUrl = normalizeInferenceBaseUrlForGateway(endpointUrl, "openai")
if (normalizedEndpointUrl) env.NEMOCLAW_ENDPOINT_URL = normalizedEndpointUrl
const providerKey = process.env.NEMOCLAW_PROVIDER_KEY || process.env.OPENAI_API_KEY || process.env.VLLM_API_KEY || ""
if (providerKey) env.NEMOCLAW_PROVIDER_KEY = providerKey
}