@adaline/groq 0.15.0 → 0.17.0

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/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ChatModelSchemaType, ParamsType, ProviderV1, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1 } from '@adaline/provider';
2
2
  import { z } from 'zod';
3
3
  import { BaseChatModel } from '@adaline/openai';
4
- import { MessageType } from '@adaline/types';
4
+ import { MessageType, ChatModelPriceType } from '@adaline/types';
5
5
 
6
6
  declare const BaseChatModelOptions: z.ZodObject<{
7
7
  modelName: z.ZodString;
@@ -21,6 +21,7 @@ declare class BaseChatModelGroq extends BaseChatModel {
21
21
  private readonly groqApiKey;
22
22
  constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType);
23
23
  transformMessages(messages: MessageType[]): ParamsType;
24
+ getModelPricing(): ChatModelPriceType;
24
25
  }
25
26
 
26
27
  declare const Gemma2_9b_ITLiteral: "gemma2-9b-it";
@@ -69,6 +70,21 @@ declare const Gemma2_9b_ITSchema: {
69
70
  }>;
70
71
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
71
72
  };
73
+ price: {
74
+ modelName: string;
75
+ currency: string;
76
+ tokenRanges: {
77
+ minTokens: number;
78
+ prices: {
79
+ base: {
80
+ inputPricePerMillion: number;
81
+ outputPricePerMillion: number;
82
+ };
83
+ };
84
+ maxTokens?: number | null | undefined;
85
+ }[];
86
+ };
87
+ maxReasoningTokens?: number | undefined;
72
88
  };
73
89
  declare const Gemma2_9b_ITOptions: z.ZodObject<{
74
90
  modelName: z.ZodString;
@@ -131,6 +147,21 @@ declare const Llama_3_1_8bSchema: {
131
147
  }>;
132
148
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
133
149
  };
150
+ price: {
151
+ modelName: string;
152
+ currency: string;
153
+ tokenRanges: {
154
+ minTokens: number;
155
+ prices: {
156
+ base: {
157
+ inputPricePerMillion: number;
158
+ outputPricePerMillion: number;
159
+ };
160
+ };
161
+ maxTokens?: number | null | undefined;
162
+ }[];
163
+ };
164
+ maxReasoningTokens?: number | undefined;
134
165
  };
135
166
  declare const Llama_3_1_8b_Options: z.ZodObject<{
136
167
  modelName: z.ZodString;
@@ -193,6 +224,21 @@ declare const Llama_3_2_11b_VisionSchema: {
193
224
  }>;
194
225
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
195
226
  };
227
+ price: {
228
+ modelName: string;
229
+ currency: string;
230
+ tokenRanges: {
231
+ minTokens: number;
232
+ prices: {
233
+ base: {
234
+ inputPricePerMillion: number;
235
+ outputPricePerMillion: number;
236
+ };
237
+ };
238
+ maxTokens?: number | null | undefined;
239
+ }[];
240
+ };
241
+ maxReasoningTokens?: number | undefined;
196
242
  };
197
243
  declare const Llama_3_2_11b_VisionOptions: z.ZodObject<{
198
244
  modelName: z.ZodString;
@@ -255,6 +301,21 @@ declare const Llama_3_2_1bSchema: {
255
301
  }>;
256
302
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
257
303
  };
304
+ price: {
305
+ modelName: string;
306
+ currency: string;
307
+ tokenRanges: {
308
+ minTokens: number;
309
+ prices: {
310
+ base: {
311
+ inputPricePerMillion: number;
312
+ outputPricePerMillion: number;
313
+ };
314
+ };
315
+ maxTokens?: number | null | undefined;
316
+ }[];
317
+ };
318
+ maxReasoningTokens?: number | undefined;
258
319
  };
259
320
  declare const Llama_3_2_1b_Options: z.ZodObject<{
260
321
  modelName: z.ZodString;
@@ -317,6 +378,21 @@ declare const Llama_3_2_3bSchema: {
317
378
  }>;
318
379
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
319
380
  };
381
+ price: {
382
+ modelName: string;
383
+ currency: string;
384
+ tokenRanges: {
385
+ minTokens: number;
386
+ prices: {
387
+ base: {
388
+ inputPricePerMillion: number;
389
+ outputPricePerMillion: number;
390
+ };
391
+ };
392
+ maxTokens?: number | null | undefined;
393
+ }[];
394
+ };
395
+ maxReasoningTokens?: number | undefined;
320
396
  };
321
397
  declare const Llama_3_2_3b_Options: z.ZodObject<{
322
398
  modelName: z.ZodString;
@@ -379,6 +455,21 @@ declare const Llama_3_2_90b_VisionSchema: {
379
455
  }>;
380
456
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
381
457
  };
458
+ price: {
459
+ modelName: string;
460
+ currency: string;
461
+ tokenRanges: {
462
+ minTokens: number;
463
+ prices: {
464
+ base: {
465
+ inputPricePerMillion: number;
466
+ outputPricePerMillion: number;
467
+ };
468
+ };
469
+ maxTokens?: number | null | undefined;
470
+ }[];
471
+ };
472
+ maxReasoningTokens?: number | undefined;
382
473
  };
383
474
  declare const Llama_3_2_90b_VisionOptions: z.ZodObject<{
384
475
  modelName: z.ZodString;
@@ -441,6 +532,21 @@ declare const Llama_3_70bSchema: {
441
532
  }>;
442
533
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
443
534
  };
535
+ price: {
536
+ modelName: string;
537
+ currency: string;
538
+ tokenRanges: {
539
+ minTokens: number;
540
+ prices: {
541
+ base: {
542
+ inputPricePerMillion: number;
543
+ outputPricePerMillion: number;
544
+ };
545
+ };
546
+ maxTokens?: number | null | undefined;
547
+ }[];
548
+ };
549
+ maxReasoningTokens?: number | undefined;
444
550
  };
445
551
  declare const Llama_3_70bOptions: z.ZodObject<{
446
552
  modelName: z.ZodString;
@@ -503,6 +609,21 @@ declare const Llama_3_8bSchema: {
503
609
  }>;
504
610
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
505
611
  };
612
+ price: {
613
+ modelName: string;
614
+ currency: string;
615
+ tokenRanges: {
616
+ minTokens: number;
617
+ prices: {
618
+ base: {
619
+ inputPricePerMillion: number;
620
+ outputPricePerMillion: number;
621
+ };
622
+ };
623
+ maxTokens?: number | null | undefined;
624
+ }[];
625
+ };
626
+ maxReasoningTokens?: number | undefined;
506
627
  };
507
628
  declare const Llama_3_8bOptions: z.ZodObject<{
508
629
  modelName: z.ZodString;
@@ -565,6 +686,21 @@ declare const LlamaGuard_3_8bSchema: {
565
686
  }>;
566
687
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
567
688
  };
689
+ price: {
690
+ modelName: string;
691
+ currency: string;
692
+ tokenRanges: {
693
+ minTokens: number;
694
+ prices: {
695
+ base: {
696
+ inputPricePerMillion: number;
697
+ outputPricePerMillion: number;
698
+ };
699
+ };
700
+ maxTokens?: number | null | undefined;
701
+ }[];
702
+ };
703
+ maxReasoningTokens?: number | undefined;
568
704
  };
569
705
  declare const LlamaGuard_3_8bOptions: z.ZodObject<{
570
706
  modelName: z.ZodString;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ChatModelSchemaType, ParamsType, ProviderV1, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1 } from '@adaline/provider';
2
2
  import { z } from 'zod';
3
3
  import { BaseChatModel } from '@adaline/openai';
4
- import { MessageType } from '@adaline/types';
4
+ import { MessageType, ChatModelPriceType } from '@adaline/types';
5
5
 
6
6
  declare const BaseChatModelOptions: z.ZodObject<{
7
7
  modelName: z.ZodString;
@@ -21,6 +21,7 @@ declare class BaseChatModelGroq extends BaseChatModel {
21
21
  private readonly groqApiKey;
22
22
  constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType);
23
23
  transformMessages(messages: MessageType[]): ParamsType;
24
+ getModelPricing(): ChatModelPriceType;
24
25
  }
25
26
 
26
27
  declare const Gemma2_9b_ITLiteral: "gemma2-9b-it";
@@ -69,6 +70,21 @@ declare const Gemma2_9b_ITSchema: {
69
70
  }>;
70
71
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
71
72
  };
73
+ price: {
74
+ modelName: string;
75
+ currency: string;
76
+ tokenRanges: {
77
+ minTokens: number;
78
+ prices: {
79
+ base: {
80
+ inputPricePerMillion: number;
81
+ outputPricePerMillion: number;
82
+ };
83
+ };
84
+ maxTokens?: number | null | undefined;
85
+ }[];
86
+ };
87
+ maxReasoningTokens?: number | undefined;
72
88
  };
73
89
  declare const Gemma2_9b_ITOptions: z.ZodObject<{
74
90
  modelName: z.ZodString;
@@ -131,6 +147,21 @@ declare const Llama_3_1_8bSchema: {
131
147
  }>;
132
148
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
133
149
  };
150
+ price: {
151
+ modelName: string;
152
+ currency: string;
153
+ tokenRanges: {
154
+ minTokens: number;
155
+ prices: {
156
+ base: {
157
+ inputPricePerMillion: number;
158
+ outputPricePerMillion: number;
159
+ };
160
+ };
161
+ maxTokens?: number | null | undefined;
162
+ }[];
163
+ };
164
+ maxReasoningTokens?: number | undefined;
134
165
  };
135
166
  declare const Llama_3_1_8b_Options: z.ZodObject<{
136
167
  modelName: z.ZodString;
@@ -193,6 +224,21 @@ declare const Llama_3_2_11b_VisionSchema: {
193
224
  }>;
194
225
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
195
226
  };
227
+ price: {
228
+ modelName: string;
229
+ currency: string;
230
+ tokenRanges: {
231
+ minTokens: number;
232
+ prices: {
233
+ base: {
234
+ inputPricePerMillion: number;
235
+ outputPricePerMillion: number;
236
+ };
237
+ };
238
+ maxTokens?: number | null | undefined;
239
+ }[];
240
+ };
241
+ maxReasoningTokens?: number | undefined;
196
242
  };
197
243
  declare const Llama_3_2_11b_VisionOptions: z.ZodObject<{
198
244
  modelName: z.ZodString;
@@ -255,6 +301,21 @@ declare const Llama_3_2_1bSchema: {
255
301
  }>;
256
302
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
257
303
  };
304
+ price: {
305
+ modelName: string;
306
+ currency: string;
307
+ tokenRanges: {
308
+ minTokens: number;
309
+ prices: {
310
+ base: {
311
+ inputPricePerMillion: number;
312
+ outputPricePerMillion: number;
313
+ };
314
+ };
315
+ maxTokens?: number | null | undefined;
316
+ }[];
317
+ };
318
+ maxReasoningTokens?: number | undefined;
258
319
  };
259
320
  declare const Llama_3_2_1b_Options: z.ZodObject<{
260
321
  modelName: z.ZodString;
@@ -317,6 +378,21 @@ declare const Llama_3_2_3bSchema: {
317
378
  }>;
318
379
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
319
380
  };
381
+ price: {
382
+ modelName: string;
383
+ currency: string;
384
+ tokenRanges: {
385
+ minTokens: number;
386
+ prices: {
387
+ base: {
388
+ inputPricePerMillion: number;
389
+ outputPricePerMillion: number;
390
+ };
391
+ };
392
+ maxTokens?: number | null | undefined;
393
+ }[];
394
+ };
395
+ maxReasoningTokens?: number | undefined;
320
396
  };
321
397
  declare const Llama_3_2_3b_Options: z.ZodObject<{
322
398
  modelName: z.ZodString;
@@ -379,6 +455,21 @@ declare const Llama_3_2_90b_VisionSchema: {
379
455
  }>;
380
456
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
381
457
  };
458
+ price: {
459
+ modelName: string;
460
+ currency: string;
461
+ tokenRanges: {
462
+ minTokens: number;
463
+ prices: {
464
+ base: {
465
+ inputPricePerMillion: number;
466
+ outputPricePerMillion: number;
467
+ };
468
+ };
469
+ maxTokens?: number | null | undefined;
470
+ }[];
471
+ };
472
+ maxReasoningTokens?: number | undefined;
382
473
  };
383
474
  declare const Llama_3_2_90b_VisionOptions: z.ZodObject<{
384
475
  modelName: z.ZodString;
@@ -441,6 +532,21 @@ declare const Llama_3_70bSchema: {
441
532
  }>;
442
533
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
443
534
  };
535
+ price: {
536
+ modelName: string;
537
+ currency: string;
538
+ tokenRanges: {
539
+ minTokens: number;
540
+ prices: {
541
+ base: {
542
+ inputPricePerMillion: number;
543
+ outputPricePerMillion: number;
544
+ };
545
+ };
546
+ maxTokens?: number | null | undefined;
547
+ }[];
548
+ };
549
+ maxReasoningTokens?: number | undefined;
444
550
  };
445
551
  declare const Llama_3_70bOptions: z.ZodObject<{
446
552
  modelName: z.ZodString;
@@ -503,6 +609,21 @@ declare const Llama_3_8bSchema: {
503
609
  }>;
504
610
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
505
611
  };
612
+ price: {
613
+ modelName: string;
614
+ currency: string;
615
+ tokenRanges: {
616
+ minTokens: number;
617
+ prices: {
618
+ base: {
619
+ inputPricePerMillion: number;
620
+ outputPricePerMillion: number;
621
+ };
622
+ };
623
+ maxTokens?: number | null | undefined;
624
+ }[];
625
+ };
626
+ maxReasoningTokens?: number | undefined;
506
627
  };
507
628
  declare const Llama_3_8bOptions: z.ZodObject<{
508
629
  modelName: z.ZodString;
@@ -565,6 +686,21 @@ declare const LlamaGuard_3_8bSchema: {
565
686
  }>;
566
687
  schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
567
688
  };
689
+ price: {
690
+ modelName: string;
691
+ currency: string;
692
+ tokenRanges: {
693
+ minTokens: number;
694
+ prices: {
695
+ base: {
696
+ inputPricePerMillion: number;
697
+ outputPricePerMillion: number;
698
+ };
699
+ };
700
+ maxTokens?: number | null | undefined;
701
+ }[];
702
+ };
703
+ maxReasoningTokens?: number | undefined;
568
704
  };
