MCPcopy Create free account
hub / github.com/InferCore/InferCore / Estimate

Method Estimate

internal/cost/simple_engine.go:13–25  ·  view source on GitHub ↗
(req types.AIRequest, backend types.BackendMetadata)

Source from the content-addressed store, hash-verified

11}
12
13func (e *SimpleEngine) Estimate(req types.AIRequest, backend types.BackendMetadata) types.CostEstimate {
14 maxTokens := req.Options.MaxTokens
15 if maxTokens <= 0 {
16 maxTokens = 256
17 }
18
19 estimatedTotal := backend.CostUnit + (float64(maxTokens)/1000.0)*backend.CostUnit
20 return types.CostEstimate{
21 UnitCost: backend.CostUnit,
22 EstimatedTotal: estimatedTotal,
23 BudgetFit: true,
24 }
25}

Calls

no outgoing calls