-
Notifications
You must be signed in to change notification settings - Fork 672
Expand file tree
/
Copy pathaccount.go
More file actions
877 lines (865 loc) · 28 KB
/
account.go
File metadata and controls
877 lines (865 loc) · 28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
// Package testutil provides comprehensive test account and configuration management for the Bifrost system.
// It implements account functionality for testing purposes, supporting multiple AI providers
// and comprehensive test scenarios.
package testutil
import (
"context"
"fmt"
"os"
"time"
bifrost "github.com/maximhq/bifrost/core"
"github.com/maximhq/bifrost/core/schemas"
)
const Concurrency = 4
// ProviderOpenAICustom represents the custom OpenAI provider for testing
const ProviderOpenAICustom = schemas.ModelProvider("openai-custom")
// TestScenarios defines the comprehensive test scenarios
type TestScenarios struct {
TextCompletion bool
TextCompletionStream bool
SimpleChat bool
CompletionStream bool
MultiTurnConversation bool
ToolCalls bool
ToolCallsStreaming bool // Streaming tool calls functionality
MultipleToolCalls bool
End2EndToolCalling bool
AutomaticFunctionCall bool
ImageURL bool
ImageBase64 bool
MultipleImages bool
CompleteEnd2End bool
SpeechSynthesis bool // Text-to-speech functionality
SpeechSynthesisStream bool // Streaming text-to-speech functionality
Transcription bool // Speech-to-text functionality
TranscriptionStream bool // Streaming speech-to-text functionality
Embedding bool // Embedding functionality
Reasoning bool // Reasoning/thinking functionality via Responses API
ListModels bool // List available models functionality
ImageGeneration bool // Image generation functionality
ImageGenerationStream bool // Streaming image generation functionality
}
// ComprehensiveTestConfig extends TestConfig with additional scenarios
type ComprehensiveTestConfig struct {
Provider schemas.ModelProvider
TextModel string
ChatModel string
PromptCachingModel string
VisionModel string
ReasoningModel string
EmbeddingModel string
TranscriptionModel string
SpeechSynthesisModel string
Scenarios TestScenarios
Fallbacks []schemas.Fallback // for chat, responses, image and reasoning tests
TextCompletionFallbacks []schemas.Fallback // for text completion tests
TranscriptionFallbacks []schemas.Fallback // for transcription tests
SpeechSynthesisFallbacks []schemas.Fallback // for speech synthesis tests
EmbeddingFallbacks []schemas.Fallback // for embedding tests
SkipReason string // Reason to skip certain tests
ImageGenerationModel string // Model for image generation
ImageGenerationFallbacks []schemas.Fallback // Fallbacks for image generation
}
// ComprehensiveTestAccount provides a test implementation of the Account interface for comprehensive testing.
type ComprehensiveTestAccount struct{}
// getEnvWithDefault returns the value of the environment variable if set, otherwise returns the default value
func getEnvWithDefault(envVar, defaultValue string) string {
if value := os.Getenv(envVar); value != "" {
return value
}
return defaultValue
}
// GetConfiguredProviders returns the list of initially supported providers.
func (account *ComprehensiveTestAccount) GetConfiguredProviders() ([]schemas.ModelProvider, error) {
return []schemas.ModelProvider{
schemas.OpenAI,
schemas.Anthropic,
schemas.Bedrock,
schemas.Cohere,
schemas.Azure,
schemas.Vertex,
schemas.Ollama,
schemas.Mistral,
schemas.Groq,
schemas.SGL,
schemas.Parasail,
schemas.Elevenlabs,
schemas.Perplexity,
schemas.Cerebras,
schemas.Gemini,
schemas.OpenRouter,
ProviderOpenAICustom,
}, nil
}
// GetKeysForProvider returns the API keys and associated models for a given provider.
func (account *ComprehensiveTestAccount) GetKeysForProvider(ctx *context.Context, providerKey schemas.ModelProvider) ([]schemas.Key, error) {
switch providerKey {
case schemas.OpenAI:
return []schemas.Key{
{
Value: os.Getenv("OPENAI_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case ProviderOpenAICustom:
return []schemas.Key{
{
Value: os.Getenv("OPENAI_API_KEY"), // Use GROQ API key for OpenAI-compatible endpoint
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Anthropic:
return []schemas.Key{
{
Value: os.Getenv("ANTHROPIC_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Bedrock:
return []schemas.Key{
{
Models: []string{},
Weight: 1.0,
BedrockKeyConfig: &schemas.BedrockKeyConfig{
AccessKey: os.Getenv("AWS_ACCESS_KEY_ID"),
SecretKey: os.Getenv("AWS_SECRET_ACCESS_KEY"),
SessionToken: bifrost.Ptr(os.Getenv("AWS_SESSION_TOKEN")),
Region: bifrost.Ptr(getEnvWithDefault("AWS_REGION", "us-east-1")),
ARN: bifrost.Ptr(os.Getenv("AWS_ARN")),
Deployments: map[string]string{
"claude-sonnet-4": "global.anthropic.claude-sonnet-4-20250514-v1:0",
"claude-3.7-sonnet": "us.anthropic.claude-3-7-sonnet-20250219-v1:0",
},
},
},
{
Models: []string{"anthropic.claude-3-5-sonnet-20240620-v1:0", "cohere.embed-v4:0"},
Weight: 1.0,
BedrockKeyConfig: &schemas.BedrockKeyConfig{
AccessKey: os.Getenv("AWS_ACCESS_KEY_ID"),
SecretKey: os.Getenv("AWS_SECRET_ACCESS_KEY"),
SessionToken: bifrost.Ptr(os.Getenv("AWS_SESSION_TOKEN")),
Region: bifrost.Ptr(getEnvWithDefault("AWS_REGION", "us-east-1")),
},
},
}, nil
case schemas.Cohere:
return []schemas.Key{
{
Value: os.Getenv("COHERE_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Azure:
return []schemas.Key{
{
Value: os.Getenv("AZURE_API_KEY"),
Models: []string{},
Weight: 1.0,
AzureKeyConfig: &schemas.AzureKeyConfig{
Endpoint: os.Getenv("AZURE_ENDPOINT"),
Deployments: map[string]string{
"gpt-4o": "gpt-4o",
"gpt-4o-backup": "gpt-4o-3",
},
},
},
{
Value: os.Getenv("AZURE_EMB_API_KEY"),
Models: []string{},
Weight: 1.0,
AzureKeyConfig: &schemas.AzureKeyConfig{
Endpoint: os.Getenv("AZURE_EMB_ENDPOINT"),
Deployments: map[string]string{
"text-embedding-ada-002": "text-embedding-ada-002",
},
},
},
{
Value: os.Getenv("AZURE_API_KEY"),
Models: []string{},
Weight: 1.0,
AzureKeyConfig: &schemas.AzureKeyConfig{
Endpoint: os.Getenv("AZURE_ENDPOINT"),
Deployments: map[string]string{
"o1": "o1",
},
},
},
}, nil
case schemas.Vertex:
return []schemas.Key{
{
Value: os.Getenv("VERTEX_API_KEY"),
Models: []string{},
Weight: 1.0,
VertexKeyConfig: &schemas.VertexKeyConfig{
ProjectID: os.Getenv("VERTEX_PROJECT_ID"),
Region: getEnvWithDefault("VERTEX_REGION", "us-central1"),
AuthCredentials: os.Getenv("VERTEX_CREDENTIALS"),
},
},
}, nil
case schemas.Mistral:
return []schemas.Key{
{
Value: os.Getenv("MISTRAL_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Groq:
return []schemas.Key{
{
Value: os.Getenv("GROQ_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Parasail:
return []schemas.Key{
{
Value: os.Getenv("PARASAIL_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Elevenlabs:
return []schemas.Key{
{
Value: os.Getenv("ELEVENLABS_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Perplexity:
return []schemas.Key{
{
Value: os.Getenv("PERPLEXITY_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Cerebras:
return []schemas.Key{
{
Value: os.Getenv("CEREBRAS_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.Gemini:
return []schemas.Key{
{
Value: os.Getenv("GEMINI_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
case schemas.OpenRouter:
return []schemas.Key{
{
Value: os.Getenv("OPENROUTER_API_KEY"),
Models: []string{},
Weight: 1.0,
},
}, nil
default:
return nil, fmt.Errorf("unsupported provider: %s", providerKey)
}
}
// GetConfigForProvider returns the configuration settings for a given provider.
func (account *ComprehensiveTestAccount) GetConfigForProvider(providerKey schemas.ModelProvider) (*schemas.ProviderConfig, error) {
switch providerKey {
case schemas.OpenAI:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Higher retries for production-grade provider
RetryBackoffInitial: 500 * time.Millisecond,
RetryBackoffMax: 8 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: 10,
BufferSize: 10,
},
}, nil
case ProviderOpenAICustom:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
BaseURL: "https://api.openai.com",
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Higher retries for Groq (can be flaky)
RetryBackoffInitial: 1 * time.Second,
RetryBackoffMax: 10 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
CustomProviderConfig: &schemas.CustomProviderConfig{
BaseProviderType: schemas.OpenAI,
AllowedRequests: &schemas.AllowedRequests{
TextCompletion: false,
ChatCompletion: true,
ChatCompletionStream: true,
Embedding: false,
Speech: false,
SpeechStream: false,
Transcription: false,
TranscriptionStream: false,
},
},
}, nil
case schemas.Anthropic:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Claude is generally reliable
RetryBackoffInitial: 500 * time.Millisecond,
RetryBackoffMax: 8 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Bedrock:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // AWS services can have occasional issues
RetryBackoffInitial: 5 * time.Second,
RetryBackoffMax: 40 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Cohere:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Cohere can be variable
RetryBackoffInitial: 5 * time.Second,
RetryBackoffMax: 40 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Azure:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 600,
MaxRetries: 10,
RetryBackoffInitial: 20 * time.Second,
RetryBackoffMax: 3 * time.Minute,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Vertex:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Google Cloud is generally reliable
RetryBackoffInitial: 500 * time.Millisecond,
RetryBackoffMax: 8 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Ollama:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 8, // Local service, fewer retries needed
RetryBackoffInitial: 250 * time.Millisecond,
RetryBackoffMax: 4 * time.Second,
BaseURL: os.Getenv("OLLAMA_BASE_URL"),
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Mistral:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Mistral can be variable
RetryBackoffInitial: 5 * time.Second,
RetryBackoffMax: 5 * time.Minute,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Groq:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Groq can be flaky at times
RetryBackoffInitial: 1 * time.Second,
RetryBackoffMax: 15 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.SGL:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
BaseURL: os.Getenv("SGL_BASE_URL"),
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // SGL (self-hosted) can be variable
RetryBackoffInitial: 1 * time.Second,
RetryBackoffMax: 15 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Parasail:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Parasail can be variable
RetryBackoffInitial: 1 * time.Second,
RetryBackoffMax: 12 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Elevenlabs:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Elevenlabs can be variable
RetryBackoffInitial: 1 * time.Second,
RetryBackoffMax: 12 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Perplexity:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Perplexity can be variable
RetryBackoffInitial: 1 * time.Second,
RetryBackoffMax: 12 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Cerebras:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Cerebras is reasonably stable
RetryBackoffInitial: 5 * time.Second,
RetryBackoffMax: 3 * time.Minute,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
case schemas.Gemini:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // Gemini can be variable
RetryBackoffInitial: 750 * time.Millisecond,
RetryBackoffMax: 12 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 20,
},
}, nil
case schemas.OpenRouter:
return &schemas.ProviderConfig{
NetworkConfig: schemas.NetworkConfig{
DefaultRequestTimeoutInSeconds: 120,
MaxRetries: 10, // OpenRouter can be variable (proxy service)
RetryBackoffInitial: 1 * time.Second,
RetryBackoffMax: 12 * time.Second,
},
ConcurrencyAndBufferSize: schemas.ConcurrencyAndBufferSize{
Concurrency: Concurrency,
BufferSize: 10,
},
}, nil
default:
return nil, fmt.Errorf("unsupported provider: %s", providerKey)
}
}
// AllProviderConfigs contains test configurations for all providers
var AllProviderConfigs = []ComprehensiveTestConfig{
{
Provider: schemas.OpenAI,
ChatModel: "gpt-4o-mini",
TextModel: "", // OpenAI doesn't support text completion in newer models
ReasoningModel: "o1-mini", // OpenAI reasoning model
PromptCachingModel: "gpt-4.1",
TranscriptionModel: "whisper-1",
SpeechSynthesisModel: "tts-1",
Scenarios: TestScenarios{
TextCompletion: false, // Not supported
TextCompletionStream: false, // Not supported
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: true, // OpenAI supports TTS
SpeechSynthesisStream: true, // OpenAI supports streaming TTS
Transcription: true, // OpenAI supports STT with Whisper
TranscriptionStream: true, // OpenAI supports streaming STT
Embedding: true,
Reasoning: true, // OpenAI supports reasoning via o1 models
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.Anthropic, Model: "claude-3-7-sonnet-20250219"},
},
},
{
Provider: schemas.Anthropic,
ChatModel: "claude-3-7-sonnet-20250219",
TextModel: "", // Anthropic doesn't support text completion
Scenarios: TestScenarios{
TextCompletion: false, // Not supported
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported
SpeechSynthesisStream: false, // Not supported
Transcription: false, // Not supported
TranscriptionStream: false, // Not supported
Embedding: false,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.Bedrock,
ChatModel: "anthropic.claude-3-sonnet-20240229-v1:0",
TextModel: "", // Bedrock Claude doesn't support text completion
Scenarios: TestScenarios{
TextCompletion: false, // Not supported for Claude
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported
SpeechSynthesisStream: false, // Not supported
Transcription: false, // Not supported
TranscriptionStream: false, // Not supported
Embedding: true,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.Cohere,
ChatModel: "command-a-03-2025",
TextModel: "", // Cohere focuses on chat
Scenarios: TestScenarios{
TextCompletion: false, // Not typical for Cohere
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: false, // May not support automatic
ImageURL: false, // Check if supported
ImageBase64: false, // Check if supported
MultipleImages: false, // Check if supported
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported
SpeechSynthesisStream: false, // Not supported
Transcription: false, // Not supported
TranscriptionStream: false, // Not supported
Embedding: true,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.Azure,
ChatModel: "gpt-4o",
TextModel: "", // Azure OpenAI doesn't support text completion in newer models
Scenarios: TestScenarios{
TextCompletion: false, // Not supported
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported yet
SpeechSynthesisStream: false, // Not supported yet
Transcription: false, // Not supported yet
TranscriptionStream: false, // Not supported yet
Embedding: true,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.Vertex,
ChatModel: "gemini-pro",
TextModel: "", // Vertex focuses on chat
Scenarios: TestScenarios{
TextCompletion: false, // Not typical
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported
SpeechSynthesisStream: false, // Not supported
Transcription: false, // Not supported
TranscriptionStream: false, // Not supported
Embedding: true,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.Mistral,
ChatModel: "mistral-large-2411",
TextModel: "", // Mistral focuses on chat
Scenarios: TestScenarios{
TextCompletion: false, // Not typical
SimpleChat: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported
SpeechSynthesisStream: false, // Not supported
Transcription: false, // Not supported
TranscriptionStream: false, // Not supported
Embedding: true,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.Ollama,
ChatModel: "llama3.2",
TextModel: "", // Ollama focuses on chat
Scenarios: TestScenarios{
TextCompletion: false, // Not typical
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported
SpeechSynthesisStream: false, // Not supported
Transcription: false, // Not supported
TranscriptionStream: false, // Not supported
Embedding: false,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.Groq,
ChatModel: "llama-3.3-70b-versatile",
TextModel: "", // Groq doesn't support text completion
Scenarios: TestScenarios{
TextCompletion: false, // Not supported
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported
SpeechSynthesisStream: false, // Not supported
Transcription: false, // Not supported
TranscriptionStream: false, // Not supported
Embedding: false,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: ProviderOpenAICustom,
ChatModel: "llama-3.3-70b-versatile",
TextModel: "", // Custom OpenAI instance doesn't support text completion
Scenarios: TestScenarios{
TextCompletion: false,
SimpleChat: true, // Enable simple chat for testing
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: false,
ImageBase64: false,
MultipleImages: false,
CompleteEnd2End: true,
SpeechSynthesis: false, // Not supported
SpeechSynthesisStream: false, // Not supported
Transcription: false, // Not supported
TranscriptionStream: false, // Not supported
Embedding: false,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.Gemini,
ChatModel: "gemini-2.0-flash",
TextModel: "", // GenAI doesn't support text completion in newer models
TranscriptionModel: "gemini-2.5-flash",
SpeechSynthesisModel: "gemini-2.5-flash-preview-tts",
EmbeddingModel: "text-embedding-004",
Scenarios: TestScenarios{
TextCompletion: false, // Not supported
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: true,
SpeechSynthesisStream: true,
Transcription: true,
TranscriptionStream: true,
Embedding: true,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
{
Provider: schemas.OpenRouter,
ChatModel: "openai/gpt-4o",
TextModel: "google/gemini-2.5-flash",
Scenarios: TestScenarios{
TextCompletion: true,
SimpleChat: true,
CompletionStream: true,
MultiTurnConversation: true,
ToolCalls: true,
MultipleToolCalls: true,
End2EndToolCalling: true,
AutomaticFunctionCall: true,
ImageURL: true,
ImageBase64: true,
MultipleImages: true,
CompleteEnd2End: true,
SpeechSynthesis: false,
SpeechSynthesisStream: false,
Transcription: false,
TranscriptionStream: false,
Embedding: false,
ListModels: true,
},
Fallbacks: []schemas.Fallback{
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
},
},
}