569
705
  declare const LlamaGuard_3_8bOptions: z.ZodObject<{
570
706
  modelName: z.ZodString;
package/dist/index.js CHANGED
@@ -4,49 +4,49 @@ var provider = require('@adaline/provider');
4
4
  var zod = require('zod');
5
5
  var openai = require('@adaline/openai');
6
6
 
7
- var s=zod.z.object({modelName:zod.z.string().min(1),apiKey:zod.z.string().min(1)}),a=class extends openai.BaseChatModel{constructor(n,p){let l=s.parse(p),r=_.baseUrl;super(n,{modelName:l.modelName,apiKey:l.apiKey,baseUrl:r,completeChatUrl:`${r}/chat/completions`,streamChatUrl:`${r}/chat/completions`});this.version="v1";this.modelSchema=n,this.modelName=l.modelName,this.groqApiKey=l.apiKey;}transformMessages(n){let p=n.some(m=>m.role==="system"),l=n.some(m=>m.content.some(c=>c.modality==="image"));if(p&&l)throw new provider.InvalidMessagesError({info:`Invalid message content for model : '${this.modelName}'`,cause:new Error("Prompting with images is incompatible with system messages`)")});let r=super.transformMessages(n);return r.messages.forEach(m=>{m.role==="system"?typeof m.content!="string"&&(m.content=m.content.map(c=>c.text).join(`
8
- `)):m.role==="assistant"&&m.content&&typeof m.content!="string"&&(m.content=m.content.map(c=>c.text).join(`
9
- `));}),r}};var g=provider.RangeConfigItem({param:"temperature",title:provider.CHAT_CONFIG.TEMPERATURE.title,description:provider.CHAT_CONFIG.TEMPERATURE.description,min:0,max:2,step:.01,default:1}),x=t=>provider.RangeConfigItem({param:"max_tokens",title:provider.CHAT_CONFIG.MAX_TOKENS.title,description:provider.CHAT_CONFIG.MAX_TOKENS.description,min:0,max:t,step:1,default:0}),S=provider.MultiStringConfigItem({param:"stop",title:provider.CHAT_CONFIG.STOP(4).title,description:provider.CHAT_CONFIG.STOP(4).description,max:4}),I=provider.RangeConfigItem({param:"top_p",title:provider.CHAT_CONFIG.TOP_P.title,description:provider.CHAT_CONFIG.TOP_P.description,min:0,max:1,step:.01,default:1}),E=provider.RangeConfigItem({param:"frequency_penalty",title:provider.CHAT_CONFIG.FREQUENCY_PENALTY.title,description:provider.CHAT_CONFIG.FREQUENCY_PENALTY.description,min:-2,max:2,step:.01,default:0}),A=provider.RangeConfigItem({param:"presence_penalty",title:provider.CHAT_CONFIG.PRESENCE_PENALTY.title,description:provider.CHAT_CONFIG.PRESENCE_PENALTY.description,min:-2,max:2,step:.01,default:0}),G=provider.RangeConfigItem({param:"seed",title:provider.CHAT_CONFIG.SEED.title,description:provider.CHAT_CONFIG.SEED.description,min:0,max:1e6,step:1,default:0}),R=provider.SelectStringConfigItem({param:"response_format",title:provider.CHAT_CONFIG.RESPONSE_FORMAT.title,description:provider.CHAT_CONFIG.RESPONSE_FORMAT.description,default:"text",choices:["text","json_object"]}),k=provider.SelectStringConfigItem({param:"tool_choice",title:"Tool choice",description:"Controls which (if any) tool is called by the model. 'none' means the model will not call a function. 'auto' means the model can pick between generating a message or calling a tool.",default:"auto",choices:["auto","required","none"]});var J=t=>zod.z.object({temperature:g.schema,maxTokens:x(t).schema,stop:S.schema,topP:I.schema,frequencyPenalty:E.schema,presencePenalty:A.schema,seed:G.schema.transform(e=>e===0?void 0:e),responseFormat:R.schema,toolChoice:k.schema}),W=t=>({temperature:g.def,maxTokens:x(t).def,stop:S.def,topP:I.def,frequencyPenalty:E.def,presencePenalty:A.def,seed:G.def,responseFormat:R.def,toolChoice:k.def});var o={base:t=>({def:W(t),schema:J(t)})};var q="gemma2-9b-it",ye="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.",P=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:q,description:ye,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ee=s,h=class extends a{constructor(e){super(P,e);}};var z="llama-3.1-8b-instant",xe="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",B=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:z,description:xe,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),oe=s,f=class extends a{constructor(e){super(B,e);}};var v="llama-3.2-11b-vision-preview",Re="The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The models outperform many of the available open source and closed multimodal models on common industry benchmarks.",V=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelModalitiesEnum).parse({name:v,description:Re,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ae=s,M=class extends a{constructor(e){super(V,e);}};var w="llama-3.2-1b-preview",ve="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",N=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:w,description:ve,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),te=s,u=class extends a{constructor(e){super(N,e);}};var F="llama-3.2-3b-preview",je="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",D=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:F,description:je,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),se=s,b=class extends a{constructor(e){super(D,e);}};var j="llama-3.2-90b-vision-preview",Xe="The Llama 3.2-90B Vision instruction-tuned models are optimized for advanced visual recognition, complex image reasoning, detailed captioning, and answering intricate questions about images. These models achieve state-of-the-art results on multiple industry benchmarks for multimodal tasks.",U=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelModalitiesEnum).parse({name:j,description:Xe,maxInputTokens:131072,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ne=s,y=class extends a{constructor(e){super(U,e);}};var K="llama3-70b-8192",oo="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.",Y=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:K,description:oo,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ie=s,O=class extends a{constructor(e){super(Y,e);}};var $="llama3-8b-8192",mo="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.",Q=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:$,description:mo,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),me=s,T=class extends a{constructor(e){super(Q,e);}};var X="llama-guard-3-8b",ho="Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.",Z=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:X,description:ho,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),le=s,C=class extends a{constructor(e){super(Z,e);}};var fo="groq",_=class{constructor(){this.version="v1";this.name=fo;this.chatModelFactories={[q]:{model:h,modelOptions:ee,modelSchema:P},[X]:{model:C,modelOptions:le,modelSchema:Z},[$]:{model:T,modelOptions:me,modelSchema:Q},[K]:{model:O,modelOptions:ie,modelSchema:Y},[z]:{model:f,modelOptions:oe,modelSchema:B},[v]:{model:M,modelOptions:ae,modelSchema:V},[j]:{model:y,modelOptions:ne,modelSchema:U},[F]:{model:b,modelOptions:se,modelSchema:D},[w]:{model:u,modelOptions:te,modelSchema:N}};this.embeddingModelFactories={};}chatModelLiterals(){return Object.keys(this.chatModelFactories)}chatModelSchemas(){return Object.keys(this.chatModelFactories).reduce((e,n)=>(e[n]=this.chatModelFactories[n].modelSchema,e),{})}chatModel(e){let n=e.modelName;if(!(n in this.chatModelFactories))throw new provider.ProviderError({info:`Groq chat model: ${n} not found`,cause:new Error(`Groq chat model: ${n} not found, available chat models:
10
- ${this.chatModelLiterals().join(", ")}`)});let p=this.chatModelFactories[n].model,l=this.chatModelFactories[n].modelOptions.parse(e);return new p(l)}embeddingModelLiterals(){return Object.keys(this.embeddingModelFactories)}embeddingModelSchemas(){return Object.keys(this.embeddingModelFactories).reduce((e,n)=>(e[n]=this.embeddingModelFactories[n].modelSchema,e),{})}embeddingModel(e){throw new provider.ProviderError({info:"Groq does not support embedding models yet",cause:new Error("Groq does not support embedding models yet")})}};_.baseUrl="https://api.groq.com/openai/v1";
7
+ var a={"gemma2-9b-it":{modelName:"gemma2-9b-it",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.2,outputPricePerMillion:.2}}}]},"llama-3.1-8b-instant":{modelName:"llama-3.1-8b-instant",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.05,outputPricePerMillion:.08}}}]},"llama-3.2-11b-vision-preview":{modelName:"llama-3.2-11b-vision-preview",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.18,outputPricePerMillion:.18}}}]},"llama-3.2-1b-preview":{modelName:"llama-3.2-1b-preview",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.04,outputPricePerMillion:.04}}}]},"llama-3.2-3b-preview":{modelName:"llama-3.2-3b-preview",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.06,outputPricePerMillion:.06}}}]},"llama-3.2-90b-vision-preview":{modelName:"llama-3.2-90b-vision-preview",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.7,outputPricePerMillion:.8}}}]},"llama3-70b-8192":{modelName:"llama3-70b-8192",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.59,outputPricePerMillion:.79}}}]},"llama3-8b-8192":{modelName:"llama3-8b-8192",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.05,outputPricePerMillion:.08}}}]},"llama-guard-3-8b":{modelName:"llama-guard-3-8b",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.2,outputPricePerMillion:.2}}}]}};var n=zod.z.object({modelName:zod.z.string().min(1),apiKey:zod.z.string().min(1)}),t=class extends openai.BaseChatModel{constructor(i,c){let r=n.parse(c),p=h.baseUrl;super(i,{modelName:r.modelName,apiKey:r.apiKey,baseUrl:p,completeChatUrl:`${p}/chat/completions`,streamChatUrl:`${p}/chat/completions`});this.version="v1";this.modelSchema=i,this.modelName=r.modelName,this.groqApiKey=r.apiKey;}transformMessages(i){let c=i.some(l=>l.role==="system"),r=i.some(l=>l.content.some(_=>_.modality==="image"));if(c&&r)throw new provider.InvalidMessagesError({info:`Invalid message content for model : '${this.modelName}'`,cause:new Error("Prompting with images is incompatible with system messages`)")});let p=super.transformMessages(i);return p.messages.forEach(l=>{l.role==="system"?typeof l.content!="string"&&(l.content=l.content.map(_=>_.text).join(`
8
+ `)):l.role==="assistant"&&l.content&&typeof l.content!="string"&&(l.content=l.content.map(_=>_.text).join(`
9
+ `));}),p}getModelPricing(){if(!(this.modelName in a))throw new provider.ModelResponseError({info:`Invalid model pricing for model : '${this.modelName}'`,cause:new Error(`No pricing configuration found for model "${this.modelName}"`)});return a[this.modelName]}};var v=provider.RangeConfigItem({param:"temperature",title:provider.CHAT_CONFIG.TEMPERATURE.title,description:provider.CHAT_CONFIG.TEMPERATURE.description,min:0,max:2,step:.01,default:1}),N=s=>provider.RangeConfigItem({param:"max_tokens",title:provider.CHAT_CONFIG.MAX_TOKENS.title,description:provider.CHAT_CONFIG.MAX_TOKENS.description,min:0,max:s,step:1,default:0}),q=provider.MultiStringConfigItem({param:"stop",title:provider.CHAT_CONFIG.STOP(4).title,description:provider.CHAT_CONFIG.STOP(4).description,max:4}),w=provider.RangeConfigItem({param:"top_p",title:provider.CHAT_CONFIG.TOP_P.title,description:provider.CHAT_CONFIG.TOP_P.description,min:0,max:1,step:.01,default:1}),z=provider.RangeConfigItem({param:"frequency_penalty",title:provider.CHAT_CONFIG.FREQUENCY_PENALTY.title,description:provider.CHAT_CONFIG.FREQUENCY_PENALTY.description,min:-2,max:2,step:.01,default:0}),B=provider.RangeConfigItem({param:"presence_penalty",title:provider.CHAT_CONFIG.PRESENCE_PENALTY.title,description:provider.CHAT_CONFIG.PRESENCE_PENALTY.description,min:-2,max:2,step:.01,default:0}),D=provider.RangeConfigItem({param:"seed",title:provider.CHAT_CONFIG.SEED.title,description:provider.CHAT_CONFIG.SEED.description,min:0,max:1e6,step:1,default:0}),V=provider.SelectStringConfigItem({param:"response_format",title:provider.CHAT_CONFIG.RESPONSE_FORMAT.title,description:provider.CHAT_CONFIG.RESPONSE_FORMAT.description,default:"text",choices:["text","json_object"]}),F=provider.SelectStringConfigItem({param:"tool_choice",title:"Tool choice",description:"Controls which (if any) tool is called by the model. 'none' means the model will not call a function. 'auto' means the model can pick between generating a message or calling a tool.",default:"auto",choices:["auto","required","none"]});var W=s=>zod.z.object({temperature:v.schema,maxTokens:N(s).schema,stop:q.schema,topP:w.schema,frequencyPenalty:z.schema,presencePenalty:B.schema,seed:D.schema.transform(e=>e===0?void 0:e),responseFormat:V.schema,toolChoice:F.schema}),ee=s=>({temperature:v.def,maxTokens:N(s).def,stop:q.def,topP:w.def,frequencyPenalty:z.def,presencePenalty:B.def,seed:D.def,responseFormat:V.def,toolChoice:F.def});var o={base:s=>({def:ee(s),schema:W(s)})};var u="gemma2-9b-it",ge="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.",U=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:u,description:ge,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema},price:a[u]}),oe=n,M=class extends t{constructor(e){super(U,e);}};var f="llama-3.1-8b-instant",Ie="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",j=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:f,description:Ie,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[f]}),ae=n,b=class extends t{constructor(e){super(j,e);}};var y="llama-3.2-11b-vision-preview",ve="The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The models outperform many of the available open source and closed multimodal models on common industry benchmarks.",K=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelModalitiesEnum).parse({name:y,description:ve,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[y]}),te=n,T=class extends t{constructor(e){super(K,e);}};var O="llama-3.2-1b-preview",De="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",$=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:O,description:De,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[O]}),se=n,g=class extends t{constructor(e){super($,e);}};var C="llama-3.2-3b-preview",$e="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",Y=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:C,description:$e,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[C]}),ie=n,L=class extends t{constructor(e){super(Y,e);}};var x="llama-3.2-90b-vision-preview",Je="The Llama 3.2-90B Vision instruction-tuned models are optimized for advanced visual recognition, complex image reasoning, detailed captioning, and answering intricate questions about images. These models achieve state-of-the-art results on multiple industry benchmarks for multimodal tasks.",Q=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelModalitiesEnum).parse({name:x,description:Je,maxInputTokens:131072,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[x]}),ne=n,S=class extends t{constructor(e){super(Q,e);}};var P="llama3-70b-8192",so="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.",X=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:P,description:so,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema},price:a[P]}),me=n,I=class extends t{constructor(e){super(X,e);}};var k="llama3-8b-8192",po="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.",Z=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:k,description:po,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema},price:a[k]}),le=n,E=class extends t{constructor(e){super(Z,e);}};var R="llama-guard-3-8b",fo="Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.",H=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:R,description:fo,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema},price:a[R]}),re=n,A=class extends t{constructor(e){super(H,e);}};var bo="groq",h=class{constructor(){this.version="v1";this.name=bo;this.chatModelFactories={[u]:{model:M,modelOptions:oe,modelSchema:U},[R]:{model:A,modelOptions:re,modelSchema:H},[k]:{model:E,modelOptions:le,modelSchema:Z},[P]:{model:I,modelOptions:me,modelSchema:X},[f]:{model:b,modelOptions:ae,modelSchema:j},[y]:{model:T,modelOptions:te,modelSchema:K},[x]:{model:S,modelOptions:ne,modelSchema:Q},[C]:{model:L,modelOptions:ie,modelSchema:Y},[O]:{model:g,modelOptions:se,modelSchema:$}};this.embeddingModelFactories={};}chatModelLiterals(){return Object.keys(this.chatModelFactories)}chatModelSchemas(){return Object.keys(this.chatModelFactories).reduce((e,i)=>(e[i]=this.chatModelFactories[i].modelSchema,e),{})}chatModel(e){let i=e.modelName;if(!(i in this.chatModelFactories))throw new provider.ProviderError({info:`Groq chat model: ${i} not found`,cause:new Error(`Groq chat model: ${i} not found, available chat models:
10
+ ${this.chatModelLiterals().join(", ")}`)});let c=this.chatModelFactories[i].model,r=this.chatModelFactories[i].modelOptions.parse(e);return new c(r)}embeddingModelLiterals(){return Object.keys(this.embeddingModelFactories)}embeddingModelSchemas(){return Object.keys(this.embeddingModelFactories).reduce((e,i)=>(e[i]=this.embeddingModelFactories[i].modelSchema,e),{})}embeddingModel(e){throw new provider.ProviderError({info:"Groq does not support embedding models yet",cause:new Error("Groq does not support embedding models yet")})}};h.baseUrl="https://api.groq.com/openai/v1";
11
11
 
12
- exports.BaseChatModelGroq = a;
13
- exports.BaseChatModelOptions = s;
14
- exports.Gemma2_9b_IT = h;
15
- exports.Gemma2_9b_ITLiteral = q;
16
- exports.Gemma2_9b_ITOptions = ee;
17
- exports.Gemma2_9b_ITSchema = P;
18
- exports.Groq = _;
19
- exports.LlamaGuard_3_8b = C;
20
- exports.LlamaGuard_3_8bLiteral = X;
21
- exports.LlamaGuard_3_8bOptions = le;
22
- exports.LlamaGuard_3_8bSchema = Z;
23
- exports.Llama_3_1_8b = f;
24
- exports.Llama_3_1_8bLiteral = z;
25
- exports.Llama_3_1_8bSchema = B;
26
- exports.Llama_3_1_8b_Options = oe;
27
- exports.Llama_3_2_11b_Vision = M;
28
- exports.Llama_3_2_11b_VisionLiteral = v;
29
- exports.Llama_3_2_11b_VisionOptions = ae;
30
- exports.Llama_3_2_11b_VisionSchema = V;
31
- exports.Llama_3_2_1b = u;
32
- exports.Llama_3_2_1bLiteral = w;
33
- exports.Llama_3_2_1bSchema = N;
34
- exports.Llama_3_2_1b_Options = te;
35
- exports.Llama_3_2_3b = b;
36
- exports.Llama_3_2_3bLiteral = F;
37
- exports.Llama_3_2_3bSchema = D;
38
- exports.Llama_3_2_3b_Options = se;
39
- exports.Llama_3_2_90b_Vision = y;
40
- exports.Llama_3_2_90b_VisionLiteral = j;
12
+ exports.BaseChatModelGroq = t;
13
+ exports.BaseChatModelOptions = n;
14
+ exports.Gemma2_9b_IT = M;
15
+ exports.Gemma2_9b_ITLiteral = u;
16
+ exports.Gemma2_9b_ITOptions = oe;
17
+ exports.Gemma2_9b_ITSchema = U;
18
+ exports.Groq = h;
19
+ exports.LlamaGuard_3_8b = A;
20
+ exports.LlamaGuard_3_8bLiteral = R;
21
+ exports.LlamaGuard_3_8bOptions = re;
22
+ exports.LlamaGuard_3_8bSchema = H;
23
+ exports.Llama_3_1_8b = b;
24
+ exports.Llama_3_1_8bLiteral = f;
25
+ exports.Llama_3_1_8bSchema = j;
26
+ exports.Llama_3_1_8b_Options = ae;
27
+ exports.Llama_3_2_11b_Vision = T;
28
+ exports.Llama_3_2_11b_VisionLiteral = y;
29
+ exports.Llama_3_2_11b_VisionOptions = te;
30
+ exports.Llama_3_2_11b_VisionSchema = K;
31
+ exports.Llama_3_2_1b = g;
32
+ exports.Llama_3_2_1bLiteral = O;
33
+ exports.Llama_3_2_1bSchema = $;
34
+ exports.Llama_3_2_1b_Options = se;
35
+ exports.Llama_3_2_3b = L;
36
+ exports.Llama_3_2_3bLiteral = C;
37
+ exports.Llama_3_2_3bSchema = Y;
38
+ exports.Llama_3_2_3b_Options = ie;
39
+ exports.Llama_3_2_90b_Vision = S;
40
+ exports.Llama_3_2_90b_VisionLiteral = x;
41
41
  exports.Llama_3_2_90b_VisionOptions = ne;
42
- exports.Llama_3_2_90b_VisionSchema = U;
43
- exports.Llama_3_70b = O;
44
- exports.Llama_3_70bLiteral = K;
45
- exports.Llama_3_70bOptions = ie;
46
- exports.Llama_3_70bSchema = Y;
47
- exports.Llama_3_8b = T;
48
- exports.Llama_3_8bLiteral = $;
49
- exports.Llama_3_8bOptions = me;
50
- exports.Llama_3_8bSchema = Q;
42
+ exports.Llama_3_2_90b_VisionSchema = Q;
43
+ exports.Llama_3_70b = I;
44
+ exports.Llama_3_70bLiteral = P;
45
+ exports.Llama_3_70bOptions = me;
46
+ exports.Llama_3_70bSchema = X;
47
+ exports.Llama_3_8b = E;
48
+ exports.Llama_3_8bLiteral = k;
49
+ exports.Llama_3_8bOptions = le;
50
+ exports.Llama_3_8bSchema = Z;
51
51
  //# sourceMappingURL=index.js.map
