Skip to content

symfonic.capabilities.prompting.counts

counts

What one prompt compile counted, as the integers a stage may publish.

Integers only (StageResult.counts): a count of what was admitted is publishable to an execution log; the prompt text is not.

These describe the contribution set the compiler admitted, using the compiler's own deterministic token estimate per contribution. They are not the provider's token count, not the length of the final system prompt (deployment instructions composed underneath are outside them), and not a claim of parity with any legacy figure.

prompt_counts

prompt_counts(compiled: CompiledPrompt) -> dict[str, int]

Counts read off compiled.budget; budget drops only, not gate exclusions.

Source code in src/symfonic/capabilities/prompting/counts.py
def prompt_counts(compiled: CompiledPrompt) -> dict[str, int]:
    """Counts read off ``compiled.budget``; budget drops only, not gate exclusions."""
    report = compiled.budget
    return {
        "admitted_contributions": len(report.admitted),
        "budget_dropped_contributions": len(report.dropped),
        "admitted_contribution_tokens": report.total_tokens,
    }