Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions website/docs/api/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,49 @@ semantic_router_pii_detections_total{action="block"} 23
semantic_router_jailbreak_attempts_total{action="block"} 5
```

### Reasoning Mode Metrics

The router exposes dedicated Prometheus counters to monitor reasoning mode decisions and template usage across model families. These metrics are emitted by the router and can be scraped by your Prometheus server.

- `llm_reasoning_decisions_total{category, model, enabled, effort}`
- Description: Count of reasoning decisions made per category and selected model, with whether reasoning was enabled and the applied effort level.
- Labels:
- category: category name determined during routing
- model: final selected model for the request
- enabled: "true" or "false" depending on the decision
- effort: effort level used when enabled (e.g., low|medium|high)

- `llm_reasoning_template_usage_total{family, param}`
- Description: Count of times a model-family-specific template parameter was applied to requests.
- Labels:
- family: normalized model family (e.g., qwen3, deepseek, gpt-oss, gpt)
- param: name of the template knob applied (e.g., enable_thinking, thinking, reasoning_effort)

- `llm_reasoning_effort_usage_total{family, effort}`
- Description: Count of times a reasoning effort level was set for a given model family.
- Labels:
- family: normalized model family
- effort: effort level (e.g., low|medium|high)

Example PromQL:

```prometheus
# Reasoning decisions by category and model (last 5m)
sum by (category, model, enabled, effort) (
rate(llm_reasoning_decisions_total[5m])
)

# Template usage by model family and parameter (last 5m)
sum by (family, param) (
rate(llm_reasoning_template_usage_total[5m])
)

# Effort distribution by model family (last 5m)
sum by (family, effort) (
rate(llm_reasoning_effort_usage_total[5m])
)
```

## gRPC ExtProc API

For direct integration with the ExtProc protocol:
Expand Down
Loading