52
52
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/models/chat-models/base-chat-model.groq.ts","../src/configs/chat-model/common.config.chat-model.groq.ts","../src/configs/chat-model/base.config.chat-model.groq.ts","../src/configs/configs.groq.ts","../src/models/chat-models/gemma2-9b-it.groq.ts","../src/models/chat-models/llama-3-1-8b.groq.ts","../src/models/chat-models/llama-3-2-11b-vision.groq.ts","../src/models/chat-models/llama-3-2-1b.groq.ts","../src/models/chat-models/llama-3-2-3b.groq.ts","../src/models/chat-models/llama-3-2-90b-vision.groq.ts","../src/models/chat-models/llama-3-70b.groq.ts","../src/models/chat-models/llama-3-8b.groq.ts","../src/models/chat-models/llama-guard-3-8b.groq.ts","../src/provider/provider.groq.ts"],"names":["BaseChatModelOptions","z","BaseChatModelGroq","BaseChatModel","modelSchema","options","parsedOptions","baseUrl","Groq","messages","hasSystemRole","msg","hasImageModality","content","InvalidMessagesError","transformedMessages","message","temperature","RangeConfigItem","CHAT_CONFIG","maxTokens","maxOutputTokens","stop","MultiStringConfigItem","topP","frequencyPenalty","presencePenalty","seed","responseFormat","SelectStringConfigItem","toolChoice","ChatModelBaseConfigSchema","value","ChatModelBaseConfigDef","GroqChatModelConfigs","Gemma2_9b_ITLiteral","Gemma2_9b_ITDescription","Gemma2_9b_ITSchema","ChatModelSchema","OpenAIChatModelRoles","OpenAIChatModelTextToolModalitiesEnum","OpenAIChatModelRolesMap","OpenAIChatModelTextToolModalities","Gemma2_9b_ITOptions","Gemma2_9b_IT","Llama_3_1_8bLiteral","Llama_3_1_8bDescription","Llama_3_1_8bSchema","Llama_3_1_8b_Options","Llama_3_1_8b","Llama_3_2_11b_VisionLiteral","Llama_3_2_11b_VisionDescription","Llama_3_2_11b_VisionSchema","OpenAIChatModelModalitiesEnum","OpenAIChatModelModalities","Llama_3_2_11b_VisionOptions","Llama_3_2_11b_Vision","Llama_3_2_1bLiteral","Llama_3_2_1bDescription","Llama_3_2_1bSchema","Llama_3_2_1b_Options","Llama_3_2_1b","Llama_3_2_3bLiteral","Llama_3_2_3bDescription","Llama_3_2_3bSchema","Llama_3_2_3b_Options","Llama_3_2_3b","Llama_3_2_90b_VisionLiteral","Llama_3_2_90b_VisionDescription","Llama_3_2_90b_VisionSchema","Llama_3_2_90b_VisionOptions","Llama_3_2_90b_Vision","Llama_3_70bLiteral","Llama_3_70bDescription","Llama_3_70bSchema","Llama_3_70bOptions","Llama_3_70b","Llama_3_8bLiteral","Llama_3_8bDescription","Llama_3_8bSchema","Llama_3_8bOptions","Llama_3_8b","LlamaGuard_3_8bLiteral","LlamaGuard_3_8bDescription","LlamaGuard_3_8bSchema","LlamaGuard_3_8bOptions","LlamaGuard_3_8b","ProviderLiteral","acc","key","modelName","ProviderError","model"],"mappings":";;;;;;IAQMA,CAAuBC,CAAAA,KAAAA,CAAE,MAAO,CAAA,CACpC,UAAWA,KAAE,CAAA,MAAA,EAAS,CAAA,GAAA,CAAI,CAAC,CAC3B,CAAA,MAAA,CAAQA,KAAE,CAAA,MAAA,GAAS,GAAI,CAAA,CAAC,CAC1B,CAAC,CAAA,CAGKC,EAAN,cAAgCC,oBAAc,CAO5C,WAAA,CAAYC,EAAkCC,CAAmC,CAAA,CAC/E,IAAMC,CAAAA,CAAgBN,EAAqB,KAAMK,CAAAA,CAAO,CAClDE,CAAAA,CAAAA,CAAUC,EAAK,OACrB,CAAA,KAAA,CAAMJ,CAAa,CAAA,CACjB,UAAWE,CAAc,CAAA,SAAA,CACzB,MAAQA,CAAAA,CAAAA,CAAc,OACtB,OAASC,CAAAA,CAAAA,CACT,eAAiB,CAAA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kBAAA,CAAmBF,CAAS,CAAE,CAAA,KAAA,CAC3CpF,EAAgB,IAAK,CAAA,kBAAA,CAAmBoF,CAAS,CAAA,CAAE,aAAa,KAAMrF,CAAAA,CAAO,EACnF,OAAO,IAAIuF,EAAMtF,CAAa,CAChC,CAEA,sBAAA,EAAmC,CACjC,OAAO,MAAA,CAAO,KAAK,IAAK,CAAA,uBAAuB,CACjD,CAEA,qBAAA,EAAkE,CAChE,OAAO,OAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CAAE,CAAA,MAAA,CAC/C,CAACkF,CAAKC,CAAAA,CAAAA,IACJD,CAAIC,CAAAA,CAAG,EAAI,IAAK,CAAA,uBAAA,CAAwBA,CAAG,CAAE,CAAA,WAAA,CACtCD,GAET,EACF,CACF,CAGA,eAAenF,CAA8B,CAAA,CAC3C,MAAM,IAAIsF,sBAAAA,CAAc,CACtB,IAAM,CAAA,4CAAA,CACN,MAAO,IAAI,KAAA,CAAM,4CAA4C,CAC/D,CAAC,CACH,CACF,EAvHMnF,EAGY,OAAU,CAAA,gCAAA","file":"index.js","sourcesContent":["import { z } from \"zod\";\n\nimport { BaseChatModel, OpenAIChatRequestMessageType } from \"@adaline/openai\";\nimport { ChatModelSchemaType, InvalidMessagesError, ParamsType } from \"@adaline/provider\";\nimport { MessageType } from \"@adaline/types\";\n\nimport { Groq } from \"../../provider\";\n\nconst BaseChatModelOptions = z.object({\n modelName: z.string().min(1),\n apiKey: z.string().min(1),\n});\ntype BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;\n\nclass BaseChatModelGroq extends BaseChatModel {\n readonly version = \"v1\" as const;\n modelSchema: ChatModelSchemaType;\n readonly modelName: string;\n\n private readonly groqApiKey: string;\n\n constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType) {\n const parsedOptions = BaseChatModelOptions.parse(options);\n const baseUrl = Groq.baseUrl;\n super(modelSchema, {\n modelName: parsedOptions.modelName,\n apiKey: parsedOptions.apiKey,\n baseUrl: baseUrl,\n completeChatUrl: `${baseUrl}/chat/completions`,\n streamChatUrl: `${baseUrl}/chat/completions`,\n });\n this.modelSchema = modelSchema;\n this.modelName = parsedOptions.modelName;\n this.groqApiKey = parsedOptions.apiKey;\n }\n\n transformMessages(messages: MessageType[]): ParamsType {\n const hasSystemRole = messages.some((msg) => msg.role === \"system\");\n const hasImageModality = messages.some((msg) => msg.content.some((content: any) => content.modality === \"image\"));\n\n if (hasSystemRole && hasImageModality) {\n throw new InvalidMessagesError({\n info: `Invalid message content for model : '${this.modelName}'`,\n cause: new Error(\"Prompting with images is incompatible with system messages`)\"),\n });\n }\n\n const transformedMessages = super.transformMessages(messages) as { messages: OpenAIChatRequestMessageType[] };\n\n // Groq expects the content to be a string for system and assistant messages\n // OpenAI transformer takes care of validating role and modality\n transformedMessages.messages.forEach((message) => {\n if (message.role === \"system\") {\n if (typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n } else if (message.role === \"assistant\") {\n if (message.content && typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n }\n });\n\n return transformedMessages;\n }\n}\n\nexport { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType };\n","import { CHAT_CONFIG, MultiStringConfigItem, RangeConfigItem, SelectStringConfigItem } from \"@adaline/provider\";\n\nconst temperature = RangeConfigItem({\n param: \"temperature\",\n title: CHAT_CONFIG.TEMPERATURE.title,\n description: CHAT_CONFIG.TEMPERATURE.description,\n min: 0,\n max: 2,\n step: 0.01,\n default: 1,\n});\n\nconst maxTokens = (maxOutputTokens: number) =>\n RangeConfigItem({\n param: \"max_tokens\",\n title: CHAT_CONFIG.MAX_TOKENS.title,\n description: CHAT_CONFIG.MAX_TOKENS.description,\n min: 0,\n max: maxOutputTokens,\n step: 1,\n default: 0,\n });\n\nconst stop = MultiStringConfigItem({\n param: \"stop\",\n title: CHAT_CONFIG.STOP(4).title,\n description: CHAT_CONFIG.STOP(4).description,\n max: 4,\n});\n\nconst topP = RangeConfigItem({\n param: \"top_p\",\n title: CHAT_CONFIG.TOP_P.title,\n description: CHAT_CONFIG.TOP_P.description,\n min: 0,\n max: 1,\n step: 0.01,\n default: 1,\n});\n\nconst frequencyPenalty = RangeConfigItem({\n param: \"frequency_penalty\",\n title: CHAT_CONFIG.FREQUENCY_PENALTY.title,\n description: CHAT_CONFIG.FREQUENCY_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst presencePenalty = RangeConfigItem({\n param: \"presence_penalty\",\n title: CHAT_CONFIG.PRESENCE_PENALTY.title,\n description: CHAT_CONFIG.PRESENCE_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst seed = RangeConfigItem({\n param: \"seed\",\n title: CHAT_CONFIG.SEED.title,\n description: CHAT_CONFIG.SEED.description,\n min: 0,\n max: 1000000,\n step: 1,\n default: 0,\n});\n\nconst responseFormat = SelectStringConfigItem({\n param: \"response_format\",\n title: CHAT_CONFIG.RESPONSE_FORMAT.title,\n description: CHAT_CONFIG.RESPONSE_FORMAT.description,\n default: \"text\",\n choices: [\"text\", \"json_object\"],\n});\n\nconst toolChoice = SelectStringConfigItem({\n param: \"tool_choice\",\n title: \"Tool choice\",\n description:\n \"Controls which (if any) tool is called by the model. \\\n 'none' means the model will not call a function. \\\n 'auto' means the model can pick between generating a message or calling a tool.\",\n default: \"auto\",\n choices: [\"auto\", \"required\", \"none\"],\n});\n\nexport { frequencyPenalty, maxTokens, presencePenalty, seed, stop, temperature, toolChoice, topP, responseFormat };\n","import { z } from \"zod\";\n\nimport {\n frequencyPenalty,\n maxTokens,\n presencePenalty,\n responseFormat,\n seed,\n stop,\n temperature,\n toolChoice,\n topP,\n} from \"./common.config.chat-model.groq\";\n\nconst ChatModelBaseConfigSchema = (maxOutputTokens: number) =>\n z.object({\n temperature: temperature.schema,\n maxTokens: maxTokens(maxOutputTokens).schema,\n stop: stop.schema,\n topP: topP.schema,\n frequencyPenalty: frequencyPenalty.schema,\n presencePenalty: presencePenalty.schema,\n seed: seed.schema.transform((value) => (value === 0 ? undefined : value)),\n responseFormat: responseFormat.schema,\n toolChoice: toolChoice.schema,\n });\n\nconst ChatModelBaseConfigDef = (maxOutputTokens: number) =>\n ({\n temperature: temperature.def,\n maxTokens: maxTokens(maxOutputTokens).def,\n stop: stop.def,\n topP: topP.def,\n frequencyPenalty: frequencyPenalty.def,\n presencePenalty: presencePenalty.def,\n seed: seed.def,\n responseFormat: responseFormat.def,\n toolChoice: toolChoice.def,\n }) as const;\n\nexport { ChatModelBaseConfigDef, ChatModelBaseConfigSchema };\n","import { ChatModelBaseConfigDef, ChatModelBaseConfigSchema } from \"./chat-model\";\n\nconst GroqChatModelConfigs = {\n base: (maxOutputTokens: number) => ({\n def: ChatModelBaseConfigDef(maxOutputTokens),\n schema: ChatModelBaseConfigSchema(maxOutputTokens),\n }),\n} as const;\n\nexport { GroqChatModelConfigs };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma2_9b_ITLiteral = \"gemma2-9b-it\" as const;\n// https://huggingface.co/google/gemma-2-9b-it\nconst Gemma2_9b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma2_9b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma2_9b_ITLiteral,\n description: Gemma2_9b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma2_9b_ITOptions = BaseChatModelOptions;\ntype Gemma2_9b_ITOptionsType = z.infer<typeof Gemma2_9b_ITOptions>;\n\nclass Gemma2_9b_IT extends BaseChatModelGroq {\n constructor(options: Gemma2_9b_ITOptionsType) {\n super(Gemma2_9b_ITSchema, options);\n }\n}\n\nexport { Gemma2_9b_IT, Gemma2_9b_ITOptions, Gemma2_9b_ITSchema, Gemma2_9b_ITLiteral, type Gemma2_9b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_8bLiteral = \"llama-3.1-8b-instant\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_8bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_8bLiteral,\n description: Llama_3_1_8bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_8b_Options = BaseChatModelOptions;\ntype Llama_3_1_8b_OptionsType = z.infer<typeof Llama_3_1_8b_Options>;\n\nclass Llama_3_1_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_8b_OptionsType) {\n super(Llama_3_1_8bSchema, options);\n }\n}\n\nexport { Llama_3_1_8b, Llama_3_1_8b_Options, Llama_3_1_8bSchema, Llama_3_1_8bLiteral, type Llama_3_1_8b_OptionsType };\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_11b_VisionLiteral = \"llama-3.2-11b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-11B-Vision\nconst Llama_3_2_11b_VisionDescription =\n \"The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, \\\n and answering general questions about an image. \\\n The models outperform many of the available open source and closed multimodal models on common industry benchmarks.\";\n\nconst Llama_3_2_11b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_11b_VisionLiteral,\n description: Llama_3_2_11b_VisionDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_11b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_11b_VisionOptionsType = z.infer<typeof Llama_3_2_11b_VisionOptions>;\n\nclass Llama_3_2_11b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_11b_VisionOptionsType) {\n super(Llama_3_2_11b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n Llama_3_2_11b_VisionLiteral,\n type Llama_3_2_11b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_1bLiteral = \"llama-3.2-1b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-1B\nconst Llama_3_2_1bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_1bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_1bLiteral,\n description: Llama_3_2_1bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_1b_Options = BaseChatModelOptions;\ntype Llama_3_2_1b_OptionsType = z.infer<typeof Llama_3_2_1b_Options>;\n\nclass Llama_3_2_1b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_1b_OptionsType) {\n super(Llama_3_2_1bSchema, options);\n }\n}\n\nexport { Llama_3_2_1b, Llama_3_2_1b_Options, Llama_3_2_1bSchema, Llama_3_2_1bLiteral, type Llama_3_2_1b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_3bLiteral = \"llama-3.2-3b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-3B\nconst Llama_3_2_3bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_3bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_3bLiteral,\n description: Llama_3_2_3bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_3b_Options = BaseChatModelOptions;\ntype Llama_3_2_3b_OptionsType = z.infer<typeof Llama_3_2_3b_Options>;\n\nclass Llama_3_2_3b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_3b_OptionsType) {\n super(Llama_3_2_3bSchema, options);\n }\n}\n\nexport { Llama_3_2_3b, Llama_3_2_3b_Options, Llama_3_2_3bSchema, Llama_3_2_3bLiteral, type Llama_3_2_3b_OptionsType };\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_90b_VisionLiteral = \"llama-3.2-90b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-90B-Vision\nconst Llama_3_2_90b_VisionDescription =\n \"The Llama 3.2-90B Vision instruction-tuned models are optimized for advanced visual recognition, \\\n complex image reasoning, detailed captioning, and answering intricate questions about images. \\\n These models achieve state-of-the-art results on multiple industry benchmarks for multimodal tasks.\";\n\nconst Llama_3_2_90b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_90b_VisionLiteral,\n description: Llama_3_2_90b_VisionDescription,\n maxInputTokens: 131072,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_90b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_90b_VisionOptionsType = z.infer<typeof Llama_3_2_90b_VisionOptions>;\n\nclass Llama_3_2_90b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_90b_VisionOptionsType) {\n super(Llama_3_2_90b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_90b_Vision,\n Llama_3_2_90b_VisionLiteral,\n Llama_3_2_90b_VisionOptions,\n Llama_3_2_90b_VisionSchema,\n type Llama_3_2_90b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70bLiteral = \"llama3-70b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct\nconst Llama_3_70bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70bLiteral,\n description: Llama_3_70bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70bOptions = BaseChatModelOptions;\ntype Llama_3_70bOptionsType = z.infer<typeof Llama_3_70bOptions>;\n\nclass Llama_3_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_70bOptionsType) {\n super(Llama_3_70bSchema, options);\n }\n}\n\nexport { Llama_3_70b, Llama_3_70bOptions, Llama_3_70bSchema, Llama_3_70bLiteral, type Llama_3_70bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8bLiteral = \"llama3-8b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct\nconst Llama_3_8bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8bLiteral,\n description: Llama_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8bOptions = BaseChatModelOptions;\ntype Llama_3_8bOptionsType = z.infer<typeof Llama_3_8bOptions>;\n\nclass Llama_3_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_8bOptionsType) {\n super(Llama_3_8bSchema, options);\n }\n}\n\nexport { Llama_3_8b, Llama_3_8bOptions, Llama_3_8bSchema, Llama_3_8bLiteral, type Llama_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst LlamaGuard_3_8bLiteral = \"llama-guard-3-8b\" as const;\n// https://huggingface.co/meta-llama/Llama-Guard-3-8B\nconst LlamaGuard_3_8bDescription = \"Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.\";\n\nconst LlamaGuard_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: LlamaGuard_3_8bLiteral,\n description: LlamaGuard_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst LlamaGuard_3_8bOptions = BaseChatModelOptions;\ntype LlamaGuard_3_8bOptionsType = z.infer<typeof LlamaGuard_3_8bOptions>;\n\nclass LlamaGuard_3_8b extends BaseChatModelGroq {\n constructor(options: LlamaGuard_3_8bOptionsType) {\n super(LlamaGuard_3_8bSchema, options);\n }\n}\n\nexport { LlamaGuard_3_8b, LlamaGuard_3_8bOptions, LlamaGuard_3_8bSchema, LlamaGuard_3_8bLiteral, type LlamaGuard_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport { ChatModelSchemaType, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderError, ProviderV1 } from \"@adaline/provider\";\n\nimport * as Models from \"../models\";\n\nconst ProviderLiteral = \"groq\";\nclass Groq<C extends Models.BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {\n readonly version = \"v1\" as const;\n readonly name = ProviderLiteral;\n static readonly baseUrl = \"https://api.groq.com/openai/v1\";\n\n private readonly chatModelFactories: Record<\n string,\n {\n model: { new (options: any): ChatModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: ChatModelSchemaType;\n }\n > = {\n [Models.Gemma2_9b_ITLiteral]: {\n model: Models.Gemma2_9b_IT,\n modelOptions: Models.Gemma2_9b_ITOptions,\n modelSchema: Models.Gemma2_9b_ITSchema,\n },\n [Models.LlamaGuard_3_8bLiteral]: {\n model: Models.LlamaGuard_3_8b,\n modelOptions: Models.LlamaGuard_3_8bOptions,\n modelSchema: Models.LlamaGuard_3_8bSchema,\n },\n [Models.Llama_3_8bLiteral]: {\n model: Models.Llama_3_8b,\n modelOptions: Models.Llama_3_8bOptions,\n modelSchema: Models.Llama_3_8bSchema,\n },\n [Models.Llama_3_70bLiteral]: {\n model: Models.Llama_3_70b,\n modelOptions: Models.Llama_3_70bOptions,\n modelSchema: Models.Llama_3_70bSchema,\n },\n [Models.Llama_3_1_8bLiteral]: {\n model: Models.Llama_3_1_8b,\n modelOptions: Models.Llama_3_1_8b_Options,\n modelSchema: Models.Llama_3_1_8bSchema,\n },\n [Models.Llama_3_2_11b_VisionLiteral]: {\n model: Models.Llama_3_2_11b_Vision,\n modelOptions: Models.Llama_3_2_11b_VisionOptions,\n modelSchema: Models.Llama_3_2_11b_VisionSchema,\n },\n [Models.Llama_3_2_90b_VisionLiteral]: {\n model: Models.Llama_3_2_90b_Vision,\n modelOptions: Models.Llama_3_2_90b_VisionOptions,\n modelSchema: Models.Llama_3_2_90b_VisionSchema,\n },\n [Models.Llama_3_2_3bLiteral]: {\n model: Models.Llama_3_2_3b,\n modelOptions: Models.Llama_3_2_3b_Options,\n modelSchema: Models.Llama_3_2_3bSchema,\n },\n [Models.Llama_3_2_1bLiteral]: {\n model: Models.Llama_3_2_1b,\n modelOptions: Models.Llama_3_2_1b_Options,\n modelSchema: Models.Llama_3_2_1bSchema,\n },\n };\n\n private readonly embeddingModelFactories: Record<\n string,\n {\n model: { new (options: any): EmbeddingModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: EmbeddingModelSchemaType;\n }\n > = {};\n\n chatModelLiterals(): string[] {\n return Object.keys(this.chatModelFactories);\n }\n\n chatModelSchemas(): Record<string, ChatModelSchemaType> {\n return Object.keys(this.chatModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.chatModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, ChatModelSchemaType>\n );\n }\n\n chatModel(options: C): ChatModelV1 {\n const modelName = options.modelName;\n if (!(modelName in this.chatModelFactories)) {\n throw new ProviderError({\n info: `Groq chat model: ${modelName} not found`,\n cause: new Error(`Groq chat model: ${modelName} not found, available chat models: \n ${this.chatModelLiterals().join(\", \")}`),\n });\n }\n\n const model = this.chatModelFactories[modelName].model;\n const parsedOptions = this.chatModelFactories[modelName].modelOptions.parse(options);\n return new model(parsedOptions);\n }\n\n embeddingModelLiterals(): string[] {\n return Object.keys(this.embeddingModelFactories);\n }\n\n embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType> {\n return Object.keys(this.embeddingModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.embeddingModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, EmbeddingModelSchemaType>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n embeddingModel(options: E): EmbeddingModelV1 {\n throw new ProviderError({\n info: \"Groq does not support embedding models yet\",\n cause: new Error(\"Groq does not support embedding models yet\"),\n });\n }\n}\n\nexport { Groq };\n"]}
1
+ {"version":3,"sources":["../src/models/pricing.json","../src/models/chat-models/base-chat-model.groq.ts","../src/configs/chat-model/common.config.chat-model.groq.ts","../src/configs/chat-model/base.config.chat-model.groq.ts","../src/configs/configs.groq.ts","../src/models/chat-models/gemma2-9b-it.groq.ts","../src/models/chat-models/llama-3-1-8b.groq.ts","../src/models/chat-models/llama-3-2-11b-vision.groq.ts","../src/models/chat-models/llama-3-2-1b.groq.ts","../src/models/chat-models/llama-3-2-3b.groq.ts","../src/models/chat-models/llama-3-2-90b-vision.groq.ts","../src/models/chat-models/llama-3-70b.groq.ts","../src/models/chat-models/llama-3-8b.groq.ts","../src/models/chat-models/llama-guard-3-8b.groq.ts","../src/provider/provider.groq.ts"],"names":["pricing_default","BaseChatModelOptions","z","BaseChatModelGroq","BaseChatModel","modelSchema","options","parsedOptions","baseUrl","Groq","messages","hasSystemRole","msg","hasImageModality","content","InvalidMessagesError","transformedMessages","message","ModelResponseError","temperature","RangeConfigItem","CHAT_CONFIG","maxTokens","maxOutputTokens","stop","MultiStringConfigItem","topP","frequencyPenalty","presencePenalty","seed","responseFormat","SelectStringConfigItem","toolChoice","ChatModelBaseConfigSchema","value","ChatModelBaseConfigDef","GroqChatModelConfigs","Gemma2_9b_ITLiteral","Gemma2_9b_ITDescription","Gemma2_9b_ITSchema","ChatModelSchema","OpenAIChatModelRoles","OpenAIChatModelTextToolModalitiesEnum","OpenAIChatModelRolesMap","OpenAIChatModelTextToolModalities","Gemma2_9b_ITOptions","Gemma2_9b_IT","Llama_3_1_8bLiteral","Llama_3_1_8bDescription","Llama_3_1_8bSchema","Llama_3_1_8b_Options","Llama_3_1_8b","Llama_3_2_11b_VisionLiteral","Llama_3_2_11b_VisionDescription","Llama_3_2_11b_VisionSchema","OpenAIChatModelModalitiesEnum","OpenAIChatModelModalities","Llama_3_2_11b_VisionOptions","Llama_3_2_11b_Vision","Llama_3_2_1bLiteral","Llama_3_2_1bDescription","Llama_3_2_1bSchema","Llama_3_2_1b_Options","Llama_3_2_1b","Llama_3_2_3bLiteral","Llama_3_2_3bDescription","Llama_3_2_3bSchema","Llama_3_2_3b_Options","Llama_3_2_3b","Llama_3_2_90b_VisionLiteral","Llama_3_2_90b_VisionDescription","Llama_3_2_90b_VisionSchema","Llama_3_2_90b_VisionOptions","Llama_3_2_90b_Vision","Llama_3_70bLiteral","Llama_3_70bDescription","Llama_3_70bSchema","Llama_3_70bOptions","Llama_3_70b","Llama_3_8bLiteral","Llama_3_8bDescription","Llama_3_8bSchema","Llama_3_8bOptions","Llama_3_8b","LlamaGuard_3_8bLiteral","LlamaGuard_3_8bDescription","LlamaGuard_3_8bSchema","LlamaGuard_3_8bOptions","LlamaGuard_3_8b","ProviderLiteral","acc","key","modelName","ProviderError","model"],"mappings":";;;;;;AAAA,IAAAA,CAAAA,CAAA,CACE,cAAA,CAAgB,CACd,SAAA,CAAa,eACb,QAAY,CAAA,KAAA,CACZ,YAAe,CACb,CACE,UAAa,CACb,CAAA,SAAA,CAAa,KACb,MAAU,CAAA,CACR,KAAQ,CACN,oBAAA,CAAwB,GACxB,qBAAyB,CAAA,EAC3B,CACF,CACF,CACF,CACF,CAAA,CACA,sBAAwB,CAAA,CACtB,UAAa,sBACb,CAAA,QAAA,CAAY,MACZ,WAAe,CAAA,CACb,CACE,SAAa,CAAA,CAAA,CACb,UAAa,IACb,CAAA,MAAA,CAAU,CACR,IAAQ,CAAA,CACN,qBAAwB,GACxB,CAAA,qBAAA,CAAyB,GAC3B,CACF,CACF,CACF,CACF,CACA,CAAA,8BAAA,CAAgC,CAC9B,SAAa,CAAA,8BAAA,CACb,SAAY,KACZ,CAAA,WAAA,CAAe,CACb,CACE,SAAA,CAAa,CACb,CAAA,SAAA,CAAa,IACb,CAAA,MAAA,CAAU,CACR,IAAQ,CAAA,CACN,qBAAwB,GACxB,CAAA,qBAAA,CAAyB,GAC3B,CACF,CACF,CACF,CACF,CACA,CAAA,sBAAA,CAAwB,CACtB,SAAa,CAAA,sBAAA,CACb,SAAY,KACZ,CAAA,WAAA,CAAe,CACb,CACE,SAAA,CAAa,EACb,SAAa,CAAA,IAAA,CACb,OAAU,CACR,IAAA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A,IAAA,CAAK,uBAAuB,CAAE,CAAA,MAAA,CAC/C,CAACmF,CAAKC,CAAAA,CAAAA,IACJD,CAAIC,CAAAA,CAAG,EAAI,IAAK,CAAA,uBAAA,CAAwBA,CAAG,CAAE,CAAA,WAAA,CACtCD,GAET,EACF,CACF,CAGA,eAAepF,CAA8B,CAAA,CAC3C,MAAM,IAAIuF,sBAAAA,CAAc,CACtB,IAAM,CAAA,4CAAA,CACN,MAAO,IAAI,KAAA,CAAM,4CAA4C,CAC/D,CAAC,CACH,CACF,EAvHMpF,EAGY,OAAU,CAAA,gCAAA","file":"index.js","sourcesContent":["{\n \"gemma2-9b-it\": {\n \"modelName\": \"gemma2-9b-it\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.2,\n \"outputPricePerMillion\": 0.2\n }\n }\n }\n ]\n },\n \"llama-3.1-8b-instant\": {\n \"modelName\": \"llama-3.1-8b-instant\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.05,\n \"outputPricePerMillion\": 0.08\n }\n }\n }\n ]\n },\n \"llama-3.2-11b-vision-preview\": {\n \"modelName\": \"llama-3.2-11b-vision-preview\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.18,\n \"outputPricePerMillion\": 0.18\n }\n }\n }\n ]\n },\n \"llama-3.2-1b-preview\": {\n \"modelName\": \"llama-3.2-1b-preview\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.04,\n \"outputPricePerMillion\": 0.04\n }\n }\n }\n ]\n },\n \"llama-3.2-3b-preview\": {\n \"modelName\": \"llama-3.2-3b-preview\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.06,\n \"outputPricePerMillion\": 0.06\n }\n }\n }\n ]\n },\n \"llama-3.2-90b-vision-preview\": {\n \"modelName\": \"llama-3.2-90b-vision-preview\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.7,\n \"outputPricePerMillion\": 0.8\n }\n }\n }\n ]\n },\n \"llama3-70b-8192\": {\n \"modelName\": \"llama3-70b-8192\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.59,\n \"outputPricePerMillion\": 0.79\n }\n }\n }\n ]\n },\n \"llama3-8b-8192\": {\n \"modelName\": \"llama3-8b-8192\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.05,\n \"outputPricePerMillion\": 0.08\n }\n }\n }\n ]\n },\n \"llama-guard-3-8b\": {\n \"modelName\": \"llama-guard-3-8b\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.2,\n \"outputPricePerMillion\": 0.2\n }\n }\n }\n ]\n }\n}\n","import { z } from \"zod\";\n\nimport { BaseChatModel, OpenAIChatRequestMessageType } from \"@adaline/openai\";\nimport { ChatModelSchemaType, InvalidMessagesError, ModelResponseError, ParamsType } from \"@adaline/provider\";\nimport { ChatModelPriceType, MessageType } from \"@adaline/types\";\n\nimport { Groq } from \"../../provider\";\nimport pricingData from \"../pricing.json\";\n\nconst BaseChatModelOptions = z.object({\n modelName: z.string().min(1),\n apiKey: z.string().min(1),\n});\ntype BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;\n\nclass BaseChatModelGroq extends BaseChatModel {\n readonly version = \"v1\" as const;\n modelSchema: ChatModelSchemaType;\n readonly modelName: string;\n\n private readonly groqApiKey: string;\n\n constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType) {\n const parsedOptions = BaseChatModelOptions.parse(options);\n const baseUrl = Groq.baseUrl;\n super(modelSchema, {\n modelName: parsedOptions.modelName,\n apiKey: parsedOptions.apiKey,\n baseUrl: baseUrl,\n completeChatUrl: `${baseUrl}/chat/completions`,\n streamChatUrl: `${baseUrl}/chat/completions`,\n });\n this.modelSchema = modelSchema;\n this.modelName = parsedOptions.modelName;\n this.groqApiKey = parsedOptions.apiKey;\n }\n\n transformMessages(messages: MessageType[]): ParamsType {\n const hasSystemRole = messages.some((msg) => msg.role === \"system\");\n const hasImageModality = messages.some((msg) => msg.content.some((content: any) => content.modality === \"image\"));\n\n if (hasSystemRole && hasImageModality) {\n throw new InvalidMessagesError({\n info: `Invalid message content for model : '${this.modelName}'`,\n cause: new Error(\"Prompting with images is incompatible with system messages`)\"),\n });\n }\n\n const transformedMessages = super.transformMessages(messages) as { messages: OpenAIChatRequestMessageType[] };\n\n // Groq expects the content to be a string for system and assistant messages\n // OpenAI transformer takes care of validating role and modality\n transformedMessages.messages.forEach((message) => {\n if (message.role === \"system\") {\n if (typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n } else if (message.role === \"assistant\") {\n if (message.content && typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n }\n });\n\n return transformedMessages;\n }\n getModelPricing(): ChatModelPriceType {\n // Check if the modelName exists in pricingData before accessing it\n if (!(this.modelName in pricingData)) {\n throw new ModelResponseError({\n info: `Invalid model pricing for model : '${this.modelName}'`,\n cause: new Error(`No pricing configuration found for model \"${this.modelName}\"`),\n });\n }\n\n const entry = pricingData[this.modelName as keyof typeof pricingData];\n return entry as ChatModelPriceType;\n }\n}\n\nexport { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType };\n","import { CHAT_CONFIG, MultiStringConfigItem, RangeConfigItem, SelectStringConfigItem } from \"@adaline/provider\";\n\nconst temperature = RangeConfigItem({\n param: \"temperature\",\n title: CHAT_CONFIG.TEMPERATURE.title,\n description: CHAT_CONFIG.TEMPERATURE.description,\n min: 0,\n max: 2,\n step: 0.01,\n default: 1,\n});\n\nconst maxTokens = (maxOutputTokens: number) =>\n RangeConfigItem({\n param: \"max_tokens\",\n title: CHAT_CONFIG.MAX_TOKENS.title,\n description: CHAT_CONFIG.MAX_TOKENS.description,\n min: 0,\n max: maxOutputTokens,\n step: 1,\n default: 0,\n });\n\nconst stop = MultiStringConfigItem({\n param: \"stop\",\n title: CHAT_CONFIG.STOP(4).title,\n description: CHAT_CONFIG.STOP(4).description,\n max: 4,\n});\n\nconst topP = RangeConfigItem({\n param: \"top_p\",\n title: CHAT_CONFIG.TOP_P.title,\n description: CHAT_CONFIG.TOP_P.description,\n min: 0,\n max: 1,\n step: 0.01,\n default: 1,\n});\n\nconst frequencyPenalty = RangeConfigItem({\n param: \"frequency_penalty\",\n title: CHAT_CONFIG.FREQUENCY_PENALTY.title,\n description: CHAT_CONFIG.FREQUENCY_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst presencePenalty = RangeConfigItem({\n param: \"presence_penalty\",\n title: CHAT_CONFIG.PRESENCE_PENALTY.title,\n description: CHAT_CONFIG.PRESENCE_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst seed = RangeConfigItem({\n param: \"seed\",\n title: CHAT_CONFIG.SEED.title,\n description: CHAT_CONFIG.SEED.description,\n min: 0,\n max: 1000000,\n step: 1,\n default: 0,\n});\n\nconst responseFormat = SelectStringConfigItem({\n param: \"response_format\",\n title: CHAT_CONFIG.RESPONSE_FORMAT.title,\n description: CHAT_CONFIG.RESPONSE_FORMAT.description,\n default: \"text\",\n choices: [\"text\", \"json_object\"],\n});\n\nconst toolChoice = SelectStringConfigItem({\n param: \"tool_choice\",\n title: \"Tool choice\",\n description:\n \"Controls which (if any) tool is called by the model. \\\n 'none' means the model will not call a function. \\\n 'auto' means the model can pick between generating a message or calling a tool.\",\n default: \"auto\",\n choices: [\"auto\", \"required\", \"none\"],\n});\n\nexport { frequencyPenalty, maxTokens, presencePenalty, seed, stop, temperature, toolChoice, topP, responseFormat };\n","import { z } from \"zod\";\n\nimport {\n frequencyPenalty,\n maxTokens,\n presencePenalty,\n responseFormat,\n seed,\n stop,\n temperature,\n toolChoice,\n topP,\n} from \"./common.config.chat-model.groq\";\n\nconst ChatModelBaseConfigSchema = (maxOutputTokens: number) =>\n z.object({\n temperature: temperature.schema,\n maxTokens: maxTokens(maxOutputTokens).schema,\n stop: stop.schema,\n topP: topP.schema,\n frequencyPenalty: frequencyPenalty.schema,\n presencePenalty: presencePenalty.schema,\n seed: seed.schema.transform((value) => (value === 0 ? undefined : value)),\n responseFormat: responseFormat.schema,\n toolChoice: toolChoice.schema,\n });\n\nconst ChatModelBaseConfigDef = (maxOutputTokens: number) =>\n ({\n temperature: temperature.def,\n maxTokens: maxTokens(maxOutputTokens).def,\n stop: stop.def,\n topP: topP.def,\n frequencyPenalty: frequencyPenalty.def,\n presencePenalty: presencePenalty.def,\n seed: seed.def,\n responseFormat: responseFormat.def,\n toolChoice: toolChoice.def,\n }) as const;\n\nexport { ChatModelBaseConfigDef, ChatModelBaseConfigSchema };\n","import { ChatModelBaseConfigDef, ChatModelBaseConfigSchema } from \"./chat-model\";\n\nconst GroqChatModelConfigs = {\n base: (maxOutputTokens: number) => ({\n def: ChatModelBaseConfigDef(maxOutputTokens),\n schema: ChatModelBaseConfigSchema(maxOutputTokens),\n }),\n} as const;\n\nexport { GroqChatModelConfigs };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma2_9b_ITLiteral = \"gemma2-9b-it\" as const;\n// https://huggingface.co/google/gemma-2-9b-it\nconst Gemma2_9b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma2_9b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma2_9b_ITLiteral,\n description: Gemma2_9b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n price: pricingData[Gemma2_9b_ITLiteral],\n});\n\nconst Gemma2_9b_ITOptions = BaseChatModelOptions;\ntype Gemma2_9b_ITOptionsType = z.infer<typeof Gemma2_9b_ITOptions>;\n\nclass Gemma2_9b_IT extends BaseChatModelGroq {\n constructor(options: Gemma2_9b_ITOptionsType) {\n super(Gemma2_9b_ITSchema, options);\n }\n}\n\nexport { Gemma2_9b_IT, Gemma2_9b_ITLiteral, Gemma2_9b_ITOptions, Gemma2_9b_ITSchema, type Gemma2_9b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_8bLiteral = \"llama-3.1-8b-instant\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_8bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_8bLiteral,\n description: Llama_3_1_8bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_1_8bLiteral],\n});\n\nconst Llama_3_1_8b_Options = BaseChatModelOptions;\ntype Llama_3_1_8b_OptionsType = z.infer<typeof Llama_3_1_8b_Options>;\n\nclass Llama_3_1_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_8b_OptionsType) {\n super(Llama_3_1_8bSchema, options);\n }\n}\n\nexport { Llama_3_1_8b, Llama_3_1_8b_Options, Llama_3_1_8bLiteral, Llama_3_1_8bSchema, type Llama_3_1_8b_OptionsType };\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_11b_VisionLiteral = \"llama-3.2-11b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-11B-Vision\nconst Llama_3_2_11b_VisionDescription =\n \"The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, \\\n and answering general questions about an image. \\\n The models outperform many of the available open source and closed multimodal models on common industry benchmarks.\";\n\nconst Llama_3_2_11b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_11b_VisionLiteral,\n description: Llama_3_2_11b_VisionDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_2_11b_VisionLiteral],\n});\n\nconst Llama_3_2_11b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_11b_VisionOptionsType = z.infer<typeof Llama_3_2_11b_VisionOptions>;\n\nclass Llama_3_2_11b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_11b_VisionOptionsType) {\n super(Llama_3_2_11b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionLiteral,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n type Llama_3_2_11b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_1bLiteral = \"llama-3.2-1b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-1B\nconst Llama_3_2_1bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_1bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_1bLiteral,\n description: Llama_3_2_1bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_2_1bLiteral],\n});\n\nconst Llama_3_2_1b_Options = BaseChatModelOptions;\ntype Llama_3_2_1b_OptionsType = z.infer<typeof Llama_3_2_1b_Options>;\n\nclass Llama_3_2_1b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_1b_OptionsType) {\n super(Llama_3_2_1bSchema, options);\n }\n}\n\nexport { Llama_3_2_1b, Llama_3_2_1b_Options, Llama_3_2_1bLiteral, Llama_3_2_1bSchema, type Llama_3_2_1b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_3bLiteral = \"llama-3.2-3b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-3B\nconst Llama_3_2_3bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_3bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_3bLiteral,\n description: Llama_3_2_3bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_2_3bLiteral],\n});\n\nconst Llama_3_2_3b_Options = BaseChatModelOptions;\ntype Llama_3_2_3b_OptionsType = z.infer<typeof Llama_3_2_3b_Options>;\n\nclass Llama_3_2_3b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_3b_OptionsType) {\n super(Llama_3_2_3bSchema, options);\n }\n}\n\nexport { Llama_3_2_3b, Llama_3_2_3b_Options, Llama_3_2_3bLiteral, Llama_3_2_3bSchema, type Llama_3_2_3b_OptionsType };\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_90b_VisionLiteral = \"llama-3.2-90b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-90B-Vision\nconst Llama_3_2_90b_VisionDescription =\n \"The Llama 3.2-90B Vision instruction-tuned models are optimized for advanced visual recognition, \\\n complex image reasoning, detailed captioning, and answering intricate questions about images. \\\n These models achieve state-of-the-art results on multiple industry benchmarks for multimodal tasks.\";\n\nconst Llama_3_2_90b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_90b_VisionLiteral,\n description: Llama_3_2_90b_VisionDescription,\n maxInputTokens: 131072,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_2_90b_VisionLiteral],\n});\n\nconst Llama_3_2_90b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_90b_VisionOptionsType = z.infer<typeof Llama_3_2_90b_VisionOptions>;\n\nclass Llama_3_2_90b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_90b_VisionOptionsType) {\n super(Llama_3_2_90b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_90b_Vision,\n Llama_3_2_90b_VisionLiteral,\n Llama_3_2_90b_VisionOptions,\n Llama_3_2_90b_VisionSchema,\n type Llama_3_2_90b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70bLiteral = \"llama3-70b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct\nconst Llama_3_70bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70bLiteral,\n description: Llama_3_70bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n price: pricingData[Llama_3_70bLiteral],\n});\n\nconst Llama_3_70bOptions = BaseChatModelOptions;\ntype Llama_3_70bOptionsType = z.infer<typeof Llama_3_70bOptions>;\n\nclass Llama_3_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_70bOptionsType) {\n super(Llama_3_70bSchema, options);\n }\n}\n\nexport { Llama_3_70b, Llama_3_70bLiteral, Llama_3_70bOptions, Llama_3_70bSchema, type Llama_3_70bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8bLiteral = \"llama3-8b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct\nconst Llama_3_8bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8bLiteral,\n description: Llama_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n price: pricingData[Llama_3_8bLiteral],\n});\n\nconst Llama_3_8bOptions = BaseChatModelOptions;\ntype Llama_3_8bOptionsType = z.infer<typeof Llama_3_8bOptions>;\n\nclass Llama_3_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_8bOptionsType) {\n super(Llama_3_8bSchema, options);\n }\n}\n\nexport { Llama_3_8b, Llama_3_8bLiteral, Llama_3_8bOptions, Llama_3_8bSchema, type Llama_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst LlamaGuard_3_8bLiteral = \"llama-guard-3-8b\" as const;\n// https://huggingface.co/meta-llama/Llama-Guard-3-8B\nconst LlamaGuard_3_8bDescription = \"Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.\";\n\nconst LlamaGuard_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: LlamaGuard_3_8bLiteral,\n description: LlamaGuard_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n price: pricingData[LlamaGuard_3_8bLiteral],\n});\n\nconst LlamaGuard_3_8bOptions = BaseChatModelOptions;\ntype LlamaGuard_3_8bOptionsType = z.infer<typeof LlamaGuard_3_8bOptions>;\n\nclass LlamaGuard_3_8b extends BaseChatModelGroq {\n constructor(options: LlamaGuard_3_8bOptionsType) {\n super(LlamaGuard_3_8bSchema, options);\n }\n}\n\nexport { LlamaGuard_3_8b, LlamaGuard_3_8bLiteral, LlamaGuard_3_8bOptions, LlamaGuard_3_8bSchema, type LlamaGuard_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport { ChatModelSchemaType, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderError, ProviderV1 } from \"@adaline/provider\";\n\nimport * as Models from \"../models\";\n\nconst ProviderLiteral = \"groq\";\nclass Groq<C extends Models.BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {\n readonly version = \"v1\" as const;\n readonly name = ProviderLiteral;\n static readonly baseUrl = \"https://api.groq.com/openai/v1\";\n\n private readonly chatModelFactories: Record<\n string,\n {\n model: { new (options: any): ChatModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: ChatModelSchemaType;\n }\n > = {\n [Models.Gemma2_9b_ITLiteral]: {\n model: Models.Gemma2_9b_IT,\n modelOptions: Models.Gemma2_9b_ITOptions,\n modelSchema: Models.Gemma2_9b_ITSchema,\n },\n [Models.LlamaGuard_3_8bLiteral]: {\n model: Models.LlamaGuard_3_8b,\n modelOptions: Models.LlamaGuard_3_8bOptions,\n modelSchema: Models.LlamaGuard_3_8bSchema,\n },\n [Models.Llama_3_8bLiteral]: {\n model: Models.Llama_3_8b,\n modelOptions: Models.Llama_3_8bOptions,\n modelSchema: Models.Llama_3_8bSchema,\n },\n [Models.Llama_3_70bLiteral]: {\n model: Models.Llama_3_70b,\n modelOptions: Models.Llama_3_70bOptions,\n modelSchema: Models.Llama_3_70bSchema,\n },\n [Models.Llama_3_1_8bLiteral]: {\n model: Models.Llama_3_1_8b,\n modelOptions: Models.Llama_3_1_8b_Options,\n modelSchema: Models.Llama_3_1_8bSchema,\n },\n [Models.Llama_3_2_11b_VisionLiteral]: {\n model: Models.Llama_3_2_11b_Vision,\n modelOptions: Models.Llama_3_2_11b_VisionOptions,\n modelSchema: Models.Llama_3_2_11b_VisionSchema,\n },\n [Models.Llama_3_2_90b_VisionLiteral]: {\n model: Models.Llama_3_2_90b_Vision,\n modelOptions: Models.Llama_3_2_90b_VisionOptions,\n modelSchema: Models.Llama_3_2_90b_VisionSchema,\n },\n [Models.Llama_3_2_3bLiteral]: {\n model: Models.Llama_3_2_3b,\n modelOptions: Models.Llama_3_2_3b_Options,\n modelSchema: Models.Llama_3_2_3bSchema,\n },\n [Models.Llama_3_2_1bLiteral]: {\n model: Models.Llama_3_2_1b,\n modelOptions: Models.Llama_3_2_1b_Options,\n modelSchema: Models.Llama_3_2_1bSchema,\n },\n };\n\n private readonly embeddingModelFactories: Record<\n string,\n {\n model: { new (options: any): EmbeddingModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: EmbeddingModelSchemaType;\n }\n > = {};\n\n chatModelLiterals(): string[] {\n return Object.keys(this.chatModelFactories);\n }\n\n chatModelSchemas(): Record<string, ChatModelSchemaType> {\n return Object.keys(this.chatModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.chatModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, ChatModelSchemaType>\n );\n }\n\n chatModel(options: C): ChatModelV1 {\n const modelName = options.modelName;\n if (!(modelName in this.chatModelFactories)) {\n throw new ProviderError({\n info: `Groq chat model: ${modelName} not found`,\n cause: new Error(`Groq chat model: ${modelName} not found, available chat models: \n ${this.chatModelLiterals().join(\", \")}`),\n });\n }\n\n const model = this.chatModelFactories[modelName].model;\n const parsedOptions = this.chatModelFactories[modelName].modelOptions.parse(options);\n return new model(parsedOptions);\n }\n\n embeddingModelLiterals(): string[] {\n return Object.keys(this.embeddingModelFactories);\n }\n\n embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType> {\n return Object.keys(this.embeddingModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.embeddingModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, EmbeddingModelSchemaType>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n embeddingModel(options: E): EmbeddingModelV1 {\n throw new ProviderError({\n info: \"Groq does not support embedding models yet\",\n cause: new Error(\"Groq does not support embedding models yet\"),\n });\n }\n}\n\nexport { Groq };\n"]}
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
- import { RangeConfigItem, CHAT_CONFIG, MultiStringConfigItem, SelectStringConfigItem, ChatModelSchema, InvalidMessagesError, ProviderError } from '@adaline/provider';
1
+ import { RangeConfigItem, CHAT_CONFIG, MultiStringConfigItem, SelectStringConfigItem, ChatModelSchema, InvalidMessagesError, ModelResponseError, ProviderError } from '@adaline/provider';
2
2
  import { z as z$1 } from 'zod';
