Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

chore(backend): seed block preflight estimates from 30d prod usage (#13074)

Zamil Majdye66b40b3698e
diff --git a/autogpt_platform/backend/backend/data/block_preflight_estimates.json b/autogpt_platform/backend/backend/data/block_preflight_estimates.json
index e9cfd525bd..db08baa40a 100644
--- a/autogpt_platform/backend/backend/data/block_preflight_estimates.json
+++ b/autogpt_platform/backend/backend/data/block_preflight_estimates.json
@@ -1,6 +1,61 @@
{
"version": 1,
- "generated_at": null,
- "source_window_days": null,
- "estimates": {}
+ "generated_at": "2026-05-11T08:29:28.322148+00:00",
+ "source_window_days": 30,
+ "estimates": {
+ "3b191d9f-356f-482d-8238-ba04b6d18381": {
+ "block_name": "OrchestratorBlock",
+ "cost_type": "cost_usd",
+ "samples": 3227,
+ "mean_credits": 6
+ },
+ "1f292d4a-41a4-4977-9684-7c8d560b9f91": {
+ "block_name": "AITextGeneratorBlock",
+ "cost_type": "cost_usd",
+ "samples": 2283,
+ "mean_credits": 4
+ },
+ "87840993-2053-44b7-8da4-187ad4ee518c": {
+ "block_name": "SearchTheWebBlock",
+ "cost_type": "cost_usd",
+ "samples": 1202,
+ "mean_credits": 1
+ },
+ "a0a69be1-4528-491c-a85a-a4ab6873e3f0": {
+ "block_name": "AITextSummarizerBlock",
+ "cost_type": "cost_usd",
+ "samples": 1105,
+ "mean_credits": 8
+ },
+ "c40d75a2-d0ea-44c9-a4f6-634bb3bdab1a": {
+ "block_name": "ReplicateModelBlock",
+ "cost_type": "cost_usd",
+ "samples": 633,
+ "mean_credits": 10
+ },
+ "0b02b072-abe7-11ef-8372-fb5d162dd712": {
+ "block_name": "ExecuteCodeBlock",
+ "cost_type": "second",
+ "samples": 63,
+ "mean_credits": 1
+ },
+ "9c0b0450-d199-458b-a731-072189dd6593": {
+ "block_name": "AIListGeneratorBlock",
+ "cost_type": "cost_usd",
+ "samples": 36,
+ "mean_credits": 5
+ },
+ "c8a5f2e9-8b3d-4a7e-9f6c-1d5e3c9b7a4f": {
+ "block_name": "PerplexityBlock",
+ "cost_type": "cost_usd",
+ "samples": 21,
+ "mean_credits": 5
+ },
+ "ed55ac19-356e-4243-a6cb-bc599e9b716f": {
+ "block_name": "AIStructuredResponseGeneratorBlock",
+ "cost_type": "cost_usd",
+ "samples": 16,
+ "mean_credits": 6
+ }
+ }
}
diff --git a/autogpt_platform/backend/backend/executor/billing_reconciliation_test.py b/autogpt_platform/backend/backend/executor/billing_reconciliation_test.py
index deb440cee2..e4db3f981f 100644
--- a/autogpt_platform/backend/backend/executor/billing_reconciliation_test.py
+++ b/autogpt_platform/backend/backend/executor/billing_reconciliation_test.py
@@ -10,9 +10,19 @@ from backend.blocks.jina.search import SearchTheWebBlock
from backend.data.block_cost_config import BLOCK_COSTS
from backend.data.execution import ExecutionContext, NodeExecutionEntry
from backend.data.model import NodeExecutionStats
+from backend.executor import utils as executor_utils
from backend.executor.billing import charge_reconciled_usage
[email protected](autouse=True)
+def _stub_preflight_estimate(monkeypatch):
+ """Force `get_preflight_estimate` to return 0 in this module's tests so
+ they don't accidentally couple to a populated
+ `block_preflight_estimates.json` once the admin export tool seeds it.
+ """
+ monkeypatch.setattr(executor_utils, "get_preflight_estimate", lambda _bid: 0)
+
+
@pytest.fixture
def tmp_block_costs_override():
original = BLOCK_COSTS.get(SearchTheWebBlock)