Skip to content

Commit 22ec8cd

Browse files
authored
💄 style: update cohere model list
1 parent 7c44823 commit 22ec8cd

File tree

3 files changed

+260
-5
lines changed

3 files changed

+260
-5
lines changed

src/config/aiModels/cohere.ts

+218-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,228 @@ const cohereChatModels: AIChatModelCard[] = [
55
abilities: {
66
functionCall: true,
77
},
8-
contextWindowTokens: 16_000,
9-
description: '',
8+
contextWindowTokens: 256_000,
9+
description: 'Command A is our most performant model to date, excelling at tool use, agents, retrieval augmented generation (RAG), and multilingual use cases. Command A has a context length of 256K, only requires two GPUs to run, and has 150% higher throughput compared to Command R+ 08-2024.',
10+
displayName: 'Command A',
11+
enabled: true,
12+
id: 'command-a-03-2025',
13+
maxOutput: 8000,
14+
pricing: {
15+
input: 2.5,
16+
output: 10
17+
},
18+
type: 'chat'
19+
},
20+
{
21+
abilities: {
22+
functionCall: true,
23+
},
24+
contextWindowTokens: 128_000,
25+
description: 'command-r-plus is an alias for command-r-plus-04-2024, so if you use command-r-plus in the API, that’s the model you’re pointing to.',
26+
displayName: 'Command R+',
27+
enabled: true,
28+
id: 'command-r-plus',
29+
maxOutput: 4000,
30+
pricing: {
31+
input: 2.5,
32+
output: 10
33+
},
34+
type: 'chat'
35+
},
36+
{
37+
abilities: {
38+
functionCall: true,
39+
},
40+
contextWindowTokens: 128_000,
41+
description: 'Command R+ is an instruction-following conversational model that performs language tasks at a higher quality, more reliably, and with a longer context than previous models. It is best suited for complex RAG workflows and multi-step tool use.',
42+
displayName: 'Command R+ 04-2024',
43+
id: 'command-r-plus-04-2024',
44+
maxOutput: 4000,
45+
pricing: {
46+
input: 3,
47+
output: 15
48+
},
49+
type: 'chat'
50+
},
51+
{
52+
abilities: {
53+
functionCall: true,
54+
},
55+
contextWindowTokens: 128_000,
56+
description: 'command-r is an alias for command-r-03-2024, so if you use command-r in the API, that’s the model you’re pointing to.',
57+
displayName: 'Command R',
58+
enabled: true,
59+
id: 'command-r',
60+
maxOutput: 4000,
61+
pricing: {
62+
input: 0.15,
63+
output: 0.6
64+
},
65+
type: 'chat'
66+
},
67+
{
68+
abilities: {
69+
functionCall: true,
70+
},
71+
contextWindowTokens: 128_000,
72+
description: 'command-r-08-2024 is an update of the Command R model, delivered in August 2024.',
73+
displayName: 'Command R 08-2024',
74+
id: 'command-r-08-2024',
75+
maxOutput: 4000,
76+
pricing: {
77+
input: 0.15,
78+
output: 0.6
79+
},
80+
type: 'chat'
81+
},
82+
{
83+
abilities: {
84+
functionCall: true,
85+
},
86+
contextWindowTokens: 128_000,
87+
description: 'Command R is an instruction-following conversational model that performs language tasks at a higher quality, more reliably, and with a longer context than previous models. It can be used for complex workflows like code generation, retrieval augmented generation (RAG), tool use, and agents.',
88+
displayName: 'Command R 03-2024',
89+
id: 'command-r-03-2024',
90+
maxOutput: 4000,
91+
pricing: {
92+
input: 0.5,
93+
output: 1.5
94+
},
95+
type: 'chat'
96+
},
97+
{
98+
abilities: {
99+
functionCall: true,
100+
},
101+
contextWindowTokens: 128_000,
102+
description: 'command-r7b-12-2024 is a small, fast update delivered in December 2024. It excels at RAG, tool use, agents, and similar tasks requiring complex reasoning and multiple steps.',
103+
displayName: 'Command R7B 12-2024',
104+
enabled: true,
105+
id: 'command-r7b-12-2024',
106+
maxOutput: 4000,
107+
pricing: {
108+
input: 0.0375,
109+
output: 0.15
110+
},
111+
type: 'chat'
112+
},
113+
{
114+
abilities: {
115+
functionCall: true,
116+
},
117+
contextWindowTokens: 4000,
118+
description: 'An instruction-following conversational model that performs language tasks with high quality, more reliably and with a longer context than our base generative models.',
10119
displayName: 'Command',
11120
enabled: true,
12121
id: 'command',
122+
maxOutput: 4000,
123+
pricing: {
124+
input: 1,
125+
output: 2
126+
},
127+
type: 'chat'
128+
},
129+
{
130+
abilities: {
131+
functionCall: true,
132+
},
133+
contextWindowTokens: 128_000,
134+
description: 'To reduce the time between major releases, we put out nightly versions of command models. For command, that is command-nightly. Be advised that command-nightly is the latest, most experimental, and (possibly) unstable version of its default counterpart. Nightly releases are updated regularly, without warning, and are not recommended for production use.',
135+
displayName: 'Command Nightly',
136+
id: 'command-nightly',
137+
maxOutput: 4000,
138+
pricing: {
139+
input: 1,
140+
output: 2
141+
},
142+
type: 'chat'
143+
},
144+
{
145+
abilities: {
146+
functionCall: true,
147+
},
148+
contextWindowTokens: 4000,
149+
description: 'A smaller, faster version of command. Almost as capable, but a lot faster.',
150+
displayName: 'Command Light',
151+
enabled: true,
152+
id: 'command-light',
153+
maxOutput: 4000,
154+
pricing: {
155+
input: 0.3,
156+
output: 0.6
157+
},
158+
type: 'chat'
159+
},
160+
{
161+
abilities: {
162+
functionCall: true,
163+
},
164+
contextWindowTokens: 4000,
165+
description: 'To reduce the time between major releases, we put out nightly versions of command models. For command-light, that is command-light-nightly. Be advised that command-light-nightly is the latest, most experimental, and (possibly) unstable version of its default counterpart. Nightly releases are updated regularly, without warning, and are not recommended for production use.',
166+
displayName: 'Command Light Nightly',
167+
id: 'command-light-nightly',
168+
maxOutput: 4000,
169+
pricing: {
170+
input: 0.3,
171+
output: 0.6
172+
},
173+
type: 'chat'
174+
},
175+
{
176+
contextWindowTokens: 128_000,
177+
description: 'Aya Expanse is a highly performant 32B multilingual model, designed to rival monolingual performance through innovations in instruction tuning with data arbitrage, preference training, and model merging. Serves 23 languages.',
178+
displayName: 'Aya Expanse 32B',
179+
enabled: true,
180+
id: 'c4ai-aya-expanse-32b',
181+
maxOutput: 4000,
182+
pricing: {
183+
input: 0.5,
184+
output: 1.5
185+
},
186+
type: 'chat'
187+
},
188+
{
189+
contextWindowTokens: 8000,
190+
description: 'Aya Expanse is a highly performant 8B multilingual model, designed to rival monolingual performance through innovations in instruction tuning with data arbitrage, preference training, and model merging. Serves 23 languages.',
191+
displayName: 'Aya Expanse 8B',
192+
enabled: true,
193+
id: 'c4ai-aya-expanse-8b',
194+
maxOutput: 4000,
195+
pricing: {
196+
input: 0.5,
197+
output: 1.5
198+
},
199+
type: 'chat'
200+
},
201+
{
202+
abilities: {
203+
vision: true,
204+
},
205+
contextWindowTokens: 16_000,
206+
description: 'Aya Vision is a state-of-the-art multimodal model excelling at a variety of critical benchmarks for language, text, and image capabilities. Serves 23 languages. This 32 billion parameter variant is focused on state-of-art multilingual performance.',
207+
displayName: 'Aya Vision 32B',
208+
enabled: true,
209+
id: 'c4ai-aya-vision-32b',
210+
maxOutput: 4000,
211+
pricing: {
212+
input: 0.5,
213+
output: 1.5
214+
},
215+
type: 'chat'
216+
},
217+
{
218+
abilities: {
219+
vision: true,
220+
},
221+
contextWindowTokens: 16_000,
222+
description: 'Aya Vision is a state-of-the-art multimodal model excelling at a variety of critical benchmarks for language, text, and image capabilities. This 8 billion parameter variant is focused on low latency and best-in-class performance.',
223+
displayName: 'Aya Vision 8B',
224+
enabled: true,
225+
id: 'c4ai-aya-vision-8b',
226+
maxOutput: 4000,
13227
pricing: {
14-
input: 0.6,
15-
output: 1.2
228+
input: 0.5,
229+
output: 1.5
16230
},
17231
type: 'chat'
18232
},

