ben-ai-models-registry 1.0.2
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/README.md +1 -0
- package/index.js +8 -0
- package/models/JobStatus.js +19 -0
- package/models/Run.js +74 -0
- package/package.json +15 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This repositry is for shared mongoose models used in all Bennie and the AI Jets node apps.
|
package/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const JobStatusSchema = new mongoose.Schema(
|
|
4
|
+
{
|
|
5
|
+
runId: { type: mongoose.Schema.Types.ObjectId, ref: 'Run' },
|
|
6
|
+
status: {
|
|
7
|
+
type: String,
|
|
8
|
+
enum: ['pending', 'in_progress', 'completed', 'failed'],
|
|
9
|
+
default: 'pending',
|
|
10
|
+
},
|
|
11
|
+
progress: {
|
|
12
|
+
processedQAPairs: { type: Number, default: 0 },
|
|
13
|
+
totalQAPairs: Number,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{ timestamps: true, versionKey: false }
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
module.exports = mongoose.model('JobStatus', JobStatusSchema);
|
package/models/Run.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const mongoose = require('mongoose');
|
|
2
|
+
const { Schema } = mongoose;
|
|
3
|
+
|
|
4
|
+
const AssistantModel = {
|
|
5
|
+
Langchain: 'langchain-assistant',
|
|
6
|
+
OpenAI: 'openAI-assistant',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const ModelName = {
|
|
10
|
+
GPT4O: 'gpt-4o',
|
|
11
|
+
GPT4TurboPreview: 'gpt-4-turbo-preview',
|
|
12
|
+
GPT4Turbo: 'gpt-4-turbo',
|
|
13
|
+
GPT4Turbo20240409: 'gpt-4-turbo-2024-04-09',
|
|
14
|
+
GPT40125Preview: 'gpt-4-0125-preview',
|
|
15
|
+
GPT41106Preview: 'gpt-4-1106-preview',
|
|
16
|
+
GPT4: 'gpt-4',
|
|
17
|
+
GPT40613: 'gpt-4-0613',
|
|
18
|
+
GPT432K: 'gpt-4-32k',
|
|
19
|
+
GPT432K0613: 'gpt-4-32k-0613',
|
|
20
|
+
GPT3_5Turbo0125: 'gpt-3.5-turbo-0125',
|
|
21
|
+
GPT3_5Turbo: 'gpt-3.5-turbo',
|
|
22
|
+
GPT3_5Turbo1106: 'gpt-3.5-turbo-1106',
|
|
23
|
+
GPT3_5TurboInstruct: 'gpt-3.5-turbo-instruct',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const RunType = {
|
|
27
|
+
SINGLE_LOOP: 'single-loop',
|
|
28
|
+
PAIR_WISE_COMPARE: 'pair-wise-compare',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const AnswerSchema = new Schema({
|
|
32
|
+
prediction: { type: String, required: true },
|
|
33
|
+
assistantModel: {
|
|
34
|
+
type: String,
|
|
35
|
+
enum: Object.values(AssistantModel),
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
}, { versionKey: false });
|
|
39
|
+
|
|
40
|
+
const EvalSchema = new Schema({
|
|
41
|
+
evalData: [
|
|
42
|
+
{
|
|
43
|
+
answers: { type: [AnswerSchema] },
|
|
44
|
+
llmScore: { type: String },
|
|
45
|
+
llmReasoning: { type: String },
|
|
46
|
+
humanScore: { type: String },
|
|
47
|
+
humanReasoning: { type: String },
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
question: { type: String },
|
|
51
|
+
expectedAnswer: { type: String },
|
|
52
|
+
}, { versionKey: false });
|
|
53
|
+
|
|
54
|
+
const RunSchema = new mongoose.Schema({
|
|
55
|
+
name: { type: String },
|
|
56
|
+
description: { type: String },
|
|
57
|
+
type: {
|
|
58
|
+
type: String,
|
|
59
|
+
enum: Object.values(RunType),
|
|
60
|
+
},
|
|
61
|
+
instruction: { type: String },
|
|
62
|
+
modelName: {
|
|
63
|
+
type: String,
|
|
64
|
+
enum: Object.values(ModelName),
|
|
65
|
+
},
|
|
66
|
+
evalResults: { type: [EvalSchema], required: true },
|
|
67
|
+
llmPassRate: { type: Number },
|
|
68
|
+
humanPassRate: { type: Number },
|
|
69
|
+
}, { timestamps: true, versionKey: false });
|
|
70
|
+
|
|
71
|
+
// const Run = mongoose.models.Run || mongoose.model('Run', RunSchema);
|
|
72
|
+
// module.exports = { Run, AssistantModel, ModelName, RunType };
|
|
73
|
+
|
|
74
|
+
module.exports = mongoose.model('Run', RunSchema);
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ben-ai-models-registry",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"mongoose": "^8.4.4"
|
|
14
|
+
}
|
|
15
|
+
}
|