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
6 changes: 4 additions & 2 deletions .github/workflows/daily-byok-ollama-test.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions .github/workflows/daily-byok-ollama-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ steps:
env:
OLLAMA_HOST: "0.0.0.0:11434"
run: |
sudo systemctl stop ollama 2>/dev/null || true
sleep 2
ollama serve &
echo "Waiting for Ollama service..."
for i in $(seq 1 30); do
Expand Down Expand Up @@ -95,8 +97,8 @@ sandbox:
sudo: false
models:
default-ai-credits-pricing:
input: 0
output: 0
input: 0.000001
output: 0.000001
Comment on lines +100 to +101
---

### Daily BYOK Endpoint Test
Expand Down
1 change: 1 addition & 0 deletions pkg/workflow/compiler_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func (c *Compiler) validateCoreToolConfiguration(workflowData *WorkflowData, mar
{logMessage: "Validating private-to-public-flows string value", validateFn: func() error { return validatePrivateToPublicFlowsStringValue(workflowData) }},
{logMessage: "Validating private-to-public-flows server IDs", validateFn: func() error { return validatePrivateToPublicFlowsServerIDs(workflowData) }},
{logMessage: "Validating GCP WIF engine auth required fields", validateFn: func() error { return validateGCPWIFEngineAuth(workflowData) }},
{logMessage: "Validating default AI credits pricing values", validateFn: func() error { return validateDefaultAiCreditsPricing(workflowData) }},
}
// This validation is intentionally outside the table below because strict mode
// turns the same validation result into either an error or a warning.
Expand Down
30 changes: 30 additions & 0 deletions pkg/workflow/model_costs_pricing_validation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package workflow

import "fmt"

// validateDefaultAiCreditsPricing returns an error when the workflow's
// models.default-ai-credits-pricing frontmatter is present and any price field
// has a non-positive value. Absent pricing (nil) is allowed; the check is only
// enforced once a value is explicitly configured.
//
// The AWF api-proxy rejects zero rates as "not configured", so requiring
// positive values here prevents silent runtime failures for self-hosted models.
func validateDefaultAiCreditsPricing(workflowData *WorkflowData) error {
p := workflowData.DefaultAiCreditsPricing
if p == nil {
return nil
}
if p.Input <= 0 {
return fmt.Errorf("models.default-ai-credits-pricing: input must be a positive value (got %g); use a small positive rate such as 0.000001 for effectively-free self-hosted models", p.Input)
}
if p.Output <= 0 {
return fmt.Errorf("models.default-ai-credits-pricing: output must be a positive value (got %g); use a small positive rate such as 0.000001 for effectively-free self-hosted models", p.Output)
}
if p.CachedInput != nil && *p.CachedInput <= 0 {
return fmt.Errorf("models.default-ai-credits-pricing: cache_read must be a positive value when set (got %g)", *p.CachedInput)
}
if p.CacheWrite != nil && *p.CacheWrite <= 0 {
return fmt.Errorf("models.default-ai-credits-pricing: cache_write must be a positive value when set (got %g)", *p.CacheWrite)
}
return nil
}
Loading
Loading