-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.sample.jsonc
197 lines (159 loc) · 5.65 KB
/
config.sample.jsonc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
//--------------------------------------------
// Sample config JSON for ai-bridge
//--------------------------------------------
{
// The following is defines
// the apikeys for the various providers
//----------------------------------------
"provider": {
// For openAI, all you will need is the apikey
"openai": "your-apikey",
// // For forefront.ai, you will need to provide both an API key
// // and a URL mapping for each model
// // @TODO : NOT SUPPORTED YET
// "forefront.ai": {
// "apikey": "your-apikey",
// "models": {
// "custom-forefront-model-name": "https://shared-api.forefront.link/organization/<some-id>/<model-name>/completions/<some-id>"
// }
// },
// Custom openai drop in API provider
// @TODO : NOT SUPPORTED YET
"customAPI": { "type":"openai", "url":"https://api.openai.com/v1/", "apikey":"your-apikey" }
},
// //
// // @TODO : NOT SUPPORTED YET
// //
// // Custom model mapping,
// // This is used to divert operations on a model to model level
// //
// // If not configured, by default it will use the openai implementation
// // (if apikey is set)
// //
// // This is useful for model aliasing, and swapping out at a config level.
// //----------------------------------------
// "modelmap" : {
// "model-name-requested": {
// "provider": "openai", // default
// "name": "model-name-to-use", // name to use instead, uses the same name if not set
// // You can enable/disable caching settings on a model by model level
// "cache": true
// }
// },
// Concurrent provider access
// use to reate limit API request
//
// Is not used to rate limit cache checks
//----------------------------------------
// Number of provider requests that can occur concurrently
"providerRateLimit": 1,
// Latency delay between request, to be used with rate limit, to further "tune down"
"providerLatencyAdd": 0,
// Caching controls
//----------------------------------------
"cache": {
// Local dir, to store multiple jsonl files, which is used for caching
"localJsonlDir": {
"enable": true,
"path": "./.ai-bridge-cache"
},
// MongoDB connection, to store and query cached completion request
"mongoDB": {
"enable": false,
"url": "mongodb+srv://sample-hostname:27017/?maxPoolSize=20&w=majority"
},
// Individually enable prompt or embedding caching
"promptCache": true,
"embeddingCache": true
},
// AI bridge settings
//----------------------------------------
// Used as a multiple of temprature value, which will decide the maximum number
// of permutations any prompt would be cached with. With a minimum of 1
//
// A tempKeyMultiplier of 10 will store the following number of records per unique prompt settings
// - 10 total variation with a temprature of 10
// - 1 total varation with a temprature of 0
//
// Note that having different settings, like stop character, etc. Will result to a different cache record.
"temperatureKeyMultiplier" : 10,
// Default settings overwrite
//
// Note the implementation/change for
// - temprature
// - total_tokens
//
// Rest is pretty much stock settings
//----------------------------------------
"default": {
"completion": {
// // Default model to use
// "model": "gpt-3.5-turbo",
// // Total tokens computes the max_tokens
// // using the current prompt.
// //
// // This setting is ignored if max_tokens is set
// "total_tokens": 4080,
// // Maximum token to use for generation
// "max_tokens": null,
// // // Default prompt and stop token
// // "prompt": "<|endoftext|>",
// // "stop": "<|endoftext|>",
// // Default temperature to use, we set to 0
// // by default, as this makes all prompts highly cachable.
// //
// // range from 0-1
// "temperature": 0,
// // // Nucleaus sampling (see docs for more details)
// // //
// // // range from 0-1
// // "top_p": 1,
// // // Number of completion to create
// // // generally recommended to do multiple calls instead
// // "n": 1,
// // Enable / Disable streaming, callback function should be
// // set if stream is enabled
// "stream": false,
// // Presence and frequency penalties, refer to docs for more details
// "presence_penalty": 0,
// "frequency_penalty": 0,
// // // When use with N, decide the number possible answer to evaluate from
// // // IMHO, highly not recommended to be used.
// // // As its unclear/unpredictable on how one sample is chosen over another.
// // "best_of":1,
// // Proabability modification for individual tokens
// // avoid using, unless you really know what your doing
// "logit_bias": null,
// // String to append at the end of response
// // just dun use this, and do the appending directly
// "suffix": null,
// // This is ignored on cache reads, but is sent on prompt request
// "user": null,
// // This setting is ignored, as we do not cache the log probabilities
// "logprobs": null
},
"embedding": {
// // Default model to use
// "model": "text-embedding-ada-002",
// // This is ignored on cache reads, but is sent on prompt request
// "user": null
},
"chat": {
// "model": "gpt-3.5-turbo",
// "temperature": 0,
// "total_tokens": 4050,
// "max_tokens": null,
// "top_p": 1,
// "frequency_penalty": 0,
// "presence_penalty": 0,
// // Important note!: we split the endoftext token very
// // intentionally,to avoid causing issues when this file is parsed
// // by GPT-3 based AI.
// // // Default stop keyword
// // "stop": ["<|"+"endoftext"+"|>"],
// // Return as a string if false,
// // else return the raw openAI API response
// "rawApi": false
}
}
}