← All documentation

Kernel limits reference

Warning: This file is auto-generated by mix ptc.gen_docs from the Kernel limit catalog. Manual edits will be overwritten. Edit lib/ptc_runner/kernel/limit_catalog.ex instead.

Ordinary limits are positive enforced ceilings. Optional limits are disabled when omitted by the host. Two documents decide an enabled number: the host document installs the outer ceiling and the application manifest may narrow it.

To raise a limit, edit limits in the manifest. Raising the installed ceiling alone moves the enforced value only while that ceiling is the binding one, and with the installed defaults listed below it is not: a host-only edit leaves the run at the effective default. A run that needs longer than the 30,000 ms run_duration_ms default therefore asks for it in the manifest — ptc.json — and nowhere else:

{ "limits": { "run_duration_ms": 120000, "workflow_timeout_ms": 120000 } }

Only when the application needs a value above the installed ceiling — here, above the 1,800,000 ms run_duration_ms ceiling — does the host document, ptc-host.json, need a matching edit, alongside the same request in the manifest:

{ "install": {}, "limits": { "run_duration_ms": 3600000 } }

The four heap and concurrency rows, and llm_request_timeout_ms, are the exceptions whose installed default equals their effective default. Heap rows stay there because live memory is live_provider_tasks multiplied by a heap ceiling. The LLM whole-call deadline stays there because applications may only narrow it; a host document owns any widening. Raising either exception requires both a host ceiling above the compiled default and a matching manifest request. A limits-only host document — {"install": {}, "limits": {...}} — is enough for heap and concurrency rows; it does not need a fabricated provider. A live LLM deadline also requires the selected installation's ceilings.request_timeout_ms to be raised to the requested value.

Normal trace limits also have structural rules. event_payload_bytes is at least 8,211: the largest run-stopped payload an application-free manifest can emit. An application that declares capabilities or missions needs more, and because that requirement is only known once providers are assembled it is refused when the run starts, as application/limit_capacity_invalid, naming the effective limit and the bytes it must reach. normal_event_count is at least 3: one ordinary run-started event plus the two-event terminal reserve. After host/application resolution, normal_event_bytes must be at least EventSink.terminal_reserve(:normal, effective_limits).bytes + EventBudget.maximum_event_bytes("run-started", event_payload_bytes), preserving one complete maximum-size run-started envelope in addition to the complete events-dropped and run-stopped envelopes. Invalid combinations are refused before execution as application/limit_configuration_invalid. Private trace policy keeps its zero terminal reserve and does not use this normal-trace byte relationship.

A breached ceiling names itself, its configured value, and the manifest key that raises it, so the error at the point of failure carries this rule too. A request above the ceiling is refused by name, with both numbers.

An agent loop spends two budgets at once, and only one of them is a clock. max_turns bounds the agent protocol: it limits how many model-and-program turns the loop may attempt, and reserves no elapsed time to finish them. The complete run, including active preflight and every provider wait, must fit inside run_duration_ms; the workflow evaluation that owns the loop must also fit inside workflow_timeout_ms. Raising only run_duration_ms leaves the workflow clock as a separate boundary, so a live agent requests explicit values for both from its expected turn count and model latency.

Time values are milliseconds. Heap values are BEAM process heap words, not bytes. The catalog range is the accepted structural range; practical installations should choose ceilings appropriate to their resources and trust boundary.

Application-narrowable limits

NameMeaningUnitEffective defaultInstalled defaultInclusive range
capability_argument_bytesEncoded arguments crossing a capability boundary.bytes262,1444,000,0001–2,592,000,000
capability_result_bytesEncoded result crossing a capability boundary.bytes1,000,00016,000,0001–2,592,000,000
entry_source_bytesWorkflow entry source accepted at the application boundary.bytes262,1444,000,0001–2,592,000,000
evaluation_admission_timeout_msWait for the single subordinate-evaluation lease before execution begins.milliseconds10,000600,0001–2,592,000,000
evaluation_heap_wordsHeap of each subordinate evaluator process.BEAM heap words1,250,0001,250,0001–2,592,000,000
evaluation_history_bytesEach value and the aggregate exact three-value continuation history.bytes1,000,00016,000,0001–2,592,000,000
evaluation_memory_bytesRetained mission definitions across successful turns.bytes2,000,00032,000,0001–2,592,000,000
evaluation_timeout_msOne subordinate mission evaluation, and one interactive REPL form.milliseconds30,000600,0001–2,592,000,000
event_payload_bytesOne trace event payload.bytes262,1444,000,0008,211–2,592,000,000
live_provider_tasksConcurrent provider callback processes and Kernel-owned parallel Lisp workers.count881–2,592,000,000
llm_request_output_tokensAuthorized output tokens for one live language-model call, supplied as that call's max_tokens.count4,09665,5361–1,000,000
llm_request_timeout_msWhole-call deadline for one live language-model request, including adapter work, retries, and structured output validation.milliseconds120,000120,000100–1,800,000
mission_capability_callsTotal mission capability calls in one run.count2564,0961–2,592,000,000
mission_capability_calls_per_nameMission capability calls to any one public name in one run.count1282,0481–2,592,000,000
normal_event_bytesAggregate encoded trace events retained under the normal policy.bytes4,000,00064,000,0001–2,592,000,000
normal_event_countTrace events retained under the normal policy.count2564,0963–2,592,000,000
parallel_timeout_msOne pmap or pcalls operation, clamped by the run deadline.milliseconds60,000600,0001–2,592,000,000
protocol_errorsRecoverable agent protocol errors in one run.count645121–2,592,000,000
provider_heap_wordsHeap of each provider callback process.BEAM heap words5,000,0005,000,0001–2,592,000,000
run_duration_msComplete ordinary run after optional provider application admission, including active preflight and Kernel execution.milliseconds30,0001,800,0001–2,592,000,000
subordinate_evaluationsSubordinate mission evaluations in one run.count1282,0481–2,592,000,000
subordinate_source_bytesSource accepted by one subordinate check or evaluation.bytes131,0722,000,0001–2,592,000,000
subordinate_source_checksAdvisory subordinate source checks in one run.count1282,0481–2,592,000,000
terminal_result_bytesEncoded terminal workflow or mission-session result.bytes1,000,00016,000,0001–2,592,000,000
workflow_capability_callsTotal workflow capability calls in one run.count2564,0961–2,592,000,000
workflow_capability_calls_per_nameWorkflow capability calls to any one public name in one run.count1282,0481–2,592,000,000
workflow_heap_wordsHeap of the workflow evaluator process.BEAM heap words8,000,0008,000,0001–2,592,000,000
workflow_timeout_msOne workflow evaluation.milliseconds30,0001,800,0001–2,592,000,000

