What it does
TheX-Lectr-Task header tells Lectr what kind of work a request is doing.
Without it, Lectr guesses from signals like prompt length and response length — educated guesses, medium confidence. With it, Lectr knows with certainty and generates high-confidence model recommendations.
The five task types
| Value | Use when you’re… |
|---|---|
classification | Sorting input into categories — sentiment, intent, priority |
summarisation | Condensing content into a shorter form |
extraction | Pulling structured data out of unstructured text |
generation | Creating new content — copy, emails, code |
reasoning | Multi-step thinking, analysis, complex problem solving |
Values outside this list are stored as-is and visible in your dashboard but
don’t influence recommendations.
Adding the header
How Lectr uses it
Model recommendations
Task type is the highest-confidence signal in the recommendation engine — it overrides heuristic signals when present.| Task type | What Lectr does |
|---|---|
classification | Strong downgrade candidate — smaller models handle this well |
summarisation | Downgrade candidate — more conservative if prompts are long |
extraction | Downgrade candidate — conservative for complex nested extraction |
generation | Neutral — relies on other signals, not task type alone |
reasoning | Never recommended for downgrade. Ever. |
reasoning task.
Dashboard visibility
Task type appears as a column in your request logs table — you can see exactly which task type was tagged on each request and filter by it.Using with routing rules
Routing rules can use task type to automatically direct requests to the right model. For example:- run simple tasks on cheaper models
- reserve powerful models for complex reasoning
- optimize cost without changing application code
Reference
| Header | X-Lectr-Task |
|---|---|
| Required | No |
| Valid values | classification summarisation extraction generation reasoning |
| Invalid values | Stored as-is, no influence on recommendations |
| Missing | Request processed normally, heuristic signals used |
FAQ
Do I need X-Lectr-Feature to use X-Lectr-Task?
Do I need X-Lectr-Feature to use X-Lectr-Task?
No — they’re independent. But combining them gives Lectr the most context and
produces the most confident recommendations.
What if my feature does multiple task types?
What if my feature does multiple task types?
Override per request. A chat feature might use
reasoning for complex
questions and generation for drafting — tag each request with what it’s
actually doing.Does this affect my prompts or responses?
Does this affect my prompts or responses?
No. Lectr reads the header and stores it as metadata. Your prompt, model
choice, and response are untouched.
Does it add latency?
Does it add latency?
No. The header is read on ingress and stored after the request completes.
Zero hot path impact.