3
3
  import { OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum, OpenAIChatModelRolesMap, OpenAIChatModelTextToolModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelModalities, BaseChatModel } from '@adaline/openai';
4
4
 
5
- var s=z$1.object({modelName:z$1.string().min(1),apiKey:z$1.string().min(1)}),a=class extends BaseChatModel{constructor(n,p){let l=s.parse(p),r=_.baseUrl;super(n,{modelName:l.modelName,apiKey:l.apiKey,baseUrl:r,completeChatUrl:`${r}/chat/completions`,streamChatUrl:`${r}/chat/completions`});this.version="v1";this.modelSchema=n,this.modelName=l.modelName,this.groqApiKey=l.apiKey;}transformMessages(n){let p=n.some(m=>m.role==="system"),l=n.some(m=>m.content.some(c=>c.modality==="image"));if(p&&l)throw new InvalidMessagesError({info:`Invalid message content for model : '${this.modelName}'`,cause:new Error("Prompting with images is incompatible with system messages`)")});let r=super.transformMessages(n);return r.messages.forEach(m=>{m.role==="system"?typeof m.content!="string"&&(m.content=m.content.map(c=>c.text).join(`
6
- `)):m.role==="assistant"&&m.content&&typeof m.content!="string"&&(m.content=m.content.map(c=>c.text).join(`
7
- `));}),r}};var g=RangeConfigItem({param:"temperature",title:CHAT_CONFIG.TEMPERATURE.title,description:CHAT_CONFIG.TEMPERATURE.description,min:0,max:2,step:.01,default:1}),x=t=>RangeConfigItem({param:"max_tokens",title:CHAT_CONFIG.MAX_TOKENS.title,description:CHAT_CONFIG.MAX_TOKENS.description,min:0,max:t,step:1,default:0}),S=MultiStringConfigItem({param:"stop",title:CHAT_CONFIG.STOP(4).title,description:CHAT_CONFIG.STOP(4).description,max:4}),I=RangeConfigItem({param:"top_p",title:CHAT_CONFIG.TOP_P.title,description:CHAT_CONFIG.TOP_P.description,min:0,max:1,step:.01,default:1}),E=RangeConfigItem({param:"frequency_penalty",title:CHAT_CONFIG.FREQUENCY_PENALTY.title,description:CHAT_CONFIG.FREQUENCY_PENALTY.description,min:-2,max:2,step:.01,default:0}),A=RangeConfigItem({param:"presence_penalty",title:CHAT_CONFIG.PRESENCE_PENALTY.title,description:CHAT_CONFIG.PRESENCE_PENALTY.description,min:-2,max:2,step:.01,default:0}),G=RangeConfigItem({param:"seed",title:CHAT_CONFIG.SEED.title,description:CHAT_CONFIG.SEED.description,min:0,max:1e6,step:1,default:0}),R=SelectStringConfigItem({param:"response_format",title:CHAT_CONFIG.RESPONSE_FORMAT.title,description:CHAT_CONFIG.RESPONSE_FORMAT.description,default:"text",choices:["text","json_object"]}),k=SelectStringConfigItem({param:"tool_choice",title:"Tool choice",description:"Controls which (if any) tool is called by the model. 'none' means the model will not call a function. 'auto' means the model can pick between generating a message or calling a tool.",default:"auto",choices:["auto","required","none"]});var J=t=>z$1.object({temperature:g.schema,maxTokens:x(t).schema,stop:S.schema,topP:I.schema,frequencyPenalty:E.schema,presencePenalty:A.schema,seed:G.schema.transform(e=>e===0?void 0:e),responseFormat:R.schema,toolChoice:k.schema}),W=t=>({temperature:g.def,maxTokens:x(t).def,stop:S.def,topP:I.def,frequencyPenalty:E.def,presencePenalty:A.def,seed:G.def,responseFormat:R.def,toolChoice:k.def});var o={base:t=>({def:W(t),schema:J(t)})};var q="gemma2-9b-it",ye="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.",P=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:q,description:ye,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ee=s,h=class extends a{constructor(e){super(P,e);}};var z="llama-3.1-8b-instant",xe="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",B=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:z,description:xe,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),oe=s,f=class extends a{constructor(e){super(B,e);}};var v="llama-3.2-11b-vision-preview",Re="The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The models outperform many of the available open source and closed multimodal models on common industry benchmarks.",V=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelModalitiesEnum).parse({name:v,description:Re,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ae=s,M=class extends a{constructor(e){super(V,e);}};var w="llama-3.2-1b-preview",ve="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",N=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:w,description:ve,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),te=s,u=class extends a{constructor(e){super(N,e);}};var F="llama-3.2-3b-preview",je="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",D=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:F,description:je,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),se=s,b=class extends a{constructor(e){super(D,e);}};var j="llama-3.2-90b-vision-preview",Xe="The Llama 3.2-90B Vision instruction-tuned models are optimized for advanced visual recognition, complex image reasoning, detailed captioning, and answering intricate questions about images. These models achieve state-of-the-art results on multiple industry benchmarks for multimodal tasks.",U=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelModalitiesEnum).parse({name:j,description:Xe,maxInputTokens:131072,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ne=s,y=class extends a{constructor(e){super(U,e);}};var K="llama3-70b-8192",oo="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.",Y=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:K,description:oo,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ie=s,O=class extends a{constructor(e){super(Y,e);}};var $="llama3-8b-8192",mo="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.",Q=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:$,description:mo,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),me=s,T=class extends a{constructor(e){super(Q,e);}};var X="llama-guard-3-8b",ho="Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.",Z=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:X,description:ho,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),le=s,C=class extends a{constructor(e){super(Z,e);}};var fo="groq",_=class{constructor(){this.version="v1";this.name=fo;this.chatModelFactories={[q]:{model:h,modelOptions:ee,modelSchema:P},[X]:{model:C,modelOptions:le,modelSchema:Z},[$]:{model:T,modelOptions:me,modelSchema:Q},[K]:{model:O,modelOptions:ie,modelSchema:Y},[z]:{model:f,modelOptions:oe,modelSchema:B},[v]:{model:M,modelOptions:ae,modelSchema:V},[j]:{model:y,modelOptions:ne,modelSchema:U},[F]:{model:b,modelOptions:se,modelSchema:D},[w]:{model:u,modelOptions:te,modelSchema:N}};this.embeddingModelFactories={};}chatModelLiterals(){return Object.keys(this.chatModelFactories)}chatModelSchemas(){return Object.keys(this.chatModelFactories).reduce((e,n)=>(e[n]=this.chatModelFactories[n].modelSchema,e),{})}chatModel(e){let n=e.modelName;if(!(n in this.chatModelFactories))throw new ProviderError({info:`Groq chat model: ${n} not found`,cause:new Error(`Groq chat model: ${n} not found, available chat models:
8
- ${this.chatModelLiterals().join(", ")}`)});let p=this.chatModelFactories[n].model,l=this.chatModelFactories[n].modelOptions.parse(e);return new p(l)}embeddingModelLiterals(){return Object.keys(this.embeddingModelFactories)}embeddingModelSchemas(){return Object.keys(this.embeddingModelFactories).reduce((e,n)=>(e[n]=this.embeddingModelFactories[n].modelSchema,e),{})}embeddingModel(e){throw new ProviderError({info:"Groq does not support embedding models yet",cause:new Error("Groq does not support embedding models yet")})}};_.baseUrl="https://api.groq.com/openai/v1";
5
+ var a={"gemma2-9b-it":{modelName:"gemma2-9b-it",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.2,outputPricePerMillion:.2}}}]},"llama-3.1-8b-instant":{modelName:"llama-3.1-8b-instant",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.05,outputPricePerMillion:.08}}}]},"llama-3.2-11b-vision-preview":{modelName:"llama-3.2-11b-vision-preview",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.18,outputPricePerMillion:.18}}}]},"llama-3.2-1b-preview":{modelName:"llama-3.2-1b-preview",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.04,outputPricePerMillion:.04}}}]},"llama-3.2-3b-preview":{modelName:"llama-3.2-3b-preview",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.06,outputPricePerMillion:.06}}}]},"llama-3.2-90b-vision-preview":{modelName:"llama-3.2-90b-vision-preview",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.7,outputPricePerMillion:.8}}}]},"llama3-70b-8192":{modelName:"llama3-70b-8192",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.59,outputPricePerMillion:.79}}}]},"llama3-8b-8192":{modelName:"llama3-8b-8192",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.05,outputPricePerMillion:.08}}}]},"llama-guard-3-8b":{modelName:"llama-guard-3-8b",currency:"USD",tokenRanges:[{minTokens:0,maxTokens:null,prices:{base:{inputPricePerMillion:.2,outputPricePerMillion:.2}}}]}};var n=z$1.object({modelName:z$1.string().min(1),apiKey:z$1.string().min(1)}),t=class extends BaseChatModel{constructor(i,c){let r=n.parse(c),p=h.baseUrl;super(i,{modelName:r.modelName,apiKey:r.apiKey,baseUrl:p,completeChatUrl:`${p}/chat/completions`,streamChatUrl:`${p}/chat/completions`});this.version="v1";this.modelSchema=i,this.modelName=r.modelName,this.groqApiKey=r.apiKey;}transformMessages(i){let c=i.some(l=>l.role==="system"),r=i.some(l=>l.content.some(_=>_.modality==="image"));if(c&&r)throw new InvalidMessagesError({info:`Invalid message content for model : '${this.modelName}'`,cause:new Error("Prompting with images is incompatible with system messages`)")});let p=super.transformMessages(i);return p.messages.forEach(l=>{l.role==="system"?typeof l.content!="string"&&(l.content=l.content.map(_=>_.text).join(`
6
+ `)):l.role==="assistant"&&l.content&&typeof l.content!="string"&&(l.content=l.content.map(_=>_.text).join(`
7
+ `));}),p}getModelPricing(){if(!(this.modelName in a))throw new ModelResponseError({info:`Invalid model pricing for model : '${this.modelName}'`,cause:new Error(`No pricing configuration found for model "${this.modelName}"`)});return a[this.modelName]}};var v=RangeConfigItem({param:"temperature",title:CHAT_CONFIG.TEMPERATURE.title,description:CHAT_CONFIG.TEMPERATURE.description,min:0,max:2,step:.01,default:1}),N=s=>RangeConfigItem({param:"max_tokens",title:CHAT_CONFIG.MAX_TOKENS.title,description:CHAT_CONFIG.MAX_TOKENS.description,min:0,max:s,step:1,default:0}),q=MultiStringConfigItem({param:"stop",title:CHAT_CONFIG.STOP(4).title,description:CHAT_CONFIG.STOP(4).description,max:4}),w=RangeConfigItem({param:"top_p",title:CHAT_CONFIG.TOP_P.title,description:CHAT_CONFIG.TOP_P.description,min:0,max:1,step:.01,default:1}),z=RangeConfigItem({param:"frequency_penalty",title:CHAT_CONFIG.FREQUENCY_PENALTY.title,description:CHAT_CONFIG.FREQUENCY_PENALTY.description,min:-2,max:2,step:.01,default:0}),B=RangeConfigItem({param:"presence_penalty",title:CHAT_CONFIG.PRESENCE_PENALTY.title,description:CHAT_CONFIG.PRESENCE_PENALTY.description,min:-2,max:2,step:.01,default:0}),D=RangeConfigItem({param:"seed",title:CHAT_CONFIG.SEED.title,description:CHAT_CONFIG.SEED.description,min:0,max:1e6,step:1,default:0}),V=SelectStringConfigItem({param:"response_format",title:CHAT_CONFIG.RESPONSE_FORMAT.title,description:CHAT_CONFIG.RESPONSE_FORMAT.description,default:"text",choices:["text","json_object"]}),F=SelectStringConfigItem({param:"tool_choice",title:"Tool choice",description:"Controls which (if any) tool is called by the model. 'none' means the model will not call a function. 'auto' means the model can pick between generating a message or calling a tool.",default:"auto",choices:["auto","required","none"]});var W=s=>z$1.object({temperature:v.schema,maxTokens:N(s).schema,stop:q.schema,topP:w.schema,frequencyPenalty:z.schema,presencePenalty:B.schema,seed:D.schema.transform(e=>e===0?void 0:e),responseFormat:V.schema,toolChoice:F.schema}),ee=s=>({temperature:v.def,maxTokens:N(s).def,stop:q.def,topP:w.def,frequencyPenalty:z.def,presencePenalty:B.def,seed:D.def,responseFormat:V.def,toolChoice:F.def});var o={base:s=>({def:ee(s),schema:W(s)})};var u="gemma2-9b-it",ge="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.",U=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:u,description:ge,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema},price:a[u]}),oe=n,M=class extends t{constructor(e){super(U,e);}};var f="llama-3.1-8b-instant",Ie="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",j=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:f,description:Ie,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[f]}),ae=n,b=class extends t{constructor(e){super(j,e);}};var y="llama-3.2-11b-vision-preview",ve="The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The models outperform many of the available open source and closed multimodal models on common industry benchmarks.",K=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelModalitiesEnum).parse({name:y,description:ve,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[y]}),te=n,T=class extends t{constructor(e){super(K,e);}};var O="llama-3.2-1b-preview",De="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",$=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:O,description:De,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[O]}),se=n,g=class extends t{constructor(e){super($,e);}};var C="llama-3.2-3b-preview",$e="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",Y=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:C,description:$e,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[C]}),ie=n,L=class extends t{constructor(e){super(Y,e);}};var x="llama-3.2-90b-vision-preview",Je="The Llama 3.2-90B Vision instruction-tuned models are optimized for advanced visual recognition, complex image reasoning, detailed captioning, and answering intricate questions about images. These models achieve state-of-the-art results on multiple industry benchmarks for multimodal tasks.",Q=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelModalitiesEnum).parse({name:x,description:Je,maxInputTokens:131072,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema},price:a[x]}),ne=n,S=class extends t{constructor(e){super(Q,e);}};var P="llama3-70b-8192",so="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.",X=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:P,description:so,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema},price:a[P]}),me=n,I=class extends t{constructor(e){super(X,e);}};var k="llama3-8b-8192",po="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.",Z=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:k,description:po,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema},price:a[k]}),le=n,E=class extends t{constructor(e){super(Z,e);}};var R="llama-guard-3-8b",fo="Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.",H=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:R,description:fo,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema},price:a[R]}),re=n,A=class extends t{constructor(e){super(H,e);}};var bo="groq",h=class{constructor(){this.version="v1";this.name=bo;this.chatModelFactories={[u]:{model:M,modelOptions:oe,modelSchema:U},[R]:{model:A,modelOptions:re,modelSchema:H},[k]:{model:E,modelOptions:le,modelSchema:Z},[P]:{model:I,modelOptions:me,modelSchema:X},[f]:{model:b,modelOptions:ae,modelSchema:j},[y]:{model:T,modelOptions:te,modelSchema:K},[x]:{model:S,modelOptions:ne,modelSchema:Q},[C]:{model:L,modelOptions:ie,modelSchema:Y},[O]:{model:g,modelOptions:se,modelSchema:$}};this.embeddingModelFactories={};}chatModelLiterals(){return Object.keys(this.chatModelFactories)}chatModelSchemas(){return Object.keys(this.chatModelFactories).reduce((e,i)=>(e[i]=this.chatModelFactories[i].modelSchema,e),{})}chatModel(e){let i=e.modelName;if(!(i in this.chatModelFactories))throw new ProviderError({info:`Groq chat model: ${i} not found`,cause:new Error(`Groq chat model: ${i} not found, available chat models:
8
+ ${this.chatModelLiterals().join(", ")}`)});let c=this.chatModelFactories[i].model,r=this.chatModelFactories[i].modelOptions.parse(e);return new c(r)}embeddingModelLiterals(){return Object.keys(this.embeddingModelFactories)}embeddingModelSchemas(){return Object.keys(this.embeddingModelFactories).reduce((e,i)=>(e[i]=this.embeddingModelFactories[i].modelSchema,e),{})}embeddingModel(e){throw new ProviderError({info:"Groq does not support embedding models yet",cause:new Error("Groq does not support embedding models yet")})}};h.baseUrl="https://api.groq.com/openai/v1";
9
9
 
