Classify text with the local model
local_classifyClassify text into user-supplied labels using a local Ollama model, validating replies against the label set and reporting matched labels or declined responses when no label fits.
Instructions
Put a piece of text into one of the labels you supply, using a local model. The reply is validated against your label set rather than trusted: if the model answers with something outside the list, or hedges between labels, this returns matched=false with the raw reply instead of guessing. By default the model may also answer that no label fits, which comes back as declined=true. That escape hatch helps but does not hold: a small model will still pick a confident in-set label for text that belongs to none of them, so a returned label is triage, not a verdict. Set allowNone=false only when a forced choice is genuinely wanted. Good for triage — log lines, error vs warning, which files look relevant, is this diff risky. Cheap and private; use it where a wrong answer is cheap for you to detect.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model tag. Defaults to qwen2.5-coder:7b. | |
| labels | Yes | Allowed labels. The answer is checked against these. | |
| content | Yes | The text to classify. | |
| allowNone | No | Default true: the model may reply that no label fits, returned as declined=true. Set false to force a choice, accepting that unrelated text will be mislabelled. | |
| instruction | No | Optional extra guidance, e.g. what the labels mean. |