Skip to content

Commit e797af0

Browse files
authored
💄 style: update Ollama model 240421 (lobehub#2130)
1 parent 31c16b9 commit e797af0

File tree

5 files changed

+55
-57
lines changed

5 files changed

+55
-57
lines changed

src/config/modelProviders/ollama.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,148 +2,148 @@ import { ModelProviderCard } from '@/types/llm';
22

33
const Ollama: ModelProviderCard = {
44
chatModels: [
5+
{
6+
displayName: 'Command R 35B',
7+
enabled: true,
8+
id: 'command-r',
9+
tokens: 128_000,
10+
},
11+
{
12+
displayName: 'Command R+ 104B (Q2_K)',
13+
id: 'command-r-plus:104b-q2_K',
14+
tokens: 128_000,
15+
},
516
{
617
displayName: 'Gemma 7B',
718
enabled: true,
8-
functionCall: false,
919
id: 'gemma',
1020
tokens: 4000,
11-
vision: false,
1221
},
1322
{
1423
displayName: 'Gemma 2B',
1524
enabled: true,
16-
functionCall: false,
1725
id: 'gemma:2b',
1826
tokens: 4000,
19-
vision: false,
2027
},
2128
{
2229
displayName: 'Llama2 Chat 13B',
23-
functionCall: false,
2430
id: 'llama2:13b',
2531
tokens: 4000,
26-
vision: false,
2732
},
2833
{
2934
displayName: 'Llama2 Chat 7B',
30-
enabled: true,
31-
functionCall: false,
3235
id: 'llama2',
3336
tokens: 4000,
34-
vision: false,
3537
},
3638
{
3739
displayName: 'Llama2 Chat 70B',
38-
functionCall: false,
3940
id: 'llama2:70b',
4041
tokens: 4000,
41-
vision: false,
4242
},
4343
{
4444
displayName: 'Llama2 CN 13B',
45-
functionCall: false,
4645
id: 'llama2-chinese:13b',
4746
tokens: 4000,
48-
vision: false,
4947
},
5048
{
5149
displayName: 'Llama2 CN 7B',
52-
functionCall: false,
5350
id: 'llama2-chinese',
5451
tokens: 4000,
55-
vision: false,
52+
},
53+
{
54+
displayName: 'Llama3 8B',
55+
enabled: true,
56+
id: 'llama3',
57+
tokens: 8000,
58+
},
59+
{
60+
displayName: 'Llama3 70B',
61+
id: 'llama3:70b',
62+
tokens: 8000,
63+
},
64+
{
65+
displayName: 'WizardLM 2 7B',
66+
enabled: true,
67+
id: 'wizardlm2',
68+
tokens: 65_536,
69+
},
70+
{
71+
displayName: 'WizardLM 2 8x22B',
72+
id: 'wizardlm2:8x22b',
73+
tokens: 65_536,
5674
},
5775
{
5876
displayName: 'Code Llama 7B',
59-
functionCall: false,
6077
id: 'codellama',
6178
tokens: 16_000,
62-
vision: false,
6379
},
6480
{
6581
displayName: 'Code Llama 34B',
66-
functionCall: false,
6782
id: 'codellama:34b',
6883
tokens: 16_000,
69-
vision: false,
7084
},
7185
{
7286
displayName: 'Code Llama 70B',
73-
functionCall: false,
7487
id: 'codellama:70b',
7588
tokens: 16_000,
76-
vision: false,
7789
},
7890
{
7991
displayName: 'Code Llama 7B (Python)',
80-
functionCall: false,
8192
id: 'codellama:python',
8293
tokens: 16_000,
83-
vision: false,
8494
},
8595
{
8696
displayName: 'Mistral',
8797
enabled: true,
88-
functionCall: false,
8998
id: 'mistral',
9099
tokens: 4800,
91-
vision: false,
92100
},
93101
{
94102
displayName: 'Mixtral 8x7B',
95103
enabled: true,
96-
functionCall: false,
97104
id: 'mixtral',
98105
tokens: 32_000,
99-
vision: false,
106+
},
107+
{
108+
displayName: 'Mixtral 8x22B',
109+
id: 'mixtral:8x22b',
110+
tokens: 64_000,
100111
},
101112
{
102113
displayName: 'Qwen Chat 4B',
103-
functionCall: false,
104114
id: 'qwen',
105115
tokens: 32_768,
106-
vision: false,
107116
},
108117
{
109118
displayName: 'Qwen Chat 7B',
110119
enabled: true,
111-
functionCall: false,
112120
id: 'qwen:7b',
113121
tokens: 32_768,
114-
vision: false,
115122
},
116123
{
117124
displayName: 'Qwen Chat 14B',
118-
functionCall: false,
119125
id: 'qwen:14b',
120126
tokens: 32_768,
121-
vision: false,
122127
},
123128
{
124129
displayName: 'Qwen Chat 72B',
125-
functionCall: false,
126130
id: 'qwen:72b',
127131
tokens: 32_768,
128-
vision: false,
129132
},
130133
{
131134
displayName: 'LLaVA 7B',
132-
functionCall: false,
133135
id: 'llava',
134136
tokens: 4000,
135137
vision: true,
136138
},
137139
{
138140
displayName: 'LLaVA 13B',
139-
functionCall: false,
140141
id: 'llava:13b',
141142
tokens: 4000,
142143
vision: true,
143144
},
144145
{
145146
displayName: 'LLaVA 34B',
146-
functionCall: false,
147147
id: 'llava:34b',
148148
tokens: 4000,
149149
vision: true,

src/libs/agent-runtime/zeroone/index.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('LobeZeroOneAI', () => {
5050
// Act
5151
const result = await instance.chat({
5252
messages: [{ content: 'Hello', role: 'user' }],
53-
model: 'mistralai/mistral-7b-instruct:free',
53+
model: 'yi-34b-chat-0205',
5454
temperature: 0,
5555
});
5656

@@ -69,7 +69,7 @@ describe('LobeZeroOneAI', () => {
6969
const result = await instance.chat({
7070
max_tokens: 1024,
7171
messages: [{ content: 'Hello', role: 'user' }],
72-
model: 'mistralai/mistral-7b-instruct:free',
72+
model: 'yi-34b-chat-0205',
7373
temperature: 0.7,
7474
top_p: 1,
7575
});
@@ -79,7 +79,7 @@ describe('LobeZeroOneAI', () => {
7979
{
8080
max_tokens: 1024,
8181
messages: [{ content: 'Hello', role: 'user' }],
82-
model: 'mistralai/mistral-7b-instruct:free',
82+
model: 'yi-34b-chat-0205',
8383
temperature: 0.7,
8484
top_p: 1,
8585
},
@@ -89,7 +89,7 @@ describe('LobeZeroOneAI', () => {
8989
});
9090

9191
describe('Error', () => {
92-
it('should return OpenRouterBizError with an openai error response when OpenAI.APIError is thrown', async () => {
92+
it('should return ZeroOneBizError with an openai error response when OpenAI.APIError is thrown', async () => {
9393
// Arrange
9494
const apiError = new OpenAI.APIError(
9595
400,
@@ -109,7 +109,7 @@ describe('LobeZeroOneAI', () => {
109109
try {
110110
await instance.chat({
111111
messages: [{ content: 'Hello', role: 'user' }],
112-
model: 'mistralai/mistral-7b-instruct:free',
112+
model: 'yi-34b-chat-0205',
113113
temperature: 0,
114114
});
115115
} catch (e) {
@@ -125,15 +125,15 @@ describe('LobeZeroOneAI', () => {
125125
}
126126
});
127127

128-
it('should throw AgentRuntimeError with InvalidOpenRouterAPIKey if no apiKey is provided', async () => {
128+
it('should throw AgentRuntimeError with InvalidZeroOneAPIKey if no apiKey is provided', async () => {
129129
try {
130130
new LobeZeroOneAI({});
131131
} catch (e) {
132132
expect(e).toEqual({ errorType: invalidErrorType });
133133
}
134134
});
135135

136-
it('should return OpenRouterBizError with the cause when OpenAI.APIError is thrown with cause', async () => {
136+
it('should return ZeroOneBizError with the cause when OpenAI.APIError is thrown with cause', async () => {
137137
// Arrange
138138
const errorInfo = {
139139
stack: 'abc',
@@ -149,7 +149,7 @@ describe('LobeZeroOneAI', () => {
149149
try {
150150
await instance.chat({
151151
messages: [{ content: 'Hello', role: 'user' }],
152-
model: 'mistralai/mistral-7b-instruct:free',
152+
model: 'yi-34b-chat-0205',
153153
temperature: 0,
154154
});
155155
} catch (e) {
@@ -165,7 +165,7 @@ describe('LobeZeroOneAI', () => {
165165
}
166166
});
167167

168-
it('should return OpenRouterBizError with an cause response with desensitize Url', async () => {
168+
it('should return ZeroOneBizError with an cause response with desensitize Url', async () => {
169169
// Arrange
170170
const errorInfo = {
171171
stack: 'abc',
@@ -185,7 +185,7 @@ describe('LobeZeroOneAI', () => {
185185
try {
186186
await instance.chat({
187187
messages: [{ content: 'Hello', role: 'user' }],
188-
model: 'mistralai/mistral-7b-instruct:free',
188+
model: 'yi-34b-chat-0205',
189189
temperature: 0,
190190
});
191191
} catch (e) {
@@ -201,7 +201,7 @@ describe('LobeZeroOneAI', () => {
201201
}
202202
});
203203

204-
it('should throw an InvalidOpenRouterAPIKey error type on 401 status code', async () => {
204+
it('should throw an InvalidZeroOneAPIKey error type on 401 status code', async () => {
205205
// Mock the API call to simulate a 401 error
206206
const error = new Error('Unauthorized') as any;
207207
error.status = 401;
@@ -210,7 +210,7 @@ describe('LobeZeroOneAI', () => {
210210
try {
211211
await instance.chat({
212212
messages: [{ content: 'Hello', role: 'user' }],
213-
model: 'mistralai/mistral-7b-instruct:free',
213+
model: 'yi-34b-chat-0205',
214214
temperature: 0,
215215
});
216216
} catch (e) {
@@ -234,7 +234,7 @@ describe('LobeZeroOneAI', () => {
234234
try {
235235
await instance.chat({
236236
messages: [{ content: 'Hello', role: 'user' }],
237-
model: 'mistralai/mistral-7b-instruct:free',
237+
model: 'yi-34b-chat-0205',
238238
temperature: 0,
239239
});
240240
} catch (e) {
@@ -265,7 +265,7 @@ describe('LobeZeroOneAI', () => {
265265
id: 'chatcmpl-8xDx5AETP8mESQN7UB30GxTN2H1SO',
266266
object: 'chat.completion.chunk',
267267
created: 1709125675,
268-
model: 'mistralai/mistral-7b-instruct:free',
268+
model: 'yi-34b-chat-0205',
269269
system_fingerprint: 'fp_86156a94a0',
270270
choices: [
271271
{ index: 0, delta: { content: 'hello' }, logprobs: null, finish_reason: null },
@@ -287,7 +287,7 @@ describe('LobeZeroOneAI', () => {
287287
const result = await instance.chat(
288288
{
289289
messages: [{ content: 'Hello', role: 'user' }],
290-
model: 'mistralai/mistral-7b-instruct:free',
290+
model: 'yi-34b-chat-0205',
291291
temperature: 0,
292292
},
293293
{ callback: mockCallback, headers: mockHeaders },
@@ -335,7 +335,7 @@ describe('LobeZeroOneAI', () => {
335335
// 假设的测试函数调用,你可能需要根据实际情况调整
336336
await instance.chat({
337337
messages: [{ content: 'Hello', role: 'user' }],
338-
model: 'mistralai/mistral-7b-instruct:free',
338+
model: 'yi-34b-chat-0205',
339339
temperature: 0,
340340
});
341341

src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
{
4848
"displayName": "LLaVA 7B",
4949
"enabled": true,
50-
"functionCall": false,
5150
"id": "llava",
5251
"tokens": 4000,
5352
"vision": true

src/store/global/slices/settings/actions/llm.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ describe('LLMSettingsSliceAction', () => {
110110
// Assert that setModelProviderConfig was not called
111111
expect(ollamaList?.chatModels.find((c) => c.id === 'llava')).toEqual({
112112
displayName: 'LLaVA 7B',
113-
functionCall: false,
114113
enabled: true,
115114
id: 'llava',
116115
tokens: 4000,

src/store/global/slices/settings/selectors/modelProvider.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('modelProviderSelectors', () => {
8585
});
8686

8787
describe('modelEnabledFiles', () => {
88-
it.skip('should return false if the model does not have file ability', () => {
88+
it('should return false if the model does not have file ability', () => {
8989
const enabledFiles = modelProviderSelectors.isModelEnabledFiles('gpt-4-vision-preview')(
9090
useGlobalStore.getState(),
9191
);

0 commit comments

Comments
 (0)