10
- export { a as BaseChatModelGroq, s as BaseChatModelOptions, h as Gemma2_9b_IT, q as Gemma2_9b_ITLiteral, ee as Gemma2_9b_ITOptions, P as Gemma2_9b_ITSchema, _ as Groq, C as LlamaGuard_3_8b, X as LlamaGuard_3_8bLiteral, le as LlamaGuard_3_8bOptions, Z as LlamaGuard_3_8bSchema, f as Llama_3_1_8b, z as Llama_3_1_8bLiteral, B as Llama_3_1_8bSchema, oe as Llama_3_1_8b_Options, M as Llama_3_2_11b_Vision, v as Llama_3_2_11b_VisionLiteral, ae as Llama_3_2_11b_VisionOptions, V as Llama_3_2_11b_VisionSchema, u as Llama_3_2_1b, w as Llama_3_2_1bLiteral, N as Llama_3_2_1bSchema, te as Llama_3_2_1b_Options, b as Llama_3_2_3b, F as Llama_3_2_3bLiteral, D as Llama_3_2_3bSchema, se as Llama_3_2_3b_Options, y as Llama_3_2_90b_Vision, j as Llama_3_2_90b_VisionLiteral, ne as Llama_3_2_90b_VisionOptions, U as Llama_3_2_90b_VisionSchema, O as Llama_3_70b, K as Llama_3_70bLiteral, ie as Llama_3_70bOptions, Y as Llama_3_70bSchema, T as Llama_3_8b, $ as Llama_3_8bLiteral, me as Llama_3_8bOptions, Q as Llama_3_8bSchema };
10
+ export { t as BaseChatModelGroq, n as BaseChatModelOptions, M as Gemma2_9b_IT, u as Gemma2_9b_ITLiteral, oe as Gemma2_9b_ITOptions, U as Gemma2_9b_ITSchema, h as Groq, A as LlamaGuard_3_8b, R as LlamaGuard_3_8bLiteral, re as LlamaGuard_3_8bOptions, H as LlamaGuard_3_8bSchema, b as Llama_3_1_8b, f as Llama_3_1_8bLiteral, j as Llama_3_1_8bSchema, ae as Llama_3_1_8b_Options, T as Llama_3_2_11b_Vision, y as Llama_3_2_11b_VisionLiteral, te as Llama_3_2_11b_VisionOptions, K as Llama_3_2_11b_VisionSchema, g as Llama_3_2_1b, O as Llama_3_2_1bLiteral, $ as Llama_3_2_1bSchema, se as Llama_3_2_1b_Options, L as Llama_3_2_3b, C as Llama_3_2_3bLiteral, Y as Llama_3_2_3bSchema, ie as Llama_3_2_3b_Options, S as Llama_3_2_90b_Vision, x as Llama_3_2_90b_VisionLiteral, ne as Llama_3_2_90b_VisionOptions, Q as Llama_3_2_90b_VisionSchema, I as Llama_3_70b, P as Llama_3_70bLiteral, me as Llama_3_70bOptions, X as Llama_3_70bSchema, E as Llama_3_8b, k as Llama_3_8bLiteral, le as Llama_3_8bOptions, Z as Llama_3_8bSchema };
11
11
  //# sourceMappingURL=index.mjs.map
