PromptBusPromptBus

Configuration

PromptBus is configured via a YAML file at config/rules.yaml. This file controls all routing behavior, model mappings, and system settings.


Default Configuration

config/rules.yaml
version: 1
enabled: true
default_model: claude-sonnet-5

routes:
  - when:
      task_type: read_explain
      min_confidence: 0.6
    use:
      model: claude-haiku-4-5
      effort: low

  - when:
      task_type: small_edit
    use:
      model: claude-sonnet-5
      effort: medium

  - when:
      task_type: multi_file_refactor
    never_downgrade: true

  - when:
      task_type: planning
    never_downgrade: true

  - when:
      task_type: debug_loop
    never_downgrade: true

  - when:
      task_type: test_generation
    use:
      model: claude-sonnet-5
      effort: medium

  - when:
      task_type: unknown
    never_downgrade: true

confidence_floor_for_any_downgrade: 0.6
log_retention_days: 90
log_request_bodies: false

Configuration Fields

Top-Level Settings

FieldTypeDefaultDescription
versionnumber1Config schema version
enabledbooleantrueMaster toggle for routing logic
default_modelstringclaude-sonnet-5Fallback model when no rule matches
confidence_floor_for_any_downgradenumber0.6Minimum confidence to allow any downgrade (0.0–1.0)
log_retention_daysnumber90Days to keep logs before auto-pruning
log_request_bodiesbooleanfalseStore full request bodies in logs

Route Rules

Each route rule has a when condition and either a use action or never_downgrade: true.

When Conditions

FieldTypeDescription
task_typestringOne of: read_explain, small_edit, multi_file_refactor, planning, debug_loop, test_generation, unknown
min_confidencenumber (optional)Minimum confidence threshold for this rule (0.0–1.0)

Use Action

FieldTypeDescription
modelstringTarget model ID (e.g., claude-haiku-4-5)
effortstringOutput effort level: low, medium, or high

Pricing Configuration

Pricing data is stored in the same YAML file under the pricing key. This is used for savings calculations in the dashboard.

config/rules.yaml (pricing section)
pricing:
  claude-fable-5:
    input_per_mtok: 10
    output_per_mtok: 50
  claude-mythos-5:
    input_per_mtok: 8
    output_per_mtok: 40
  claude-opus-4-8:
    input_per_mtok: 5
    output_per_mtok: 25
  claude-sonnet-5:
    input_per_mtok: 3
    output_per_mtok: 15
  claude-haiku-4-5:
    input_per_mtok: 1
    output_per_mtok: 5

Editing from the Dashboard

You can also edit routing rules directly from the PromptBus dashboard at http://localhost:4702. The dashboard provides:

  • A dropdown to select task type
  • Text input for target model
  • Dropdown for effort level
  • Checkbox for never_downgrade
  • Advanced settings (confidence floor, log retention, log bodies)

Changes made in the dashboard are validated before being written to the YAML file.