src/config/modelProviders/cohere.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import { ModelProviderCard } from '@/types/llm';
22

33
const Cohere: ModelProviderCard = {
44
chatModels: [],
5-
checkModel: 'command',
5+
checkModel: 'command-r7b-12-2024',
66
description: 'Cohere',
77
//disableBrowserRequest: true,
88
id: 'cohere',
99
modelsUrl: 'https://docs.cohere.com/v2/docs/models',
1010
name: 'Cohere',
1111
settings: {
1212
//disableBrowserRequest: true,
13+
proxyUrl: {
14+
placeholder: 'https://api.cohere.ai/compatibility/v1',
15+
},
1316
sdkType: 'openai',
1417
},
1518
url: 'https://cohere.com',
+38
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,48 @@
11
import { ModelProvider } from '../types';
22
import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';
33

4+
import type { ChatModelCard } from '@/types/llm';
5+
6+
export interface CohereModelCard {
7+
context_length: number;
8+
features: string[];
9+
name: string;
10+
supports_vision: boolean;
11+
}
12+
413
export const LobeCohereAI = LobeOpenAICompatibleFactory({
514
baseURL: 'https://api.cohere.ai/compatibility/v1',
615
debug: {
716
chatCompletion: () => process.env.DEBUG_COHERE_CHAT_COMPLETION === '1',
817
},
18+
models: async ({ client }) => {
19+
const { LOBE_DEFAULT_MODEL_LIST } = await import('@/config/aiModels');
20+
21+
client.baseURL = 'https://api.cohere.com/v1';
22+
23+
const modelsPage = await client.models.list() as any;
24+
const modelList: CohereModelCard[] = modelsPage.models;
25+
26+
return modelList
27+
.map((model) => {
28+
const knownModel = LOBE_DEFAULT_MODEL_LIST.find((m) => model.name.toLowerCase() === m.id.toLowerCase());
29+
30+
return {
31+
contextWindowTokens: model.context_length,
32+
displayName: knownModel?.displayName ?? undefined,
33+
enabled: knownModel?.enabled || false,
34+
functionCall:
35+
model.features.includes("tools")
36+
|| knownModel?.abilities?.functionCall
37+
|| false,
38+
id: model.name,
39+
vision:
40+
model.supports_vision
41+
|| knownModel?.abilities?.vision
42+
|| false,
43+
};
44+
})
45+
.filter(Boolean) as ChatModelCard[];
46+
},
947
provider: ModelProvider.Cohere,
1048
});

0 commit comments

Comments
 (0)