Skip to main content

intentusnet estimate

Estimate the cost, resources, and time for an intent execution before running it.

Synopsis

intentusnet estimate [options]

Options

OptionDescriptionRequired
--intent NAMEIntent name to estimateYes
--payload JSONJSON payload (inline or @file)No
--strategy STRATEGYRouting strategy to estimateNo
--include-fallbacksInclude fallback agent estimatesNo
--budget AMOUNTCheck against budget limitNo

Examples

Basic Estimate

intentusnet estimate --intent ProcessIntent --payload '{"document_id": "doc-123"}'

Output:

{
"intent": "ProcessIntent",
"estimated_agent": "processor-a",
"estimates": {
"time_ms": {
"min": 100,
"max": 500,
"typical": 200
},
"cost": {
"currency": "USD",
"min": 0.001,
"max": 0.005,
"typical": 0.002
},
"resources": {
"memory_mb": 256,
"cpu_units": 0.5
}
},
"confidence": "high",
"based_on": "historical_data",
"sample_size": 150
}

Include Fallback Estimates

intentusnet estimate --intent ProcessIntent --strategy fallback --include-fallbacks
{
"intent": "ProcessIntent",
"strategy": "FALLBACK",
"primary_agent": {
"name": "processor-a",
"estimates": {
"time_ms": {"typical": 200},
"cost": {"typical": 0.002}
}
},
"fallback_agents": [
{
"name": "processor-b",
"estimates": {
"time_ms": {"typical": 350},
"cost": {"typical": 0.003}
}
},
{
"name": "processor-c",
"estimates": {
"time_ms": {"typical": 500},
"cost": {"typical": 0.004}
}
}
],
"worst_case": {
"time_ms": 1050,
"cost": 0.009
}
}

Budget Check

intentusnet estimate --intent ExpensiveIntent --payload @large.json --budget 0.01

Within budget:

{
"intent": "ExpensiveIntent",
"estimates": {
"cost": {"typical": 0.005}
},
"budget": {
"limit": 0.01,
"estimated": 0.005,
"within_budget": true,
"margin": 0.005
}
}

Over budget:

{
"intent": "ExpensiveIntent",
"estimates": {
"cost": {"typical": 0.015}
},
"budget": {
"limit": 0.01,
"estimated": 0.015,
"within_budget": false,
"overage": 0.005
}
}

Exit code: 1 when over budget

Payload Size Estimate

intentusnet estimate --intent ProcessIntent --payload @large_document.json
{
"intent": "ProcessIntent",
"payload_analysis": {
"size_bytes": 1048576,
"size_human": "1 MB",
"field_count": 150,
"max_field_size": 524288
},
"estimates": {
"time_ms": {
"typical": 2000,
"note": "Larger payload increases processing time"
}
},
"warnings": [
"Payload size exceeds 100KB - consider chunking"
]
}

Estimate Sources

Estimates are based on:

SourceDescription
historical_dataPast executions of same intent
agent_metadataAgent-declared estimates
payload_heuristicEstimated from payload size
defaultDefault values (low confidence)

Confidence Levels

LevelMeaning
highBased on 100+ similar executions
mediumBased on 10-100 similar executions
lowBased on < 10 executions or heuristics
unknownNo data available, using defaults

Use Cases

Pre-Execution Validation

# Check before running expensive operation
ESTIMATE=$(intentusnet estimate --intent MLTraining --payload @config.json)
COST=$(echo "$ESTIMATE" | jq '.estimates.cost.typical')

if (( $(echo "$COST > 10.00" | bc -l) )); then
echo "Warning: Estimated cost is $COST"
read -p "Continue? [y/N] " confirm
[ "$confirm" = "y" ] || exit 1
fi

intentusnet run --intent MLTraining --payload @config.json

Budget Management

# Enforce budget limits
intentusnet estimate --intent ProcessIntent --payload @data.json --budget 0.05
if [ $? -eq 0 ]; then
intentusnet run --intent ProcessIntent --payload @data.json
else
echo "Operation exceeds budget"
fi

Capacity Planning

# Estimate batch job resources
for file in data/*.json; do
intentusnet estimate --intent ProcessIntent --payload @$file --format json
done | jq -s '
{
total_time_ms: [.[].estimates.time_ms.typical] | add,
total_cost: [.[].estimates.cost.typical] | add,
file_count: length
}
'

Exit Codes

CodeMeaning
0Success (or within budget)
1Over budget / estimation warning
2Invalid input
3No agent found

Limitations

Design Consideration

Cost estimation accuracy depends on historical data availability. For new intents or agents with limited history, estimates use heuristics and have lower confidence.

What estimates include:

  • Agent processing time
  • Declared resource requirements
  • Historical patterns

What estimates don't include:

  • External API costs (LLM calls, etc.)
  • Network latency variance
  • Cold start delays

See Also