12
12
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/models/chat-models/base-chat-model.groq.ts","../src/configs/chat-model/common.config.chat-model.groq.ts","../src/configs/chat-model/base.config.chat-model.groq.ts","../src/configs/configs.groq.ts","../src/models/chat-models/gemma2-9b-it.groq.ts","../src/models/chat-models/llama-3-1-8b.groq.ts","../src/models/chat-models/llama-3-2-11b-vision.groq.ts","../src/models/chat-models/llama-3-2-1b.groq.ts","../src/models/chat-models/llama-3-2-3b.groq.ts","../src/models/chat-models/llama-3-2-90b-vision.groq.ts","../src/models/chat-models/llama-3-70b.groq.ts","../src/models/chat-models/llama-3-8b.groq.ts","../src/models/chat-models/llama-guard-3-8b.groq.ts","../src/provider/provider.groq.ts"],"names":["BaseChatModelOptions","z","BaseChatModelGroq","BaseChatModel","modelSchema","options","parsedOptions","baseUrl","Groq","messages","hasSystemRole","msg","hasImageModality","content","InvalidMessagesError","transformedMessages","message","temperature","RangeConfigItem","CHAT_CONFIG","maxTokens","maxOutputTokens","stop","MultiStringConfigItem","topP","frequencyPenalty","presencePenalty","seed","responseFormat","SelectStringConfigItem","toolChoice","ChatModelBaseConfigSchema","value","ChatModelBaseConfigDef","GroqChatModelConfigs","Gemma2_9b_ITLiteral","Gemma2_9b_ITDescription","Gemma2_9b_ITSchema","ChatModelSchema","OpenAIChatModelRoles","OpenAIChatModelTextToolModalitiesEnum","OpenAIChatModelRolesMap","OpenAIChatModelTextToolModalities","Gemma2_9b_ITOptions","Gemma2_9b_IT","Llama_3_1_8bLiteral","Llama_3_1_8bDescription","Llama_3_1_8bSchema","Llama_3_1_8b_Options","Llama_3_1_8b","Llama_3_2_11b_VisionLiteral","Llama_3_2_11b_VisionDescription","Llama_3_2_11b_VisionSchema","OpenAIChatModelModalitiesEnum","OpenAIChatModelModalities","Llama_3_2_11b_VisionOptions","Llama_3_2_11b_Vision","Llama_3_2_1bLiteral","Llama_3_2_1bDescription","Llama_3_2_1bSchema","Llama_3_2_1b_Options","Llama_3_2_1b","Llama_3_2_3bLiteral","Llama_3_2_3bDescription","Llama_3_2_3bSchema","Llama_3_2_3b_Options","Llama_3_2_3b","Llama_3_2_90b_VisionLiteral","Llama_3_2_90b_VisionDescription","Llama_3_2_90b_VisionSchema","Llama_3_2_90b_VisionOptions","Llama_3_2_90b_Vision","Llama_3_70bLiteral","Llama_3_70bDescription","Llama_3_70bSchema","Llama_3_70bOptions","Llama_3_70b","Llama_3_8bLiteral","Llama_3_8bDescription","Llama_3_8bSchema","Llama_3_8bOptions","Llama_3_8b","LlamaGuard_3_8bLiteral","LlamaGuard_3_8bDescription","LlamaGuard_3_8bSchema","LlamaGuard_3_8bOptions","LlamaGuard_3_8b","ProviderLiteral","acc","key","modelName","ProviderError","model"],"mappings":";;;;IAQMA,CAAuBC,CAAAA,GAAAA,CAAE,MAAO,CAAA,CACpC,UAAWA,GAAE,CAAA,MAAA,EAAS,CAAA,GAAA,CAAI,CAAC,CAC3B,CAAA,MAAA,CAAQA,GAAE,CAAA,MAAA,GAAS,GAAI,CAAA,CAAC,CAC1B,CAAC,CAAA,CAGKC,EAAN,cAAgCC,aAAc,CAO5C,WAAA,CAAYC,EAAkCC,CAAmC,CAAA,CAC/E,IAAMC,CAAAA,CAAgBN,EAAqB,KAAMK,CAAAA,CAAO,CAClDE,CAAAA,CAAAA,CAAUC,EAAK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,EAC1C,KAAK,iBAAkB,EAAA,CAAE,KAAK,IAAI,CAAC,EAAE,CAC3C,CAAC,CAGH,CAAA,IAAME,EAAQ,IAAK,CAAA,kBAAA,CAAmBF,CAAS,CAAE,CAAA,KAAA,CAC3CpF,EAAgB,IAAK,CAAA,kBAAA,CAAmBoF,CAAS,CAAA,CAAE,aAAa,KAAMrF,CAAAA,CAAO,EACnF,OAAO,IAAIuF,EAAMtF,CAAa,CAChC,CAEA,sBAAA,EAAmC,CACjC,OAAO,MAAA,CAAO,KAAK,IAAK,CAAA,uBAAuB,CACjD,CAEA,qBAAA,EAAkE,CAChE,OAAO,OAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CAAE,CAAA,MAAA,CAC/C,CAACkF,CAAKC,CAAAA,CAAAA,IACJD,CAAIC,CAAAA,CAAG,EAAI,IAAK,CAAA,uBAAA,CAAwBA,CAAG,CAAE,CAAA,WAAA,CACtCD,GAET,EACF,CACF,CAGA,eAAenF,CAA8B,CAAA,CAC3C,MAAM,IAAIsF,aAAAA,CAAc,CACtB,IAAM,CAAA,4CAAA,CACN,MAAO,IAAI,KAAA,CAAM,4CAA4C,CAC/D,CAAC,CACH,CACF,EAvHMnF,EAGY,OAAU,CAAA,gCAAA","file":"index.mjs","sourcesContent":["import { z } from \"zod\";\n\nimport { BaseChatModel, OpenAIChatRequestMessageType } from \"@adaline/openai\";\nimport { ChatModelSchemaType, InvalidMessagesError, ParamsType } from \"@adaline/provider\";\nimport { MessageType } from \"@adaline/types\";\n\nimport { Groq } from \"../../provider\";\n\nconst BaseChatModelOptions = z.object({\n modelName: z.string().min(1),\n apiKey: z.string().min(1),\n});\ntype BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;\n\nclass BaseChatModelGroq extends BaseChatModel {\n readonly version = \"v1\" as const;\n modelSchema: ChatModelSchemaType;\n readonly modelName: string;\n\n private readonly groqApiKey: string;\n\n constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType) {\n const parsedOptions = BaseChatModelOptions.parse(options);\n const baseUrl = Groq.baseUrl;\n super(modelSchema, {\n modelName: parsedOptions.modelName,\n apiKey: parsedOptions.apiKey,\n baseUrl: baseUrl,\n completeChatUrl: `${baseUrl}/chat/completions`,\n streamChatUrl: `${baseUrl}/chat/completions`,\n });\n this.modelSchema = modelSchema;\n this.modelName = parsedOptions.modelName;\n this.groqApiKey = parsedOptions.apiKey;\n }\n\n transformMessages(messages: MessageType[]): ParamsType {\n const hasSystemRole = messages.some((msg) => msg.role === \"system\");\n const hasImageModality = messages.some((msg) => msg.content.some((content: any) => content.modality === \"image\"));\n\n if (hasSystemRole && hasImageModality) {\n throw new InvalidMessagesError({\n info: `Invalid message content for model : '${this.modelName}'`,\n cause: new Error(\"Prompting with images is incompatible with system messages`)\"),\n });\n }\n\n const transformedMessages = super.transformMessages(messages) as { messages: OpenAIChatRequestMessageType[] };\n\n // Groq expects the content to be a string for system and assistant messages\n // OpenAI transformer takes care of validating role and modality\n transformedMessages.messages.forEach((message) => {\n if (message.role === \"system\") {\n if (typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n } else if (message.role === \"assistant\") {\n if (message.content && typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n }\n });\n\n return transformedMessages;\n }\n}\n\nexport { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType };\n","import { CHAT_CONFIG, MultiStringConfigItem, RangeConfigItem, SelectStringConfigItem } from \"@adaline/provider\";\n\nconst temperature = RangeConfigItem({\n param: \"temperature\",\n title: CHAT_CONFIG.TEMPERATURE.title,\n description: CHAT_CONFIG.TEMPERATURE.description,\n min: 0,\n max: 2,\n step: 0.01,\n default: 1,\n});\n\nconst maxTokens = (maxOutputTokens: number) =>\n RangeConfigItem({\n param: \"max_tokens\",\n title: CHAT_CONFIG.MAX_TOKENS.title,\n description: CHAT_CONFIG.MAX_TOKENS.description,\n min: 0,\n max: maxOutputTokens,\n step: 1,\n default: 0,\n });\n\nconst stop = MultiStringConfigItem({\n param: \"stop\",\n title: CHAT_CONFIG.STOP(4).title,\n description: CHAT_CONFIG.STOP(4).description,\n max: 4,\n});\n\nconst topP = RangeConfigItem({\n param: \"top_p\",\n title: CHAT_CONFIG.TOP_P.title,\n description: CHAT_CONFIG.TOP_P.description,\n min: 0,\n max: 1,\n step: 0.01,\n default: 1,\n});\n\nconst frequencyPenalty = RangeConfigItem({\n param: \"frequency_penalty\",\n title: CHAT_CONFIG.FREQUENCY_PENALTY.title,\n description: CHAT_CONFIG.FREQUENCY_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst presencePenalty = RangeConfigItem({\n param: \"presence_penalty\",\n title: CHAT_CONFIG.PRESENCE_PENALTY.title,\n description: CHAT_CONFIG.PRESENCE_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst seed = RangeConfigItem({\n param: \"seed\",\n title: CHAT_CONFIG.SEED.title,\n description: CHAT_CONFIG.SEED.description,\n min: 0,\n max: 1000000,\n step: 1,\n default: 0,\n});\n\nconst responseFormat = SelectStringConfigItem({\n param: \"response_format\",\n title: CHAT_CONFIG.RESPONSE_FORMAT.title,\n description: CHAT_CONFIG.RESPONSE_FORMAT.description,\n default: \"text\",\n choices: [\"text\", \"json_object\"],\n});\n\nconst toolChoice = SelectStringConfigItem({\n param: \"tool_choice\",\n title: \"Tool choice\",\n description:\n \"Controls which (if any) tool is called by the model. \\\n 'none' means the model will not call a function. \\\n 'auto' means the model can pick between generating a message or calling a tool.\",\n default: \"auto\",\n choices: [\"auto\", \"required\", \"none\"],\n});\n\nexport { frequencyPenalty, maxTokens, presencePenalty, seed, stop, temperature, toolChoice, topP, responseFormat };\n","import { z } from \"zod\";\n\nimport {\n frequencyPenalty,\n maxTokens,\n presencePenalty,\n responseFormat,\n seed,\n stop,\n temperature,\n toolChoice,\n topP,\n} from \"./common.config.chat-model.groq\";\n\nconst ChatModelBaseConfigSchema = (maxOutputTokens: number) =>\n z.object({\n temperature: temperature.schema,\n maxTokens: maxTokens(maxOutputTokens).schema,\n stop: stop.schema,\n topP: topP.schema,\n frequencyPenalty: frequencyPenalty.schema,\n presencePenalty: presencePenalty.schema,\n seed: seed.schema.transform((value) => (value === 0 ? undefined : value)),\n responseFormat: responseFormat.schema,\n toolChoice: toolChoice.schema,\n });\n\nconst ChatModelBaseConfigDef = (maxOutputTokens: number) =>\n ({\n temperature: temperature.def,\n maxTokens: maxTokens(maxOutputTokens).def,\n stop: stop.def,\n topP: topP.def,\n frequencyPenalty: frequencyPenalty.def,\n presencePenalty: presencePenalty.def,\n seed: seed.def,\n responseFormat: responseFormat.def,\n toolChoice: toolChoice.def,\n }) as const;\n\nexport { ChatModelBaseConfigDef, ChatModelBaseConfigSchema };\n","import { ChatModelBaseConfigDef, ChatModelBaseConfigSchema } from \"./chat-model\";\n\nconst GroqChatModelConfigs = {\n base: (maxOutputTokens: number) => ({\n def: ChatModelBaseConfigDef(maxOutputTokens),\n schema: ChatModelBaseConfigSchema(maxOutputTokens),\n }),\n} as const;\n\nexport { GroqChatModelConfigs };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma2_9b_ITLiteral = \"gemma2-9b-it\" as const;\n// https://huggingface.co/google/gemma-2-9b-it\nconst Gemma2_9b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma2_9b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma2_9b_ITLiteral,\n description: Gemma2_9b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma2_9b_ITOptions = BaseChatModelOptions;\ntype Gemma2_9b_ITOptionsType = z.infer<typeof Gemma2_9b_ITOptions>;\n\nclass Gemma2_9b_IT extends BaseChatModelGroq {\n constructor(options: Gemma2_9b_ITOptionsType) {\n super(Gemma2_9b_ITSchema, options);\n }\n}\n\nexport { Gemma2_9b_IT, Gemma2_9b_ITOptions, Gemma2_9b_ITSchema, Gemma2_9b_ITLiteral, type Gemma2_9b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_8bLiteral = \"llama-3.1-8b-instant\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_8bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_8bLiteral,\n description: Llama_3_1_8bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_8b_Options = BaseChatModelOptions;\ntype Llama_3_1_8b_OptionsType = z.infer<typeof Llama_3_1_8b_Options>;\n\nclass Llama_3_1_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_8b_OptionsType) {\n super(Llama_3_1_8bSchema, options);\n }\n}\n\nexport { Llama_3_1_8b, Llama_3_1_8b_Options, Llama_3_1_8bSchema, Llama_3_1_8bLiteral, type Llama_3_1_8b_OptionsType };\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_11b_VisionLiteral = \"llama-3.2-11b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-11B-Vision\nconst Llama_3_2_11b_VisionDescription =\n \"The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, \\\n and answering general questions about an image. \\\n The models outperform many of the available open source and closed multimodal models on common industry benchmarks.\";\n\nconst Llama_3_2_11b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_11b_VisionLiteral,\n description: Llama_3_2_11b_VisionDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_11b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_11b_VisionOptionsType = z.infer<typeof Llama_3_2_11b_VisionOptions>;\n\nclass Llama_3_2_11b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_11b_VisionOptionsType) {\n super(Llama_3_2_11b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n Llama_3_2_11b_VisionLiteral,\n type Llama_3_2_11b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_1bLiteral = \"llama-3.2-1b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-1B\nconst Llama_3_2_1bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_1bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_1bLiteral,\n description: Llama_3_2_1bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_1b_Options = BaseChatModelOptions;\ntype Llama_3_2_1b_OptionsType = z.infer<typeof Llama_3_2_1b_Options>;\n\nclass Llama_3_2_1b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_1b_OptionsType) {\n super(Llama_3_2_1bSchema, options);\n }\n}\n\nexport { Llama_3_2_1b, Llama_3_2_1b_Options, Llama_3_2_1bSchema, Llama_3_2_1bLiteral, type Llama_3_2_1b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_3bLiteral = \"llama-3.2-3b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-3B\nconst Llama_3_2_3bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_3bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_3bLiteral,\n description: Llama_3_2_3bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_3b_Options = BaseChatModelOptions;\ntype Llama_3_2_3b_OptionsType = z.infer<typeof Llama_3_2_3b_Options>;\n\nclass Llama_3_2_3b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_3b_OptionsType) {\n super(Llama_3_2_3bSchema, options);\n }\n}\n\nexport { Llama_3_2_3b, Llama_3_2_3b_Options, Llama_3_2_3bSchema, Llama_3_2_3bLiteral, type Llama_3_2_3b_OptionsType };\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_90b_VisionLiteral = \"llama-3.2-90b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-90B-Vision\nconst Llama_3_2_90b_VisionDescription =\n \"The Llama 3.2-90B Vision instruction-tuned models are optimized for advanced visual recognition, \\\n complex image reasoning, detailed captioning, and answering intricate questions about images. \\\n These models achieve state-of-the-art results on multiple industry benchmarks for multimodal tasks.\";\n\nconst Llama_3_2_90b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_90b_VisionLiteral,\n description: Llama_3_2_90b_VisionDescription,\n maxInputTokens: 131072,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_90b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_90b_VisionOptionsType = z.infer<typeof Llama_3_2_90b_VisionOptions>;\n\nclass Llama_3_2_90b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_90b_VisionOptionsType) {\n super(Llama_3_2_90b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_90b_Vision,\n Llama_3_2_90b_VisionLiteral,\n Llama_3_2_90b_VisionOptions,\n Llama_3_2_90b_VisionSchema,\n type Llama_3_2_90b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70bLiteral = \"llama3-70b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct\nconst Llama_3_70bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70bLiteral,\n description: Llama_3_70bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70bOptions = BaseChatModelOptions;\ntype Llama_3_70bOptionsType = z.infer<typeof Llama_3_70bOptions>;\n\nclass Llama_3_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_70bOptionsType) {\n super(Llama_3_70bSchema, options);\n }\n}\n\nexport { Llama_3_70b, Llama_3_70bOptions, Llama_3_70bSchema, Llama_3_70bLiteral, type Llama_3_70bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8bLiteral = \"llama3-8b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct\nconst Llama_3_8bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8bLiteral,\n description: Llama_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8bOptions = BaseChatModelOptions;\ntype Llama_3_8bOptionsType = z.infer<typeof Llama_3_8bOptions>;\n\nclass Llama_3_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_8bOptionsType) {\n super(Llama_3_8bSchema, options);\n }\n}\n\nexport { Llama_3_8b, Llama_3_8bOptions, Llama_3_8bSchema, Llama_3_8bLiteral, type Llama_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst LlamaGuard_3_8bLiteral = \"llama-guard-3-8b\" as const;\n// https://huggingface.co/meta-llama/Llama-Guard-3-8B\nconst LlamaGuard_3_8bDescription = \"Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.\";\n\nconst LlamaGuard_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: LlamaGuard_3_8bLiteral,\n description: LlamaGuard_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst LlamaGuard_3_8bOptions = BaseChatModelOptions;\ntype LlamaGuard_3_8bOptionsType = z.infer<typeof LlamaGuard_3_8bOptions>;\n\nclass LlamaGuard_3_8b extends BaseChatModelGroq {\n constructor(options: LlamaGuard_3_8bOptionsType) {\n super(LlamaGuard_3_8bSchema, options);\n }\n}\n\nexport { LlamaGuard_3_8b, LlamaGuard_3_8bOptions, LlamaGuard_3_8bSchema, LlamaGuard_3_8bLiteral, type LlamaGuard_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport { ChatModelSchemaType, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderError, ProviderV1 } from \"@adaline/provider\";\n\nimport * as Models from \"../models\";\n\nconst ProviderLiteral = \"groq\";\nclass Groq<C extends Models.BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {\n readonly version = \"v1\" as const;\n readonly name = ProviderLiteral;\n static readonly baseUrl = \"https://api.groq.com/openai/v1\";\n\n private readonly chatModelFactories: Record<\n string,\n {\n model: { new (options: any): ChatModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: ChatModelSchemaType;\n }\n > = {\n [Models.Gemma2_9b_ITLiteral]: {\n model: Models.Gemma2_9b_IT,\n modelOptions: Models.Gemma2_9b_ITOptions,\n modelSchema: Models.Gemma2_9b_ITSchema,\n },\n [Models.LlamaGuard_3_8bLiteral]: {\n model: Models.LlamaGuard_3_8b,\n modelOptions: Models.LlamaGuard_3_8bOptions,\n modelSchema: Models.LlamaGuard_3_8bSchema,\n },\n [Models.Llama_3_8bLiteral]: {\n model: Models.Llama_3_8b,\n modelOptions: Models.Llama_3_8bOptions,\n modelSchema: Models.Llama_3_8bSchema,\n },\n [Models.Llama_3_70bLiteral]: {\n model: Models.Llama_3_70b,\n modelOptions: Models.Llama_3_70bOptions,\n modelSchema: Models.Llama_3_70bSchema,\n },\n [Models.Llama_3_1_8bLiteral]: {\n model: Models.Llama_3_1_8b,\n modelOptions: Models.Llama_3_1_8b_Options,\n modelSchema: Models.Llama_3_1_8bSchema,\n },\n [Models.Llama_3_2_11b_VisionLiteral]: {\n model: Models.Llama_3_2_11b_Vision,\n modelOptions: Models.Llama_3_2_11b_VisionOptions,\n modelSchema: Models.Llama_3_2_11b_VisionSchema,\n },\n [Models.Llama_3_2_90b_VisionLiteral]: {\n model: Models.Llama_3_2_90b_Vision,\n modelOptions: Models.Llama_3_2_90b_VisionOptions,\n modelSchema: Models.Llama_3_2_90b_VisionSchema,\n },\n [Models.Llama_3_2_3bLiteral]: {\n model: Models.Llama_3_2_3b,\n modelOptions: Models.Llama_3_2_3b_Options,\n modelSchema: Models.Llama_3_2_3bSchema,\n },\n [Models.Llama_3_2_1bLiteral]: {\n model: Models.Llama_3_2_1b,\n modelOptions: Models.Llama_3_2_1b_Options,\n modelSchema: Models.Llama_3_2_1bSchema,\n },\n };\n\n private readonly embeddingModelFactories: Record<\n string,\n {\n model: { new (options: any): EmbeddingModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: EmbeddingModelSchemaType;\n }\n > = {};\n\n chatModelLiterals(): string[] {\n return Object.keys(this.chatModelFactories);\n }\n\n chatModelSchemas(): Record<string, ChatModelSchemaType> {\n return Object.keys(this.chatModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.chatModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, ChatModelSchemaType>\n );\n }\n\n chatModel(options: C): ChatModelV1 {\n const modelName = options.modelName;\n if (!(modelName in this.chatModelFactories)) {\n throw new ProviderError({\n info: `Groq chat model: ${modelName} not found`,\n cause: new Error(`Groq chat model: ${modelName} not found, available chat models: \n ${this.chatModelLiterals().join(\", \")}`),\n });\n }\n\n const model = this.chatModelFactories[modelName].model;\n const parsedOptions = this.chatModelFactories[modelName].modelOptions.parse(options);\n return new model(parsedOptions);\n }\n\n embeddingModelLiterals(): string[] {\n return Object.keys(this.embeddingModelFactories);\n }\n\n embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType> {\n return Object.keys(this.embeddingModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.embeddingModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, EmbeddingModelSchemaType>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n embeddingModel(options: E): EmbeddingModelV1 {\n throw new ProviderError({\n info: \"Groq does not support embedding models yet\",\n cause: new Error(\"Groq does not support embedding models yet\"),\n });\n }\n}\n\nexport { Groq };\n"]}
1
+ {"version":3,"sources":["../src/models/pricing.json","../src/models/chat-models/base-chat-model.groq.ts","../src/configs/chat-model/common.config.chat-model.groq.ts","../src/configs/chat-model/base.config.chat-model.groq.ts","../src/configs/configs.groq.ts","../src/models/chat-models/gemma2-9b-it.groq.ts","../src/models/chat-models/llama-3-1-8b.groq.ts","../src/models/chat-models/llama-3-2-11b-vision.groq.ts","../src/models/chat-models/llama-3-2-1b.groq.ts","../src/models/chat-models/llama-3-2-3b.groq.ts","../src/models/chat-models/llama-3-2-90b-vision.groq.ts","../src/models/chat-models/llama-3-70b.groq.ts","../src/models/chat-models/llama-3-8b.groq.ts","../src/models/chat-models/llama-guard-3-8b.groq.ts","../src/provider/provider.groq.ts"],"names":["pricing_default","BaseChatModelOptions","z","BaseChatModelGroq","BaseChatModel","modelSchema","options","parsedOptions","baseUrl","Groq","messages","hasSystemRole","msg","hasImageModality","content","InvalidMessagesError","transformedMessages","message","ModelResponseError","temperature","RangeConfigItem","CHAT_CONFIG","maxTokens","maxOutputTokens","stop","MultiStringConfigItem","topP","frequencyPenalty","presencePenalty","seed","responseFormat","SelectStringConfigItem","toolChoice","ChatModelBaseConfigSchema","value","ChatModelBaseConfigDef","GroqChatModelConfigs","Gemma2_9b_ITLiteral","Gemma2_9b_ITDescription","Gemma2_9b_ITSchema","ChatModelSchema","OpenAIChatModelRoles","OpenAIChatModelTextToolModalitiesEnum","OpenAIChatModelRolesMap","OpenAIChatModelTextToolModalities","Gemma2_9b_ITOptions","Gemma2_9b_IT","Llama_3_1_8bLiteral","Llama_3_1_8bDescription","Llama_3_1_8bSchema","Llama_3_1_8b_Options","Llama_3_1_8b","Llama_3_2_11b_VisionLiteral","Llama_3_2_11b_VisionDescription","Llama_3_2_11b_VisionSchema","OpenAIChatModelModalitiesEnum","OpenAIChatModelModalities","Llama_3_2_11b_VisionOptions","Llama_3_2_11b_Vision","Llama_3_2_1bLiteral","Llama_3_2_1bDescription","Llama_3_2_1bSchema","Llama_3_2_1b_Options","Llama_3_2_1b","Llama_3_2_3bLiteral","Llama_3_2_3bDescription","Llama_3_2_3bSchema","Llama_3_2_3b_Options","Llama_3_2_3b","Llama_3_2_90b_VisionLiteral","Llama_3_2_90b_VisionDescription","Llama_3_2_90b_VisionSchema","Llama_3_2_90b_VisionOptions","Llama_3_2_90b_Vision","Llama_3_70bLiteral","Llama_3_70bDescription","Llama_3_70bSchema","Llama_3_70bOptions","Llama_3_70b","Llama_3_8bLiteral","Llama_3_8bDescription","Llama_3_8bSchema","Llama_3_8bOptions","Llama_3_8b","LlamaGuard_3_8bLiteral","LlamaGuard_3_8bDescription","LlamaGuard_3_8bSchema","LlamaGuard_3_8bOptions","LlamaGuard_3_8b","ProviderLiteral","acc","key","modelName","ProviderError","model"],"mappings":";;;;AAAA,IAAAA,CAAAA,CAAA,CACE,cAAA,CAAgB,CACd,SAAA,CAAa,eACb,QAAY,CAAA,KAAA,CACZ,YAAe,CACb,CACE,UAAa,CACb,CAAA,SAAA,CAAa,KACb,MAAU,CAAA,CACR,KAAQ,CACN,oBAAA,CAAwB,GACxB,qBAAyB,CAAA,EAC3B,CACF,CACF,CACF,CACF,CAAA,CACA,sBAAwB,CAAA,CACtB,UAAa,sBACb,CAAA,QAAA,CAAY,MACZ,WAAe,CAAA,CACb,CACE,SAAa,CAAA,CAAA,CACb,UAAa,IACb,CAAA,MAAA,CAAU,CACR,IAAQ,CAAA,CACN,qBAAwB,GACxB,CAAA,qBAAA,CAAyB,GAC3B,CACF,CACF,CACF,CACF,CACA,CAAA,8BAAA,CAAgC,CAC9B,SAAa,CAAA,8BAAA,CACb,SAAY,KACZ,CAAA,WAAA,CAAe,CACb,CACE,SAAA,CAAa,CACb,CAAA,SAAA,CAAa,IACb,CAAA,MAAA,CAAU,CACR,IAAQ,CAAA,CACN,qBAAwB,GACxB,CAAA,qBAAA,CAAyB,GAC3B,CACF,CACF,CACF,CACF,CACA,CAAA,sBAAA,CAAwB,CACtB,SAAa,CAAA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K,CAAA,uBAAuB,CACjD,CAEA,qBAAA,EAAkE,CAChE,OAAO,OAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CAAE,CAAA,MAAA,CAC/C,CAACmF,CAAKC,CAAAA,CAAAA,IACJD,CAAIC,CAAAA,CAAG,EAAI,IAAK,CAAA,uBAAA,CAAwBA,CAAG,CAAE,CAAA,WAAA,CACtCD,GAET,EACF,CACF,CAGA,eAAepF,CAA8B,CAAA,CAC3C,MAAM,IAAIuF,aAAAA,CAAc,CACtB,IAAM,CAAA,4CAAA,CACN,MAAO,IAAI,KAAA,CAAM,4CAA4C,CAC/D,CAAC,CACH,CACF,EAvHMpF,EAGY,OAAU,CAAA,gCAAA","file":"index.mjs","sourcesContent":["{\n \"gemma2-9b-it\": {\n \"modelName\": \"gemma2-9b-it\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.2,\n \"outputPricePerMillion\": 0.2\n }\n }\n }\n ]\n },\n \"llama-3.1-8b-instant\": {\n \"modelName\": \"llama-3.1-8b-instant\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.05,\n \"outputPricePerMillion\": 0.08\n }\n }\n }\n ]\n },\n \"llama-3.2-11b-vision-preview\": {\n \"modelName\": \"llama-3.2-11b-vision-preview\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.18,\n \"outputPricePerMillion\": 0.18\n }\n }\n }\n ]\n },\n \"llama-3.2-1b-preview\": {\n \"modelName\": \"llama-3.2-1b-preview\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.04,\n \"outputPricePerMillion\": 0.04\n }\n }\n }\n ]\n },\n \"llama-3.2-3b-preview\": {\n \"modelName\": \"llama-3.2-3b-preview\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.06,\n \"outputPricePerMillion\": 0.06\n }\n }\n }\n ]\n },\n \"llama-3.2-90b-vision-preview\": {\n \"modelName\": \"llama-3.2-90b-vision-preview\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.7,\n \"outputPricePerMillion\": 0.8\n }\n }\n }\n ]\n },\n \"llama3-70b-8192\": {\n \"modelName\": \"llama3-70b-8192\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.59,\n \"outputPricePerMillion\": 0.79\n }\n }\n }\n ]\n },\n \"llama3-8b-8192\": {\n \"modelName\": \"llama3-8b-8192\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.05,\n \"outputPricePerMillion\": 0.08\n }\n }\n }\n ]\n },\n \"llama-guard-3-8b\": {\n \"modelName\": \"llama-guard-3-8b\",\n \"currency\": \"USD\",\n \"tokenRanges\": [\n {\n \"minTokens\": 0,\n \"maxTokens\": null,\n \"prices\": {\n \"base\": {\n \"inputPricePerMillion\": 0.2,\n \"outputPricePerMillion\": 0.2\n }\n }\n }\n ]\n }\n}\n","import { z } from \"zod\";\n\nimport { BaseChatModel, OpenAIChatRequestMessageType } from \"@adaline/openai\";\nimport { ChatModelSchemaType, InvalidMessagesError, ModelResponseError, ParamsType } from \"@adaline/provider\";\nimport { ChatModelPriceType, MessageType } from \"@adaline/types\";\n\nimport { Groq } from \"../../provider\";\nimport pricingData from \"../pricing.json\";\n\nconst BaseChatModelOptions = z.object({\n modelName: z.string().min(1),\n apiKey: z.string().min(1),\n});\ntype BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;\n\nclass BaseChatModelGroq extends BaseChatModel {\n readonly version = \"v1\" as const;\n modelSchema: ChatModelSchemaType;\n readonly modelName: string;\n\n private readonly groqApiKey: string;\n\n constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType) {\n const parsedOptions = BaseChatModelOptions.parse(options);\n const baseUrl = Groq.baseUrl;\n super(modelSchema, {\n modelName: parsedOptions.modelName,\n apiKey: parsedOptions.apiKey,\n baseUrl: baseUrl,\n completeChatUrl: `${baseUrl}/chat/completions`,\n streamChatUrl: `${baseUrl}/chat/completions`,\n });\n this.modelSchema = modelSchema;\n this.modelName = parsedOptions.modelName;\n this.groqApiKey = parsedOptions.apiKey;\n }\n\n transformMessages(messages: MessageType[]): ParamsType {\n const hasSystemRole = messages.some((msg) => msg.role === \"system\");\n const hasImageModality = messages.some((msg) => msg.content.some((content: any) => content.modality === \"image\"));\n\n if (hasSystemRole && hasImageModality) {\n throw new InvalidMessagesError({\n info: `Invalid message content for model : '${this.modelName}'`,\n cause: new Error(\"Prompting with images is incompatible with system messages`)\"),\n });\n }\n\n const transformedMessages = super.transformMessages(messages) as { messages: OpenAIChatRequestMessageType[] };\n\n // Groq expects the content to be a string for system and assistant messages\n // OpenAI transformer takes care of validating role and modality\n transformedMessages.messages.forEach((message) => {\n if (message.role === \"system\") {\n if (typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n } else if (message.role === \"assistant\") {\n if (message.content && typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n }\n });\n\n return transformedMessages;\n }\n getModelPricing(): ChatModelPriceType {\n // Check if the modelName exists in pricingData before accessing it\n if (!(this.modelName in pricingData)) {\n throw new ModelResponseError({\n info: `Invalid model pricing for model : '${this.modelName}'`,\n cause: new Error(`No pricing configuration found for model \"${this.modelName}\"`),\n });\n }\n\n const entry = pricingData[this.modelName as keyof typeof pricingData];\n return entry as ChatModelPriceType;\n }\n}\n\nexport { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType };\n","import { CHAT_CONFIG, MultiStringConfigItem, RangeConfigItem, SelectStringConfigItem } from \"@adaline/provider\";\n\nconst temperature = RangeConfigItem({\n param: \"temperature\",\n title: CHAT_CONFIG.TEMPERATURE.title,\n description: CHAT_CONFIG.TEMPERATURE.description,\n min: 0,\n max: 2,\n step: 0.01,\n default: 1,\n});\n\nconst maxTokens = (maxOutputTokens: number) =>\n RangeConfigItem({\n param: \"max_tokens\",\n title: CHAT_CONFIG.MAX_TOKENS.title,\n description: CHAT_CONFIG.MAX_TOKENS.description,\n min: 0,\n max: maxOutputTokens,\n step: 1,\n default: 0,\n });\n\nconst stop = MultiStringConfigItem({\n param: \"stop\",\n title: CHAT_CONFIG.STOP(4).title,\n description: CHAT_CONFIG.STOP(4).description,\n max: 4,\n});\n\nconst topP = RangeConfigItem({\n param: \"top_p\",\n title: CHAT_CONFIG.TOP_P.title,\n description: CHAT_CONFIG.TOP_P.description,\n min: 0,\n max: 1,\n step: 0.01,\n default: 1,\n});\n\nconst frequencyPenalty = RangeConfigItem({\n param: \"frequency_penalty\",\n title: CHAT_CONFIG.FREQUENCY_PENALTY.title,\n description: CHAT_CONFIG.FREQUENCY_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst presencePenalty = RangeConfigItem({\n param: \"presence_penalty\",\n title: CHAT_CONFIG.PRESENCE_PENALTY.title,\n description: CHAT_CONFIG.PRESENCE_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst seed = RangeConfigItem({\n param: \"seed\",\n title: CHAT_CONFIG.SEED.title,\n description: CHAT_CONFIG.SEED.description,\n min: 0,\n max: 1000000,\n step: 1,\n default: 0,\n});\n\nconst responseFormat = SelectStringConfigItem({\n param: \"response_format\",\n title: CHAT_CONFIG.RESPONSE_FORMAT.title,\n description: CHAT_CONFIG.RESPONSE_FORMAT.description,\n default: \"text\",\n choices: [\"text\", \"json_object\"],\n});\n\nconst toolChoice = SelectStringConfigItem({\n param: \"tool_choice\",\n title: \"Tool choice\",\n description:\n \"Controls which (if any) tool is called by the model. \\\n 'none' means the model will not call a function. \\\n 'auto' means the model can pick between generating a message or calling a tool.\",\n default: \"auto\",\n choices: [\"auto\", \"required\", \"none\"],\n});\n\nexport { frequencyPenalty, maxTokens, presencePenalty, seed, stop, temperature, toolChoice, topP, responseFormat };\n","import { z } from \"zod\";\n\nimport {\n frequencyPenalty,\n maxTokens,\n presencePenalty,\n responseFormat,\n seed,\n stop,\n temperature,\n toolChoice,\n topP,\n} from \"./common.config.chat-model.groq\";\n\nconst ChatModelBaseConfigSchema = (maxOutputTokens: number) =>\n z.object({\n temperature: temperature.schema,\n maxTokens: maxTokens(maxOutputTokens).schema,\n stop: stop.schema,\n topP: topP.schema,\n frequencyPenalty: frequencyPenalty.schema,\n presencePenalty: presencePenalty.schema,\n seed: seed.schema.transform((value) => (value === 0 ? undefined : value)),\n responseFormat: responseFormat.schema,\n toolChoice: toolChoice.schema,\n });\n\nconst ChatModelBaseConfigDef = (maxOutputTokens: number) =>\n ({\n temperature: temperature.def,\n maxTokens: maxTokens(maxOutputTokens).def,\n stop: stop.def,\n topP: topP.def,\n frequencyPenalty: frequencyPenalty.def,\n presencePenalty: presencePenalty.def,\n seed: seed.def,\n responseFormat: responseFormat.def,\n toolChoice: toolChoice.def,\n }) as const;\n\nexport { ChatModelBaseConfigDef, ChatModelBaseConfigSchema };\n","import { ChatModelBaseConfigDef, ChatModelBaseConfigSchema } from \"./chat-model\";\n\nconst GroqChatModelConfigs = {\n base: (maxOutputTokens: number) => ({\n def: ChatModelBaseConfigDef(maxOutputTokens),\n schema: ChatModelBaseConfigSchema(maxOutputTokens),\n }),\n} as const;\n\nexport { GroqChatModelConfigs };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma2_9b_ITLiteral = \"gemma2-9b-it\" as const;\n// https://huggingface.co/google/gemma-2-9b-it\nconst Gemma2_9b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma2_9b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma2_9b_ITLiteral,\n description: Gemma2_9b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n price: pricingData[Gemma2_9b_ITLiteral],\n});\n\nconst Gemma2_9b_ITOptions = BaseChatModelOptions;\ntype Gemma2_9b_ITOptionsType = z.infer<typeof Gemma2_9b_ITOptions>;\n\nclass Gemma2_9b_IT extends BaseChatModelGroq {\n constructor(options: Gemma2_9b_ITOptionsType) {\n super(Gemma2_9b_ITSchema, options);\n }\n}\n\nexport { Gemma2_9b_IT, Gemma2_9b_ITLiteral, Gemma2_9b_ITOptions, Gemma2_9b_ITSchema, type Gemma2_9b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_8bLiteral = \"llama-3.1-8b-instant\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_8bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_8bLiteral,\n description: Llama_3_1_8bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_1_8bLiteral],\n});\n\nconst Llama_3_1_8b_Options = BaseChatModelOptions;\ntype Llama_3_1_8b_OptionsType = z.infer<typeof Llama_3_1_8b_Options>;\n\nclass Llama_3_1_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_8b_OptionsType) {\n super(Llama_3_1_8bSchema, options);\n }\n}\n\nexport { Llama_3_1_8b, Llama_3_1_8b_Options, Llama_3_1_8bLiteral, Llama_3_1_8bSchema, type Llama_3_1_8b_OptionsType };\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_11b_VisionLiteral = \"llama-3.2-11b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-11B-Vision\nconst Llama_3_2_11b_VisionDescription =\n \"The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, \\\n and answering general questions about an image. \\\n The models outperform many of the available open source and closed multimodal models on common industry benchmarks.\";\n\nconst Llama_3_2_11b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_11b_VisionLiteral,\n description: Llama_3_2_11b_VisionDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_2_11b_VisionLiteral],\n});\n\nconst Llama_3_2_11b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_11b_VisionOptionsType = z.infer<typeof Llama_3_2_11b_VisionOptions>;\n\nclass Llama_3_2_11b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_11b_VisionOptionsType) {\n super(Llama_3_2_11b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionLiteral,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n type Llama_3_2_11b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_1bLiteral = \"llama-3.2-1b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-1B\nconst Llama_3_2_1bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_1bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_1bLiteral,\n description: Llama_3_2_1bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_2_1bLiteral],\n});\n\nconst Llama_3_2_1b_Options = BaseChatModelOptions;\ntype Llama_3_2_1b_OptionsType = z.infer<typeof Llama_3_2_1b_Options>;\n\nclass Llama_3_2_1b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_1b_OptionsType) {\n super(Llama_3_2_1bSchema, options);\n }\n}\n\nexport { Llama_3_2_1b, Llama_3_2_1b_Options, Llama_3_2_1bLiteral, Llama_3_2_1bSchema, type Llama_3_2_1b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_3bLiteral = \"llama-3.2-3b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-3B\nconst Llama_3_2_3bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_3bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_3bLiteral,\n description: Llama_3_2_3bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_2_3bLiteral],\n});\n\nconst Llama_3_2_3b_Options = BaseChatModelOptions;\ntype Llama_3_2_3b_OptionsType = z.infer<typeof Llama_3_2_3b_Options>;\n\nclass Llama_3_2_3b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_3b_OptionsType) {\n super(Llama_3_2_3bSchema, options);\n }\n}\n\nexport { Llama_3_2_3b, Llama_3_2_3b_Options, Llama_3_2_3bLiteral, Llama_3_2_3bSchema, type Llama_3_2_3b_OptionsType };\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_90b_VisionLiteral = \"llama-3.2-90b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-90B-Vision\nconst Llama_3_2_90b_VisionDescription =\n \"The Llama 3.2-90B Vision instruction-tuned models are optimized for advanced visual recognition, \\\n complex image reasoning, detailed captioning, and answering intricate questions about images. \\\n These models achieve state-of-the-art results on multiple industry benchmarks for multimodal tasks.\";\n\nconst Llama_3_2_90b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_90b_VisionLiteral,\n description: Llama_3_2_90b_VisionDescription,\n maxInputTokens: 131072,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n price: pricingData[Llama_3_2_90b_VisionLiteral],\n});\n\nconst Llama_3_2_90b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_90b_VisionOptionsType = z.infer<typeof Llama_3_2_90b_VisionOptions>;\n\nclass Llama_3_2_90b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_90b_VisionOptionsType) {\n super(Llama_3_2_90b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_90b_Vision,\n Llama_3_2_90b_VisionLiteral,\n Llama_3_2_90b_VisionOptions,\n Llama_3_2_90b_VisionSchema,\n type Llama_3_2_90b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70bLiteral = \"llama3-70b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct\nconst Llama_3_70bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70bLiteral,\n description: Llama_3_70bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n price: pricingData[Llama_3_70bLiteral],\n});\n\nconst Llama_3_70bOptions = BaseChatModelOptions;\ntype Llama_3_70bOptionsType = z.infer<typeof Llama_3_70bOptions>;\n\nclass Llama_3_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_70bOptionsType) {\n super(Llama_3_70bSchema, options);\n }\n}\n\nexport { Llama_3_70b, Llama_3_70bLiteral, Llama_3_70bOptions, Llama_3_70bSchema, type Llama_3_70bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8bLiteral = \"llama3-8b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct\nconst Llama_3_8bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8bLiteral,\n description: Llama_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n price: pricingData[Llama_3_8bLiteral],\n});\n\nconst Llama_3_8bOptions = BaseChatModelOptions;\ntype Llama_3_8bOptionsType = z.infer<typeof Llama_3_8bOptions>;\n\nclass Llama_3_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_8bOptionsType) {\n super(Llama_3_8bSchema, options);\n }\n}\n\nexport { Llama_3_8b, Llama_3_8bLiteral, Llama_3_8bOptions, Llama_3_8bSchema, type Llama_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport pricingData from \"../pricing.json\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst LlamaGuard_3_8bLiteral = \"llama-guard-3-8b\" as const;\n// https://huggingface.co/meta-llama/Llama-Guard-3-8B\nconst LlamaGuard_3_8bDescription = \"Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.\";\n\nconst LlamaGuard_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: LlamaGuard_3_8bLiteral,\n description: LlamaGuard_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n price: pricingData[LlamaGuard_3_8bLiteral],\n});\n\nconst LlamaGuard_3_8bOptions = BaseChatModelOptions;\ntype LlamaGuard_3_8bOptionsType = z.infer<typeof LlamaGuard_3_8bOptions>;\n\nclass LlamaGuard_3_8b extends BaseChatModelGroq {\n constructor(options: LlamaGuard_3_8bOptionsType) {\n super(LlamaGuard_3_8bSchema, options);\n }\n}\n\nexport { LlamaGuard_3_8b, LlamaGuard_3_8bLiteral, LlamaGuard_3_8bOptions, LlamaGuard_3_8bSchema, type LlamaGuard_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport { ChatModelSchemaType, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderError, ProviderV1 } from \"@adaline/provider\";\n\nimport * as Models from \"../models\";\n\nconst ProviderLiteral = \"groq\";\nclass Groq<C extends Models.BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {\n readonly version = \"v1\" as const;\n readonly name = ProviderLiteral;\n static readonly baseUrl = \"https://api.groq.com/openai/v1\";\n\n private readonly chatModelFactories: Record<\n string,\n {\n model: { new (options: any): ChatModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: ChatModelSchemaType;\n }\n > = {\n [Models.Gemma2_9b_ITLiteral]: {\n model: Models.Gemma2_9b_IT,\n modelOptions: Models.Gemma2_9b_ITOptions,\n modelSchema: Models.Gemma2_9b_ITSchema,\n },\n [Models.LlamaGuard_3_8bLiteral]: {\n model: Models.LlamaGuard_3_8b,\n modelOptions: Models.LlamaGuard_3_8bOptions,\n modelSchema: Models.LlamaGuard_3_8bSchema,\n },\n [Models.Llama_3_8bLiteral]: {\n model: Models.Llama_3_8b,\n modelOptions: Models.Llama_3_8bOptions,\n modelSchema: Models.Llama_3_8bSchema,\n },\n [Models.Llama_3_70bLiteral]: {\n model: Models.Llama_3_70b,\n modelOptions: Models.Llama_3_70bOptions,\n modelSchema: Models.Llama_3_70bSchema,\n },\n [Models.Llama_3_1_8bLiteral]: {\n model: Models.Llama_3_1_8b,\n modelOptions: Models.Llama_3_1_8b_Options,\n modelSchema: Models.Llama_3_1_8bSchema,\n },\n [Models.Llama_3_2_11b_VisionLiteral]: {\n model: Models.Llama_3_2_11b_Vision,\n modelOptions: Models.Llama_3_2_11b_VisionOptions,\n modelSchema: Models.Llama_3_2_11b_VisionSchema,\n },\n [Models.Llama_3_2_90b_VisionLiteral]: {\n model: Models.Llama_3_2_90b_Vision,\n modelOptions: Models.Llama_3_2_90b_VisionOptions,\n modelSchema: Models.Llama_3_2_90b_VisionSchema,\n },\n [Models.Llama_3_2_3bLiteral]: {\n model: Models.Llama_3_2_3b,\n modelOptions: Models.Llama_3_2_3b_Options,\n modelSchema: Models.Llama_3_2_3bSchema,\n },\n [Models.Llama_3_2_1bLiteral]: {\n model: Models.Llama_3_2_1b,\n modelOptions: Models.Llama_3_2_1b_Options,\n modelSchema: Models.Llama_3_2_1bSchema,\n },\n };\n\n private readonly embeddingModelFactories: Record<\n string,\n {\n model: { new (options: any): EmbeddingModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: EmbeddingModelSchemaType;\n }\n > = {};\n\n chatModelLiterals(): string[] {\n return Object.keys(this.chatModelFactories);\n }\n\n chatModelSchemas(): Record<string, ChatModelSchemaType> {\n return Object.keys(this.chatModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.chatModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, ChatModelSchemaType>\n );\n }\n\n chatModel(options: C): ChatModelV1 {\n const modelName = options.modelName;\n if (!(modelName in this.chatModelFactories)) {\n throw new ProviderError({\n info: `Groq chat model: ${modelName} not found`,\n cause: new Error(`Groq chat model: ${modelName} not found, available chat models: \n ${this.chatModelLiterals().join(\", \")}`),\n });\n }\n\n const model = this.chatModelFactories[modelName].model;\n const parsedOptions = this.chatModelFactories[modelName].modelOptions.parse(options);\n return new model(parsedOptions);\n }\n\n embeddingModelLiterals(): string[] {\n return Object.keys(this.embeddingModelFactories);\n }\n\n embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType> {\n return Object.keys(this.embeddingModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.embeddingModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, EmbeddingModelSchemaType>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n embeddingModel(options: E): EmbeddingModelV1 {\n throw new ProviderError({\n info: \"Groq does not support embedding models yet\",\n cause: new Error(\"Groq does not support embedding models yet\"),\n });\n }\n}\n\nexport { Groq };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaline/groq",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "private": false,
@@ -46,9 +46,9 @@
46
46
  ],
47
47
  "dependencies": {
48
48
  "zod": "^3.23.8",
49
- "@adaline/provider": "0.23.0",
50
- "@adaline/types": "0.21.0",
51
- "@adaline/openai": "0.29.0"
49
+ "@adaline/provider": "0.25.0",
50
+ "@adaline/types": "0.23.0",
51
+ "@adaline/openai": "0.31.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@adaline/tsconfig": "0.11.0",
@@ -60,7 +60,7 @@
60
60
  "lint": "eslint . --ext js,jsx,ts,tsx",
61
61
  "format": "prettier --write .",
62
62
  "post": "npm publish --access public",
63
- "test": "jest",
64
- "test:watch": "jest --watch"
63
+ "test": "vitest run",
64
+ "test:watch": "vitest watch"
65
65
  }
66
66
  }