@botpress/zai 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/env.d.ts +0 -36
- package/dist/src/zai.d.ts +6 -12
- package/dist/src/zai.js +2 -0
- package/dist/src/zai.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typings.d.ts +0 -6
- package/dist/typings.tsbuildinfo +1 -1
- package/package.json +18 -9
- package/tsconfig.json +1 -0
- package/dist/src/operations/check.test.js +0 -129
- package/dist/src/operations/extract.test.js +0 -163
- package/dist/src/operations/filter.test.js +0 -151
- package/dist/src/operations/label.test.js +0 -213
- package/dist/src/operations/rewrite.test.js +0 -96
- package/dist/src/operations/summarize.test.js +0 -22
- package/dist/src/operations/text.test.js +0 -51
- package/dist/src/operations/zai-learn.test.js +0 -71
- package/dist/src/operations/zai-retry.test.js +0 -50
- package/src/adapters/adapter.ts +0 -35
- package/src/adapters/botpress-table.ts +0 -213
- package/src/adapters/memory.ts +0 -13
- package/src/env.ts +0 -54
- package/src/index.ts +0 -11
- package/src/models.ts +0 -347
- package/src/operations/__tests/botpress_docs.txt +0 -26040
- package/src/operations/__tests/index.ts +0 -30
- package/src/operations/check.test.ts +0 -155
- package/src/operations/check.ts +0 -187
- package/src/operations/constants.ts +0 -2
- package/src/operations/errors.ts +0 -9
- package/src/operations/extract.test.ts +0 -209
- package/src/operations/extract.ts +0 -291
- package/src/operations/filter.test.ts +0 -182
- package/src/operations/filter.ts +0 -231
- package/src/operations/label.test.ts +0 -239
- package/src/operations/label.ts +0 -332
- package/src/operations/rewrite.test.ts +0 -114
- package/src/operations/rewrite.ts +0 -148
- package/src/operations/summarize.test.ts +0 -25
- package/src/operations/summarize.ts +0 -193
- package/src/operations/text.test.ts +0 -60
- package/src/operations/text.ts +0 -63
- package/src/operations/zai-learn.test.ts +0 -85
- package/src/operations/zai-retry.test.ts +0 -64
- package/src/scripts/update-models.ts +0 -74
- package/src/utils.ts +0 -61
- package/src/zai.ts +0 -179
package/src/adapters/adapter.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { GenerationMetadata } from '../utils'
|
|
2
|
-
|
|
3
|
-
export type SaveExampleProps<TInput, TOutput> = {
|
|
4
|
-
key: string
|
|
5
|
-
taskType: string
|
|
6
|
-
taskId: string
|
|
7
|
-
instructions: string
|
|
8
|
-
input: TInput
|
|
9
|
-
output: TOutput
|
|
10
|
-
explanation?: string
|
|
11
|
-
metadata: GenerationMetadata
|
|
12
|
-
status?: 'pending' | 'approved'
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type GetExamplesProps<TInput> = {
|
|
16
|
-
taskType: string
|
|
17
|
-
taskId: string
|
|
18
|
-
input: TInput
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export abstract class Adapter {
|
|
22
|
-
abstract getExamples<TInput, TOutput>(
|
|
23
|
-
props: GetExamplesProps<TInput>
|
|
24
|
-
): Promise<
|
|
25
|
-
Array<{
|
|
26
|
-
key: string
|
|
27
|
-
input: TInput
|
|
28
|
-
output: TOutput
|
|
29
|
-
explanation?: string
|
|
30
|
-
similarity: number
|
|
31
|
-
}>
|
|
32
|
-
>
|
|
33
|
-
|
|
34
|
-
abstract saveExample<TInput, TOutput>(props: SaveExampleProps<TInput, TOutput>): Promise<void>
|
|
35
|
-
}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { type Client } from '@botpress/client'
|
|
2
|
-
import { z } from '@bpinternal/zui'
|
|
3
|
-
|
|
4
|
-
import { BotpressClient, GenerationMetadata } from '../utils'
|
|
5
|
-
import { Adapter, GetExamplesProps, SaveExampleProps } from './adapter'
|
|
6
|
-
|
|
7
|
-
const CRITICAL_TAGS = {
|
|
8
|
-
system: 'true',
|
|
9
|
-
'schema-purpose': 'active-learning',
|
|
10
|
-
'schema-version': 'Oct-2024'
|
|
11
|
-
} as const
|
|
12
|
-
|
|
13
|
-
const OPTIONAL_TAGS = {
|
|
14
|
-
'x-studio-title': 'Active Learning',
|
|
15
|
-
'x-studio-description': 'Table for storing active learning tasks and examples',
|
|
16
|
-
'x-studio-readonly': 'true',
|
|
17
|
-
'x-studio-icon': 'lucide://atom',
|
|
18
|
-
'x-studio-color': 'green'
|
|
19
|
-
} as const
|
|
20
|
-
|
|
21
|
-
const FACTOR = 30
|
|
22
|
-
|
|
23
|
-
const Props = z.object({
|
|
24
|
-
client: BotpressClient,
|
|
25
|
-
tableName: z
|
|
26
|
-
.string()
|
|
27
|
-
.regex(
|
|
28
|
-
/^[a-zA-Z0-9_]{1,45}Table$/,
|
|
29
|
-
'Table name must be lowercase and contain only letters, numbers and underscores'
|
|
30
|
-
)
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
export type TableSchema = z.input<typeof TableSchema>
|
|
34
|
-
const TableSchema = z.object({
|
|
35
|
-
taskType: z.string().describe('The type of the task (filter, extract, etc.)'),
|
|
36
|
-
taskId: z.string(),
|
|
37
|
-
key: z.string().describe('A unique key for the task (e.g. a hash of the input, taskId, taskType and instructions)'),
|
|
38
|
-
instructions: z.string(),
|
|
39
|
-
input: z.object({}).passthrough().describe('The input to the task'),
|
|
40
|
-
output: z.object({}).passthrough().describe('The expected output'),
|
|
41
|
-
explanation: z.string().nullable(),
|
|
42
|
-
metadata: GenerationMetadata,
|
|
43
|
-
status: z.enum(['pending', 'rejected', 'approved']),
|
|
44
|
-
feedback: z
|
|
45
|
-
.object({
|
|
46
|
-
rating: z.enum(['very-bad', 'bad', 'good', 'very-good']),
|
|
47
|
-
comment: z.string().nullable()
|
|
48
|
-
})
|
|
49
|
-
.nullable()
|
|
50
|
-
.default(null)
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const searchableColumns = ['input'] as const satisfies Array<keyof typeof TableSchema.shape> as string[]
|
|
54
|
-
|
|
55
|
-
const TableJsonSchema = Object.entries(TableSchema.shape).reduce((acc, [key, value]) => {
|
|
56
|
-
acc[key] = value.toJsonSchema()
|
|
57
|
-
acc[key]['x-zui'] ??= {}
|
|
58
|
-
acc[key]['x-zui'].searchable = searchableColumns.includes(key)
|
|
59
|
-
return acc
|
|
60
|
-
}, {})
|
|
61
|
-
|
|
62
|
-
export class TableAdapter extends Adapter {
|
|
63
|
-
private client: Client
|
|
64
|
-
private tableName: string
|
|
65
|
-
|
|
66
|
-
private status: 'initialized' | 'ready' | 'error'
|
|
67
|
-
private errors = [] as string[]
|
|
68
|
-
|
|
69
|
-
constructor(props: z.input<typeof Props>) {
|
|
70
|
-
super()
|
|
71
|
-
props = Props.parse(props)
|
|
72
|
-
this.client = props.client
|
|
73
|
-
this.tableName = props.tableName
|
|
74
|
-
this.status = 'ready'
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
public async getExamples<TInput, TOutput>({ taskType, taskId, input }: GetExamplesProps<TInput>) {
|
|
78
|
-
await this.assertTableExists()
|
|
79
|
-
|
|
80
|
-
const { rows } = await this.client
|
|
81
|
-
.findTableRows({
|
|
82
|
-
table: this.tableName,
|
|
83
|
-
search: JSON.stringify({ value: input }).substring(0, 1023), // Search is limited to 1024 characters
|
|
84
|
-
limit: 10, // TODO
|
|
85
|
-
filter: {
|
|
86
|
-
// Proximity match of approved examples
|
|
87
|
-
taskType,
|
|
88
|
-
taskId,
|
|
89
|
-
status: 'approved'
|
|
90
|
-
} satisfies Partial<TableSchema>
|
|
91
|
-
})
|
|
92
|
-
.catch((err) => {
|
|
93
|
-
// TODO: handle error
|
|
94
|
-
console.error(`Error fetching examples: ${err.message}`)
|
|
95
|
-
return { rows: [] }
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
return rows.map((row) => ({
|
|
99
|
-
key: row.key,
|
|
100
|
-
input: row.input.value as TInput,
|
|
101
|
-
output: row.output.value as TOutput,
|
|
102
|
-
explanation: row.explanation,
|
|
103
|
-
similarity: row.similarity ?? 0
|
|
104
|
-
}))
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
public async saveExample<TInput, TOutput>({
|
|
108
|
-
key,
|
|
109
|
-
taskType,
|
|
110
|
-
taskId,
|
|
111
|
-
instructions,
|
|
112
|
-
input,
|
|
113
|
-
output,
|
|
114
|
-
explanation,
|
|
115
|
-
metadata,
|
|
116
|
-
status = 'pending'
|
|
117
|
-
}: SaveExampleProps<TInput, TOutput>) {
|
|
118
|
-
await this.assertTableExists()
|
|
119
|
-
|
|
120
|
-
await this.client
|
|
121
|
-
.upsertTableRows({
|
|
122
|
-
table: this.tableName,
|
|
123
|
-
keyColumn: 'key',
|
|
124
|
-
rows: [
|
|
125
|
-
{
|
|
126
|
-
key,
|
|
127
|
-
taskType,
|
|
128
|
-
taskId,
|
|
129
|
-
instructions,
|
|
130
|
-
input: { value: input },
|
|
131
|
-
output: { value: output },
|
|
132
|
-
explanation: explanation ?? null,
|
|
133
|
-
status,
|
|
134
|
-
metadata
|
|
135
|
-
} satisfies TableSchema
|
|
136
|
-
]
|
|
137
|
-
})
|
|
138
|
-
.catch(() => {
|
|
139
|
-
// TODO: handle error
|
|
140
|
-
})
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
private async assertTableExists() {
|
|
144
|
-
if (this.status !== 'ready') {
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const { table, created } = await this.client
|
|
149
|
-
.getOrCreateTable({
|
|
150
|
-
table: this.tableName,
|
|
151
|
-
factor: FACTOR,
|
|
152
|
-
frozen: true,
|
|
153
|
-
isComputeEnabled: false,
|
|
154
|
-
tags: {
|
|
155
|
-
...CRITICAL_TAGS,
|
|
156
|
-
...OPTIONAL_TAGS
|
|
157
|
-
},
|
|
158
|
-
schema: TableJsonSchema
|
|
159
|
-
})
|
|
160
|
-
.catch((err) => {
|
|
161
|
-
this.status = 'error'
|
|
162
|
-
this.errors = [err.message]
|
|
163
|
-
return { table: null, created: false }
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
if (!table) {
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (!created) {
|
|
171
|
-
const issues: string[] = []
|
|
172
|
-
|
|
173
|
-
if (table.factor !== FACTOR) {
|
|
174
|
-
issues.push(`Factor is ${table.factor} instead of ${FACTOR}`)
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (table.frozen !== true) {
|
|
178
|
-
issues.push('Table is not frozen')
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
for (const [key, value] of Object.entries(CRITICAL_TAGS)) {
|
|
182
|
-
if (table.tags?.[key] !== value) {
|
|
183
|
-
issues.push(`Tag ${key} is ${table.tags?.[key]} instead of ${value}`)
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
for (const key of Object.keys(TableJsonSchema)) {
|
|
188
|
-
const column = table.schema?.properties[key]
|
|
189
|
-
const expected = TableJsonSchema[key] as { type: string }
|
|
190
|
-
|
|
191
|
-
if (!column) {
|
|
192
|
-
issues.push(`Column ${key} is missing`)
|
|
193
|
-
continue
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (column.type !== expected.type) {
|
|
197
|
-
issues.push(`Column ${key} has type ${column.type} instead of ${expected.type}`)
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (expected['x-zui'].searchable && !column['x-zui'].searchable) {
|
|
201
|
-
issues.push(`Column ${key} is not searchable but should be`)
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (issues.length) {
|
|
206
|
-
this.status = 'error'
|
|
207
|
-
this.errors = issues
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
this.status = 'initialized'
|
|
212
|
-
}
|
|
213
|
-
}
|
package/src/adapters/memory.ts
DELETED
package/src/env.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { z } from '@bpinternal/zui'
|
|
2
|
-
import dotenv from 'dotenv'
|
|
3
|
-
|
|
4
|
-
dotenv.config({ override: false })
|
|
5
|
-
dotenv.populate(
|
|
6
|
-
process.env,
|
|
7
|
-
{
|
|
8
|
-
VITE_CLOUD_API_ENDPOINT: 'https://api.botpress.dev'
|
|
9
|
-
},
|
|
10
|
-
{ override: false }
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
const envVariables = z.object({
|
|
14
|
-
CI: z.coerce.boolean().optional().describe('Indicates whether the tests are running in a CI environment'),
|
|
15
|
-
VITE_CLOUD_API_ENDPOINT: z.string(),
|
|
16
|
-
VITE_BOT_ID: z.string(),
|
|
17
|
-
VITE_CLOUD_PAT: z.string(),
|
|
18
|
-
// for CI
|
|
19
|
-
VITEST_CLOUD_PAT: z.string().optional(),
|
|
20
|
-
VITEST_BOT_ID: z.string().optional()
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const result = envVariables.safeParse(process.env)
|
|
24
|
-
|
|
25
|
-
if (!result.success) {
|
|
26
|
-
for (const error of result.error.errors) {
|
|
27
|
-
if (error.code === 'invalid_type') {
|
|
28
|
-
console.error(`Missing environment variable: ${error.path.join('.')}`)
|
|
29
|
-
} else {
|
|
30
|
-
console.error(error)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
type Deprecated = Omit<
|
|
36
|
-
{
|
|
37
|
-
[key: string]: any
|
|
38
|
-
},
|
|
39
|
-
keyof z.infer<typeof envVariables>
|
|
40
|
-
>
|
|
41
|
-
|
|
42
|
-
type AllEnv = z.infer<typeof envVariables> & Deprecated
|
|
43
|
-
|
|
44
|
-
/** @internal */
|
|
45
|
-
declare global {
|
|
46
|
-
namespace NodeJS {
|
|
47
|
-
interface ProcessEnv extends AllEnv {
|
|
48
|
-
/** @deprecated please define your ENV variable in {@link env.ts} */
|
|
49
|
-
[key: keyof Deprecated]: any
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export {}
|
package/src/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Zai } from './zai'
|
|
2
|
-
|
|
3
|
-
import './operations/text'
|
|
4
|
-
import './operations/rewrite'
|
|
5
|
-
import './operations/summarize'
|
|
6
|
-
import './operations/check'
|
|
7
|
-
import './operations/filter'
|
|
8
|
-
import './operations/extract'
|
|
9
|
-
import './operations/label'
|
|
10
|
-
|
|
11
|
-
export { Zai }
|
package/src/models.ts
DELETED
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
export const Models = [
|
|
2
|
-
{
|
|
3
|
-
"id": "anthropic__claude-3-haiku-20240307",
|
|
4
|
-
"name": "Claude 3 Haiku",
|
|
5
|
-
"description": "Claude 3 Haiku is Anthropic's fastest and most compact model for near-instant responsiveness. Quick and accurate targeted performance.",
|
|
6
|
-
"tags": [
|
|
7
|
-
"low-cost",
|
|
8
|
-
"general-purpose"
|
|
9
|
-
],
|
|
10
|
-
"input": {
|
|
11
|
-
"costPer1MTokens": 0.25,
|
|
12
|
-
"maxTokens": 200000
|
|
13
|
-
},
|
|
14
|
-
"output": {
|
|
15
|
-
"costPer1MTokens": 1.25,
|
|
16
|
-
"maxTokens": 4096
|
|
17
|
-
},
|
|
18
|
-
"integration": "anthropic"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"id": "anthropic__claude-3-5-sonnet-20240620",
|
|
22
|
-
"name": "Claude 3.5 Sonnet",
|
|
23
|
-
"description": "Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at coding, data science, visual processing, and agentic tasks.",
|
|
24
|
-
"tags": [
|
|
25
|
-
"recommended",
|
|
26
|
-
"vision",
|
|
27
|
-
"general-purpose",
|
|
28
|
-
"agents",
|
|
29
|
-
"coding",
|
|
30
|
-
"function-calling",
|
|
31
|
-
"storytelling"
|
|
32
|
-
],
|
|
33
|
-
"input": {
|
|
34
|
-
"costPer1MTokens": 3,
|
|
35
|
-
"maxTokens": 200000
|
|
36
|
-
},
|
|
37
|
-
"output": {
|
|
38
|
-
"costPer1MTokens": 15,
|
|
39
|
-
"maxTokens": 4096
|
|
40
|
-
},
|
|
41
|
-
"integration": "anthropic"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"id": "groq__gemma-7b-it",
|
|
45
|
-
"name": "Gemma 7B",
|
|
46
|
-
"description": "Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models. They are text-to-text, decoder-only large language models, available in English, with open weights, pre-trained variants, and instruction-tuned variants. Gemma models are well-suited for a variety of text generation tasks, including question answering, summarization, and reasoning.",
|
|
47
|
-
"tags": [
|
|
48
|
-
"deprecated",
|
|
49
|
-
"low-cost"
|
|
50
|
-
],
|
|
51
|
-
"input": {
|
|
52
|
-
"costPer1MTokens": 0.07,
|
|
53
|
-
"maxTokens": 8192
|
|
54
|
-
},
|
|
55
|
-
"output": {
|
|
56
|
-
"costPer1MTokens": 0.07,
|
|
57
|
-
"maxTokens": 8192
|
|
58
|
-
},
|
|
59
|
-
"integration": "groq"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"id": "groq__gemma2-9b-it",
|
|
63
|
-
"name": "Gemma2 9B",
|
|
64
|
-
"description": "Redesigned for outsized performance and unmatched efficiency, Gemma 2 optimizes for blazing-fast inference on diverse hardware. Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models. They are text-to-text, decoder-only large language models, available in English, with open weights, pre-trained variants, and instruction-tuned variants. Gemma models are well-suited for a variety of text generation tasks, including question answering, summarization, and reasoning.",
|
|
65
|
-
"tags": [
|
|
66
|
-
"low-cost",
|
|
67
|
-
"general-purpose"
|
|
68
|
-
],
|
|
69
|
-
"input": {
|
|
70
|
-
"costPer1MTokens": 0.2,
|
|
71
|
-
"maxTokens": 8192
|
|
72
|
-
},
|
|
73
|
-
"output": {
|
|
74
|
-
"costPer1MTokens": 0.2,
|
|
75
|
-
"maxTokens": 8192
|
|
76
|
-
},
|
|
77
|
-
"integration": "groq"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"id": "groq__llama3-70b-8192",
|
|
81
|
-
"name": "LLaMA 3 70B",
|
|
82
|
-
"tags": [
|
|
83
|
-
"general-purpose"
|
|
84
|
-
],
|
|
85
|
-
"description": "Meta developed and released the Meta Llama 3 family of large language models (LLMs), a collection of pretrained and instruction tuned generative text models in 8 and 70B sizes. The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",
|
|
86
|
-
"input": {
|
|
87
|
-
"costPer1MTokens": 0.59,
|
|
88
|
-
"maxTokens": 8192
|
|
89
|
-
},
|
|
90
|
-
"output": {
|
|
91
|
-
"costPer1MTokens": 0.79,
|
|
92
|
-
"maxTokens": 8192
|
|
93
|
-
},
|
|
94
|
-
"integration": "groq"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"id": "groq__llama3-8b-8192",
|
|
98
|
-
"name": "LLaMA 3 8B",
|
|
99
|
-
"description": "Meta developed and released the Meta Llama 3 family of large language models (LLMs), a collection of pretrained and instruction tuned generative text models in 8 and 70B sizes. The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",
|
|
100
|
-
"tags": [
|
|
101
|
-
"low-cost",
|
|
102
|
-
"general-purpose",
|
|
103
|
-
"deprecated"
|
|
104
|
-
],
|
|
105
|
-
"input": {
|
|
106
|
-
"costPer1MTokens": 0.05,
|
|
107
|
-
"maxTokens": 8192
|
|
108
|
-
},
|
|
109
|
-
"output": {
|
|
110
|
-
"costPer1MTokens": 0.08,
|
|
111
|
-
"maxTokens": 8192
|
|
112
|
-
},
|
|
113
|
-
"integration": "groq"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"id": "groq__llama-3.1-70b-versatile",
|
|
117
|
-
"name": "LLaMA 3.1 70B",
|
|
118
|
-
"description": "The Llama 3.1 instruction-tuned, text-only models are optimized for multilingual dialogue use cases.",
|
|
119
|
-
"tags": [
|
|
120
|
-
"recommended",
|
|
121
|
-
"general-purpose"
|
|
122
|
-
],
|
|
123
|
-
"input": {
|
|
124
|
-
"costPer1MTokens": 0.59,
|
|
125
|
-
"maxTokens": 128000
|
|
126
|
-
},
|
|
127
|
-
"output": {
|
|
128
|
-
"costPer1MTokens": 0.79,
|
|
129
|
-
"maxTokens": 8192
|
|
130
|
-
},
|
|
131
|
-
"integration": "groq"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"id": "groq__llama-3.1-8b-instant",
|
|
135
|
-
"name": "LLaMA 3.1 8B",
|
|
136
|
-
"description": "The Llama 3.1 instruction-tuned, text-only models are optimized for multilingual dialogue use cases.",
|
|
137
|
-
"tags": [
|
|
138
|
-
"low-cost",
|
|
139
|
-
"general-purpose"
|
|
140
|
-
],
|
|
141
|
-
"input": {
|
|
142
|
-
"costPer1MTokens": 0.05,
|
|
143
|
-
"maxTokens": 128000
|
|
144
|
-
},
|
|
145
|
-
"output": {
|
|
146
|
-
"costPer1MTokens": 0.08,
|
|
147
|
-
"maxTokens": 8192
|
|
148
|
-
},
|
|
149
|
-
"integration": "groq"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
"id": "groq__llama-3.2-11b-vision-preview",
|
|
153
|
-
"name": "LLaMA 3.2 11B Vision (Preview)",
|
|
154
|
-
"description": "[BETA preview version] The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image.",
|
|
155
|
-
"tags": [
|
|
156
|
-
"low-cost",
|
|
157
|
-
"vision",
|
|
158
|
-
"general-purpose"
|
|
159
|
-
],
|
|
160
|
-
"input": {
|
|
161
|
-
"costPer1MTokens": 0.18,
|
|
162
|
-
"maxTokens": 128000
|
|
163
|
-
},
|
|
164
|
-
"output": {
|
|
165
|
-
"costPer1MTokens": 0.18,
|
|
166
|
-
"maxTokens": 8192
|
|
167
|
-
},
|
|
168
|
-
"integration": "groq"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"id": "groq__llama-3.2-1b-preview",
|
|
172
|
-
"name": "LLaMA 3.2 1B (Preview)",
|
|
173
|
-
"description": "[BETA preview version] The Llama 3.2 instruction-tuned, text-only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks.",
|
|
174
|
-
"tags": [
|
|
175
|
-
"low-cost"
|
|
176
|
-
],
|
|
177
|
-
"input": {
|
|
178
|
-
"costPer1MTokens": 0.04,
|
|
179
|
-
"maxTokens": 128000
|
|
180
|
-
},
|
|
181
|
-
"output": {
|
|
182
|
-
"costPer1MTokens": 0.04,
|
|
183
|
-
"maxTokens": 8192
|
|
184
|
-
},
|
|
185
|
-
"integration": "groq"
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"id": "groq__llama-3.2-3b-preview",
|
|
189
|
-
"name": "LLaMA 3.2 3B (Preview)",
|
|
190
|
-
"description": "[BETA preview version] The Llama 3.2 instruction-tuned, text-only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks.",
|
|
191
|
-
"tags": [
|
|
192
|
-
"low-cost",
|
|
193
|
-
"general-purpose"
|
|
194
|
-
],
|
|
195
|
-
"input": {
|
|
196
|
-
"costPer1MTokens": 0.06,
|
|
197
|
-
"maxTokens": 128000
|
|
198
|
-
},
|
|
199
|
-
"output": {
|
|
200
|
-
"costPer1MTokens": 0.06,
|
|
201
|
-
"maxTokens": 8192
|
|
202
|
-
},
|
|
203
|
-
"integration": "groq"
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
"id": "groq__llama-3.2-90b-vision-preview",
|
|
207
|
-
"name": "LLaMA 3.2 90B Vision (Preview)",
|
|
208
|
-
"description": "[BETA preview version] The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image.",
|
|
209
|
-
"tags": [
|
|
210
|
-
"recommended",
|
|
211
|
-
"vision",
|
|
212
|
-
"general-purpose"
|
|
213
|
-
],
|
|
214
|
-
"input": {
|
|
215
|
-
"costPer1MTokens": 0.9,
|
|
216
|
-
"maxTokens": 128000
|
|
217
|
-
},
|
|
218
|
-
"output": {
|
|
219
|
-
"costPer1MTokens": 0.9,
|
|
220
|
-
"maxTokens": 8192
|
|
221
|
-
},
|
|
222
|
-
"integration": "groq"
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
"id": "groq__mixtral-8x7b-32768",
|
|
226
|
-
"name": "Mixtral 8x7B",
|
|
227
|
-
"tags": [
|
|
228
|
-
"low-cost",
|
|
229
|
-
"general-purpose",
|
|
230
|
-
"deprecated"
|
|
231
|
-
],
|
|
232
|
-
"description": "Mistral MoE 8x7B Instruct v0.1 model with Sparse Mixture of Experts. Fine tuned for instruction following",
|
|
233
|
-
"input": {
|
|
234
|
-
"costPer1MTokens": 0.24,
|
|
235
|
-
"maxTokens": 32768
|
|
236
|
-
},
|
|
237
|
-
"output": {
|
|
238
|
-
"costPer1MTokens": 0.24,
|
|
239
|
-
"maxTokens": 32768
|
|
240
|
-
},
|
|
241
|
-
"integration": "groq"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"id": "openai__gpt-3.5-turbo-0125",
|
|
245
|
-
"name": "GPT-3.5 Turbo",
|
|
246
|
-
"description": "GPT-3.5 Turbo can understand and generate natural language or code and has been optimized for chat but works well for non-chat tasks as well.",
|
|
247
|
-
"tags": [
|
|
248
|
-
"deprecated",
|
|
249
|
-
"general-purpose",
|
|
250
|
-
"low-cost"
|
|
251
|
-
],
|
|
252
|
-
"input": {
|
|
253
|
-
"costPer1MTokens": 0.5,
|
|
254
|
-
"maxTokens": 128000
|
|
255
|
-
},
|
|
256
|
-
"output": {
|
|
257
|
-
"costPer1MTokens": 1.5,
|
|
258
|
-
"maxTokens": 4096
|
|
259
|
-
},
|
|
260
|
-
"integration": "openai"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"id": "openai__gpt-4-turbo-2024-04-09",
|
|
264
|
-
"name": "GPT-4 Turbo",
|
|
265
|
-
"description": "GPT-4 is a large multimodal model (accepting text or image inputs and outputting text) that can solve difficult problems with greater accuracy than any of our previous models, thanks to its broader general knowledge and advanced reasoning capabilities.",
|
|
266
|
-
"tags": [
|
|
267
|
-
"deprecated",
|
|
268
|
-
"general-purpose",
|
|
269
|
-
"coding",
|
|
270
|
-
"agents",
|
|
271
|
-
"function-calling"
|
|
272
|
-
],
|
|
273
|
-
"input": {
|
|
274
|
-
"costPer1MTokens": 10,
|
|
275
|
-
"maxTokens": 128000
|
|
276
|
-
},
|
|
277
|
-
"output": {
|
|
278
|
-
"costPer1MTokens": 30,
|
|
279
|
-
"maxTokens": 4096
|
|
280
|
-
},
|
|
281
|
-
"integration": "openai"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"id": "openai__gpt-4o-2024-08-06",
|
|
285
|
-
"name": "GPT-4o (August 2024)",
|
|
286
|
-
"description": "GPT-4o (“o” for “omni”) is OpenAI's most advanced model. It is multimodal (accepting text or image inputs and outputting text), and it has the same high intelligence as GPT-4 Turbo but is cheaper and more efficient.",
|
|
287
|
-
"tags": [
|
|
288
|
-
"recommended",
|
|
289
|
-
"vision",
|
|
290
|
-
"general-purpose",
|
|
291
|
-
"coding",
|
|
292
|
-
"agents",
|
|
293
|
-
"function-calling"
|
|
294
|
-
],
|
|
295
|
-
"input": {
|
|
296
|
-
"costPer1MTokens": 2.5,
|
|
297
|
-
"maxTokens": 128000
|
|
298
|
-
},
|
|
299
|
-
"output": {
|
|
300
|
-
"costPer1MTokens": 10,
|
|
301
|
-
"maxTokens": 16384
|
|
302
|
-
},
|
|
303
|
-
"integration": "openai"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"id": "openai__gpt-4o-2024-05-13",
|
|
307
|
-
"name": "GPT-4o (May 2024)",
|
|
308
|
-
"description": "GPT-4o (“o” for “omni”) is OpenAI's most advanced model. It is multimodal (accepting text or image inputs and outputting text), and it has the same high intelligence as GPT-4 Turbo but is cheaper and more efficient.",
|
|
309
|
-
"tags": [
|
|
310
|
-
"vision",
|
|
311
|
-
"general-purpose",
|
|
312
|
-
"coding",
|
|
313
|
-
"agents",
|
|
314
|
-
"function-calling"
|
|
315
|
-
],
|
|
316
|
-
"input": {
|
|
317
|
-
"costPer1MTokens": 5,
|
|
318
|
-
"maxTokens": 128000
|
|
319
|
-
},
|
|
320
|
-
"output": {
|
|
321
|
-
"costPer1MTokens": 15,
|
|
322
|
-
"maxTokens": 4096
|
|
323
|
-
},
|
|
324
|
-
"integration": "openai"
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
"id": "openai__gpt-4o-mini-2024-07-18",
|
|
328
|
-
"name": "GPT-4o Mini",
|
|
329
|
-
"description": "GPT-4o mini (“o” for “omni”) is OpenAI's most advanced model in the small models category, and their cheapest model yet. It is multimodal (accepting text or image inputs and outputting text), has higher intelligence than gpt-3.5-turbo but is just as fast. It is meant to be used for smaller tasks, including vision tasks. It's recommended to choose gpt-4o-mini where you would have previously used gpt-3.5-turbo as this model is more capable and cheaper.",
|
|
330
|
-
"tags": [
|
|
331
|
-
"recommended",
|
|
332
|
-
"vision",
|
|
333
|
-
"low-cost",
|
|
334
|
-
"general-purpose",
|
|
335
|
-
"function-calling"
|
|
336
|
-
],
|
|
337
|
-
"input": {
|
|
338
|
-
"costPer1MTokens": 0.15,
|
|
339
|
-
"maxTokens": 128000
|
|
340
|
-
},
|
|
341
|
-
"output": {
|
|
342
|
-
"costPer1MTokens": 0.6,
|
|
343
|
-
"maxTokens": 16384
|
|
344
|
-
},
|
|
345
|
-
"integration": "openai"
|
|
346
|
-
}
|
|
347
|
-
] as const
|