@@ -76,6 +76,16 @@ export const MODEL_LIST = {
76
76
'gemini-1.0-pro' ,
77
77
'gemini-pro-vision' ,
78
78
'text-embedding-004'
79
+ ] ,
80
+
81
+ groq : [
82
+ 'llama3-70b-8192' , // Meta Llama 3 70B (default one, no daily token limit and 14 400 reqs/day)
83
+ 'llama3-8b-8192' , // Meta Llama 3 8B
84
+ 'llama-guard-3-8b' , // Llama Guard 3 8B
85
+ 'llama-3.1-8b-instant' , // Llama 3.1 8B (Preview)
86
+ 'llama-3.1-70b-versatile' , // Llama 3.1 70B (Preview)
87
+ 'gemma-7b-it' , // Gemma 7B
88
+ 'gemma2-9b-it' // Gemma 2 9B
79
89
]
80
90
} ;
81
91
@@ -87,6 +97,8 @@ const getDefaultModel = (provider: string | undefined): string => {
87
97
return MODEL_LIST . anthropic [ 0 ] ;
88
98
case 'gemini' :
89
99
return MODEL_LIST . gemini [ 0 ] ;
100
+ case 'groq' :
101
+ return MODEL_LIST . groq [ 0 ] ;
90
102
default :
91
103
return MODEL_LIST . openai [ 0 ] ;
92
104
}
@@ -241,7 +253,7 @@ export const configValidators = {
241
253
242
254
validateConfig (
243
255
CONFIG_KEYS . OCO_AI_PROVIDER ,
244
- [ 'openai' , 'anthropic' , 'gemini' , 'azure' , 'test' , 'flowise' ] . includes (
256
+ [ 'openai' , 'anthropic' , 'gemini' , 'azure' , 'test' , 'flowise' , 'groq' ] . includes (
245
257
value
246
258
) || value . startsWith ( 'ollama' ) ,
247
259
`${ value } is not supported yet, use 'ollama', 'anthropic', 'azure', 'gemini', 'flowise' or 'openai' (default)`
@@ -288,7 +300,8 @@ export enum OCO_AI_PROVIDER_ENUM {
288
300
GEMINI = 'gemini' ,
289
301
AZURE = 'azure' ,
290
302
TEST = 'test' ,
291
- FLOWISE = 'flowise'
303
+ FLOWISE = 'flowise' ,
304
+ GROQ = 'groq' ,
292
305
}
293
306
294
307
export type ConfigType = {
@@ -388,7 +401,7 @@ const getEnvConfig = (envPath: string) => {
388
401
OCO_EMOJI : parseConfigVarValue ( process . env . OCO_EMOJI ) ,
389
402
OCO_LANGUAGE : process . env . OCO_LANGUAGE ,
390
403
OCO_MESSAGE_TEMPLATE_PLACEHOLDER :
391
- process . env . OCO_MESSAGE_TEMPLATE_PLACEHOLDER ,
404
+ process . env . OCO_MESSAGE_TEMPLATE_PLACEHOLDER ,
392
405
OCO_PROMPT_MODULE : process . env . OCO_PROMPT_MODULE as OCO_PROMPT_MODULE_ENUM ,
393
406
OCO_ONE_LINE_COMMIT : parseConfigVarValue ( process . env . OCO_ONE_LINE_COMMIT ) ,
394
407
OCO_TEST_MOCK_TYPE : process . env . OCO_TEST_MOCK_TYPE ,
@@ -445,9 +458,9 @@ interface GetConfigOptions {
445
458
}
446
459
447
460
export const getConfig = ( {
448
- envPath = defaultEnvPath ,
449
- globalPath = defaultConfigPath
450
- } : GetConfigOptions = { } ) : ConfigType => {
461
+ envPath = defaultEnvPath ,
462
+ globalPath = defaultConfigPath
463
+ } : GetConfigOptions = { } ) : ConfigType => {
451
464
const envConfig = getEnvConfig ( envPath ) ;
452
465
const globalConfig = getGlobalConfig ( globalPath ) ;
453
466
0 commit comments