Skip to content

Commit 4d82bb7

Browse files
committed
feat(llm): add models and providers constants for LLM settings
1 parent ed20dc6 commit 4d82bb7

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

app/src/constants/llm.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export const LLM_MODELS = [
2+
'o3-mini',
3+
'o1',
4+
'deepseek-reasoner',
5+
'deepseek-chat',
6+
'gpt-4o-mini',
7+
'gpt-4o',
8+
'gpt-4',
9+
'gpt-4-32k',
10+
'gpt-4-turbo',
11+
'gpt-3.5-turbo',
12+
]
13+
14+
export const LLM_PROVIDERS = [
15+
'https://api.openai.com',
16+
'https://api.deepseek.com',
17+
'http://localhost:11434',
18+
]

app/src/views/preference/OpenAISettings.vue

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
11
<script setup lang="ts">
22
import type { Settings } from '@/api/settings'
3+
import { LLM_MODELS, LLM_PROVIDERS } from '@/constants/llm'
34
45
const data: Settings = inject('data')!
56
const errors: Record<string, Record<string, string>> = inject('errors') as Record<string, Record<string, string>>
67
7-
const models = shallowRef([
8-
{
9-
value: 'gpt-4o-mini',
10-
},
11-
{
12-
value: 'gpt-4o',
13-
},
14-
{
15-
value: 'gpt-4-1106-preview',
16-
},
17-
{
18-
value: 'gpt-4',
19-
},
20-
{
21-
value: 'gpt-4-32k',
22-
},
23-
{
24-
value: 'gpt-3.5-turbo',
25-
},
26-
])
8+
const models = LLM_MODELS.map(model => ({
9+
value: model,
10+
}))
11+
12+
const providers = LLM_PROVIDERS.map(provider => ({
13+
value: provider,
14+
}))
2715
</script>
2816

2917
<template>
@@ -48,9 +36,10 @@ const models = shallowRef([
4836
: $gettext('To use a local large model, deploy it with ollama, vllm or lmdeploy. '
4937
+ 'They provide an OpenAI-compatible API endpoint, so just set the baseUrl to your local API.')"
5038
>
51-
<AInput
39+
<AAutoComplete
5240
v-model:value="data.openai.base_url"
5341
:placeholder="$gettext('Leave blank for the default: https://api.openai.com/')"
42+
:options="providers"
5443
/>
5544
</AFormItem>
5645
<AFormItem

0 commit comments

Comments
 (0)