diff --git a/core/src/events.ts b/core/src/events.ts index 81451c1f0..bfaf3ea58 100644 --- a/core/src/events.ts +++ b/core/src/events.ts @@ -14,8 +14,10 @@ export enum EventName { OnModelReady = "OnModelReady", /** The `OnModelFail` event is emitted when a model fails loading. */ OnModelFail = "OnModelFail", - /** The `OnModelStop` event is emitted when a model fails loading. */ + /** The `OnModelStop` event is emitted when a model start to stop. */ OnModelStop = "OnModelStop", + /** The `OnModelStopped` event is emitted when a model stopped ok. */ + OnModelStopped = "OnModelStopped", } /** diff --git a/core/src/types/index.ts b/core/src/types/index.ts index 5b45d4cc8..b80012dd7 100644 --- a/core/src/types/index.ts +++ b/core/src/types/index.ts @@ -43,6 +43,9 @@ export type MessageRequest = { /** Runtime parameters for constructing a chat completion request **/ parameters?: ModelRuntimeParam; + + /** Settings for constructing a chat completion request **/ + model?: ModelInfo }; /** @@ -154,6 +157,7 @@ export type ModelInfo = { id: string; settings: ModelSettingParams; parameters: ModelRuntimeParam; + engine: InferenceEngine; }; /** @@ -172,7 +176,7 @@ export type ThreadState = { */ enum InferenceEngine { - llama_cpp = "llama_cpp", + nitro = "nitro", openai = "openai", nvidia_triton = "nvidia_triton", hf_endpoint = "hf_endpoint", @@ -246,7 +250,7 @@ export interface Model { */ metadata: ModelMetadata; /** - * The model engine. Enum: "llamacpp" "openai" + * The model engine. */ engine: InferenceEngine; }