feat: store model configs in the database
This commit is contained in:
+2
-21
@@ -1,5 +1,6 @@
|
||||
import { APP_NAME } from '$lib/constants';
|
||||
import { type Writable, writable } from 'svelte/store';
|
||||
import type { GlobalModelConfig, ModelConfig } from '$lib/apis';
|
||||
|
||||
// Backend
|
||||
export const WEBUI_NAME = writable(APP_NAME);
|
||||
@@ -44,17 +45,10 @@ export const showChangelog = writable(false);
|
||||
|
||||
export type Model = OpenAIModel | OllamaModel;
|
||||
|
||||
type ModelCustomInfo = {
|
||||
id?: string;
|
||||
name?: string;
|
||||
description?: string;
|
||||
vision_capable?: boolean;
|
||||
};
|
||||
|
||||
type BaseModel = {
|
||||
id: string;
|
||||
name: string;
|
||||
custom_info?: ModelCustomInfo;
|
||||
custom_info?: ModelConfig;
|
||||
};
|
||||
|
||||
export interface OpenAIModel extends BaseModel {
|
||||
@@ -143,19 +137,6 @@ type Config = {
|
||||
model_config?: GlobalModelConfig;
|
||||
};
|
||||
|
||||
type GlobalModelConfig = {
|
||||
ollama?: ModelConfig[];
|
||||
litellm?: ModelConfig[];
|
||||
openai?: ModelConfig[];
|
||||
};
|
||||
|
||||
type ModelConfig = {
|
||||
id?: string;
|
||||
name?: string;
|
||||
description?: string;
|
||||
vision_capable?: boolean;
|
||||
};
|
||||
|
||||
type PromptSuggestion = {
|
||||
content: string;
|
||||
title: [string, string];
|
||||
|
||||
Reference in New Issue
Block a user