feat: store model configs in the database

This commit is contained in:
Jun Siang Cheah
2024-05-19 18:46:24 +08:00
parent 1bacd5d93f
commit 4002ead6af
50 changed files with 434 additions and 194 deletions
+2 -21
View File
@@ -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];