gliclass
3 TagsUpdated Apache-2.0by Knowledgator
Instruction-following zero-shot classifiers by Knowledgator: all options of a question are scored in one pass, so on a GPU the cost barely grows with the number of options; on a CPU it grows with them.
ollaya run gliclass --preset triage "I was charged twice for my subscription this month and want a refund."curl http://localhost:11435/api/decide \
-H "Content-Type: application/json" \
-d '{
"model": "gliclass",
"state": "I was charged twice for my subscription this month and want a refund.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices and refunds",
"technical": "Bugs, errors and outages",
"account": "Login, profile and settings"
}
},
"refund": {
"type": "noul",
"instructions": "Is the customer asking for a refund?"
}
}
}'# Already using a TypeSafe SDK? Set TYPESAFE_BASE_URL=http://localhost:11435 instead.
import requests
response = requests.post(
"http://localhost:11435/api/decide",
json={
"model": "gliclass",
"state": "I was charged twice for my subscription this month and want a refund.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this?",
"criteria": {
"billing": "Payments, invoices and refunds",
"technical": "Bugs, errors and outages",
"account": "Login, profile and settings"
}
},
"refund": {
"type": "noul",
"instructions": "Is the customer asking for a refund?"
}
}
},
)
answers = response.json()["answers"]
print(answers["department"]["choice"], answers["refund"]["noul"])const response = await fetch("http://localhost:11435/api/decide", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "gliclass",
state: "I was charged twice for my subscription this month and want a refund.",
questions: {
department: {
type: "choice",
instructions: "Which team should handle this?",
criteria: {
billing: "Payments, invoices and refunds",
technical: "Bugs, errors and outages",
account: "Login, profile and settings"
}
},
refund: {
type: "noul",
instructions: "Is the customer asking for a refund?"
}
}
}),
});
const { answers } = await response.json();
console.log(answers.department.choice, answers.refund.noul);Models
Every tag| Name | Accuracy | Latency | |||
|---|---|---|---|---|---|
| Most accurateHighest typed-decisions accuracy of the family. | |||||
| gliclass:v4-edgeGLiClass v4 Edge (DeBERTa-v3-large backbone, a calibrator on every label's score), Apache-2.0: 0.506 on typed decisions. | 0.506 | 16 ms | |||
| FasterFastest first; accuracy as measured on the bench. | |||||
| gliclass:largeGLiClass instruct large v1.0 (DeBERTa-v3-large backbone), Apache-2.0. | 0.477 | 14 ms | |||
| gliclasslatestSame as gliclass:large. | 0.477 | 14 ms | |||
Accuracy: typed-decisions, argmax against the majority label on 400 states (left out for a tag trained on that data). Latency: the median five-question request on an RTX 5090, Ollaya Bench.
Readme
GLiClass is a family of instruction-following zero-shot classifiers by Knowledgator. Ollaya writes a question's options as labels and its instructions as the task prompt, and the model scores all the labels in a single pass, so a question takes one pass however many options it has. Each label adds tokens to that pass, though, so a question with dozens of options takes many times as long as a yes/no one.
Models
| Tag | Backbone | Params | License | Typed-decisions accuracy |
|---|---|---|---|---|
gliclass:latest, gliclass:large | DeBERTa-v3-large | 439M | Apache-2.0 | 0.477 |
gliclass:v4-edge | DeBERTa-v3-large, with a calibrator | 440M | Apache-2.0 | 0.506 |
Accuracy is the argmax against the majority label on all 400 typed-decisions states. gliclass:v4-edge is Knowledgator's GLiClass v4 Edge, released in October 2026: it reads each label at its own marker and rescales every label's score with a small calibrator network. Its download is half the size of large's (0.88 GB, bf16). For comparison, nli scores 0.536 and laya:en 0.357.
Usage
ollaya run gliclass --preset triage "Your app crashed during checkout and I was charged twice. Please refund one of the charges."How it works
- One sequence per question. Label markers go first, then the task prompt, then the state, up to 1,024 tokens.
- Scoring. The graph pools every label (
large: its span;v4-edge: its marker token) and scores it against the text.v4-edge's calibrator then rescales each label's score, as Knowledgator's own pipeline does. - Mapping to question types. The mapping of
choice,scoreandnoulonto labels is Ollaya's, chosen by testing on typed-decisions. - Weights. They are Knowledgator's own
model.safetensors, downloaded from Hugging Face, pinned to a commit and verified by sha256. - Parity. Ollaya's Rust runtime matches the Python reference on CPU and CUDA: the same decision on every test question.
- Apple silicon.
largeruns on the GPU through MLX;v4-edgeruns on the CPU.
Limits
- Yes/no questions without criteria are its weakest point. Such a question is scored as one label with a sigmoid, and it can be confidently wrong. Give
noulquestionscriteriawith bothtrueandfalsedescriptions, or usenlifor them. - Option count. A question with more options than fit in 1,024 tokens is rejected with
TOO_MANY_OPTIONS. - Calibration.
largeis not calibrated.v4-edge's calibrator was trained by Knowledgator; its calibration error on typed decisions is 0.188, against 0.219 forlarge. Fit aCALIBRATIONlayer before you rely on thresholds.
Badge
For the model card or a README. Day-0 support for a new model
[](https://ollaya.dev/library/gliclass)