mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-20 21:23:23 +00:00
refactor(vllm): lazy-load provider registration
This commit is contained in:
@@ -3,13 +3,6 @@ import {
|
||||
type OpenClawPluginApi,
|
||||
type ProviderAuthMethodNonInteractiveContext,
|
||||
} from "openclaw/plugin-sdk/plugin-entry";
|
||||
import {
|
||||
VLLM_DEFAULT_API_KEY_ENV_VAR,
|
||||
VLLM_DEFAULT_BASE_URL,
|
||||
VLLM_MODEL_PLACEHOLDER,
|
||||
VLLM_PROVIDER_LABEL,
|
||||
buildVllmProvider,
|
||||
} from "./api.js";
|
||||
|
||||
const PROVIDER_ID = "vllm";
|
||||
|
||||
@@ -21,7 +14,15 @@ export default definePluginEntry({
|
||||
id: "vllm",
|
||||
name: "vLLM Provider",
|
||||
description: "Bundled vLLM provider plugin",
|
||||
register(api: OpenClawPluginApi) {
|
||||
async register(api: OpenClawPluginApi) {
|
||||
const {
|
||||
buildVllmProvider,
|
||||
VLLM_DEFAULT_API_KEY_ENV_VAR,
|
||||
VLLM_DEFAULT_BASE_URL,
|
||||
VLLM_MODEL_PLACEHOLDER,
|
||||
VLLM_PROVIDER_LABEL,
|
||||
} = await import("./register.runtime.js");
|
||||
|
||||
api.registerProvider({
|
||||
id: PROVIDER_ID,
|
||||
label: "vLLM",
|
||||
|
||||
7
extensions/vllm/register.runtime.ts
Normal file
7
extensions/vllm/register.runtime.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export {
|
||||
buildVllmProvider,
|
||||
VLLM_DEFAULT_API_KEY_ENV_VAR,
|
||||
VLLM_DEFAULT_BASE_URL,
|
||||
VLLM_MODEL_PLACEHOLDER,
|
||||
VLLM_PROVIDER_LABEL,
|
||||
} from "./api.js";
|
||||
Reference in New Issue
Block a user