Add vLLM advanced configuration
This commit is contained in:
@@ -6,7 +6,7 @@ import { OPENSHELL_BIN, hostCommandEnv } from "@/app/lib/hostCommands"
|
||||
|
||||
const execFileAsync = promisify(execFile)
|
||||
|
||||
const PROVIDER_TYPES = new Set(["openai", "anthropic", "nvidia", "generic", "claude", "opencode", "codex", "copilot", "gitlab", "github", "outlook"])
|
||||
const PROVIDER_TYPES = new Set(["openai", "vllm", "anthropic", "nvidia", "generic", "claude", "opencode", "codex", "copilot", "gitlab", "github", "outlook"])
|
||||
|
||||
type InferenceRoute = {
|
||||
configured: boolean
|
||||
@@ -111,7 +111,7 @@ function isOllamaEndpoint(name: string, baseUrl: string) {
|
||||
}
|
||||
|
||||
function normalizeProviderType(type: string, name: string, baseUrl: string) {
|
||||
return isVllmEndpoint(name, baseUrl) || isOllamaEndpoint(name, baseUrl) ? "openai" : type
|
||||
return type === "vllm" || isVllmEndpoint(name, baseUrl) || isOllamaEndpoint(name, baseUrl) ? "openai" : type
|
||||
}
|
||||
|
||||
function redactSecretOutput(value: string, secrets: string[] = []) {
|
||||
@@ -157,7 +157,7 @@ export async function POST(request: Request) {
|
||||
const credentialKey = optionalString(body?.credentialKey) || "OPENAI_API_KEY"
|
||||
const makeActive = body?.makeActive !== false
|
||||
const system = body?.route === "system" || body?.system === true
|
||||
const noVerify = body?.noVerify !== false || isVllmEndpoint(name, baseUrl) || isOllamaEndpoint(name, baseUrl)
|
||||
const noVerify = body?.noVerify !== false || requestedType === "vllm" || isVllmEndpoint(name, baseUrl) || isOllamaEndpoint(name, baseUrl)
|
||||
const timeout = Number(body?.timeout ?? 0)
|
||||
|
||||
if (makeActive && !model) throw new Error("model is required when making the endpoint active")
|
||||
|
||||
Reference in New Issue
Block a user