Optional application-narrowable limits

These limits are disabled by an omitted host value. A positive host value enables the limit, becomes its inherited manifest default and installed ceiling, and may be narrowed by the manifest. A manifest cannot enable a host-disabled limit. Prerequisites, when listed, apply to every live LLM installation while that host limit is enabled.

NameMeaningUnitDisabled defaultInclusive range
evaluation_loop_iterationsOptional per-activation loop/tail-recur bound for one subordinate mission evaluation and one interactive REPL form.countnull1–2,592,000,000
llm_cost_microusdPre-dispatch USD reservation ceiling, in microunits, across live language-model calls in one run. Requires usage_guarantees.tokens: true, usage_guarantees.cost_currency: "USD", and an explicit USD reservation_tariff on every live LLM installation.countnull1–9,007,199,254,740,991
llm_total_tokensAggregate provider-counted input and output tokens authorized across live language-model calls in one run. Requires usage_guarantees.tokens: true on every live LLM installation.countnull1–9,007,199,254,740,991
workflow_loop_iterationsOptional per-activation loop/tail-recur bound for one workflow evaluation.countnull1–2,592,000,000

Size an LLM cost budget

llm_cost_microusd is a pre-dispatch reservation ceiling, not a pre-run price quote or a direct measurement of realized spend. Before each live call, PtcRunner computes a conservative, request-specific reservation from the request and accumulated conversation, the full authorized output-token allowance, and the model's pricing. Later calls can therefore require more headroom than earlier ones, and a ceiling set near expected final spend can refuse before any call is dispatched.

For example, after 62 microUSD has settled, a 2,400 microUSD ceiling has 2,338 remaining. If the next call requires a 2,419 microUSD reservation, it is refused with the exact diagnostic:

llm_cost_microusd limit 2400 microUSD would be exceeded: the next call requires a 2419 microUSD reservation with 2338 remaining; raise limits.llm_cost_microusd in the manifest, and the installed host ceiling if it is lower

Those numbers describe one request; their ratio to its eventual cost is not a sizing multiplier. ptc models, ptc validate, and ptc doctor do not provide a pre-run price quote. The optional cost budget is the fail-closed admission control, and a refusal reports the next call's exact required reservation.

Valid priced usage releases the unused reservation and charges actual cost. A dispatched call without trustworthy priced usage conservatively charges the full reservation and marks llm_budget.cost.state as incomplete; that charge is an accounting upper bound, not measured spend. When its state is available, llm_spend aggregates trustworthy priced usage from successful and failed calls. A possibly dispatched failure without trustworthy usage makes spend incomplete, because it can still incur unmeasured provider charges.

To reduce the output portion of future reservations, an application may narrow limits.llm_request_output_tokens, or a model installation may set a lower params.max_tokens. Lower either only when the smaller output allowance is valid for the workload; request and conversation size still contribute to each reservation.

Installed-only limits

These operational timeouts belong only to the host document. A manifest cannot declare them.

NameMeaningUnitInstalled defaultInclusive rangeEffective identity
doctor_connectivity_timeout_msOne doctor --connect provider health check.milliseconds10,000100–30,000no
local_preflight_timeout_msWhole audited local-preflight phase across selected providers.milliseconds5,000100–30,000yes
provider_cleanup_timeout_msKernel-owned provider cleanup after execution.milliseconds5,000100–30,000yes
selection_validation_timeout_msActive validation of selected provider declarations.milliseconds5,000100–30,000yes