Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/internal/llmtests/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (account *ComprehensiveTestAccount) GetKeysForProvider(ctx context.Context,
UseForBatchAPI: bifrost.Ptr(true),
},
{
Models: []string{"cohere.embed-v4:0", "amazon.nova-canvas-v1:0"},
Models: []string{"cohere.embed-v4:0", "amazon.nova-canvas-v1:0", "anthropic.claude-sonnet-4-20250514-v1:0"},
Weight: 1.0,
BedrockKeyConfig: &schemas.BedrockKeyConfig{
AccessKey: *schemas.NewEnvVar("env.AWS_ACCESS_KEY_ID"),
Expand Down
10 changes: 5 additions & 5 deletions core/internal/llmtests/prompt_caching.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func RunPromptCachingTest(t *testing.T, client *bifrost.Bifrost, ctx context.Con
// For the second query (index 1), add cached tokens validation
if i == 1 {
expectations.ProviderSpecific = map[string]interface{}{
"min_cached_tokens_percentage": 0.90, // 90% minimum
"min_cached_tokens_percentage": 0.80, // 80% minimum
"query_index": i,
}
}
Expand Down Expand Up @@ -421,17 +421,17 @@ func RunPromptCachingTest(t *testing.T, client *bifrost.Bifrost, ctx context.Con
t.Logf(" ℹ️ First request has %d cached tokens (cache from previous test run)", cachedTokens)
}
} else if i == 1 {
// Query 2: Verify cached tokens are >90% of prompt tokens
// Query 2: Verify cached tokens are >80% of prompt tokens
// This validation is also done in the retry framework, but we verify here as well
if promptTokens > 0 {
cachedPercentage := float64(cachedTokens) / float64(promptTokens)
t.Logf(" Cached tokens percentage: %.2f%%", cachedPercentage*100)

require.GreaterOrEqual(t, cachedPercentage, 0.90,
"Query 2 should have at least 90%% cached tokens (got %.2f%%, cached: %d, prompt: %d)",
require.GreaterOrEqual(t, cachedPercentage, 0.80,
"Query 2 should have at least 80%% cached tokens (got %.2f%%, cached: %d, prompt: %d)",
cachedPercentage*100, cachedTokens, promptTokens)

t.Logf(" ✅ Cached tokens percentage: %.2f%% (>= 90%%)", cachedPercentage*100)
t.Logf(" ✅ Cached tokens percentage: %.2f%% (>= 80%%)", cachedPercentage*100)
} else {
t.Fatalf("Prompt tokens is 0, cannot calculate cached percentage")
}
Expand Down
1 change: 1 addition & 0 deletions core/providers/bedrock/bedrock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func TestBedrock(t *testing.T) {
Fallbacks: []schemas.Fallback{
{Provider: schemas.Bedrock, Model: "claude-4-sonnet"},
{Provider: schemas.Bedrock, Model: "claude-4.5-sonnet"},
{Provider: schemas.Bedrock, Model: "anthropic.claude-sonnet-4-20250514-v1:0"}, // Used for count tokens
},
EmbeddingModel: "cohere.embed-v4:0",
RerankModel: rerankModelARN,
Expand Down