Skip to main content

votum

A decision model on a fully open LLM backbone.

Model: Votum-8B on Hugging Face Training data: Votum-Pool on Hugging Face Python 3.11 or newer License: Apache-2.0

Quickstart · Request and response · Images · Server · Speed · Fine-tuning · Documentation

Votum turns Swiss flag Apertus-1.5-8B into a decision model. You give it some context (an email, a document, a JSON record, a photo), a question about it and the possible answers. It gives back a probability for each answer.

It does not write text. It reads the prompt once and scores the answers, so a short decision takes under 100 ms, the result is always one of your options, and the probabilities always sum to one.

Four requests answered by Votum-8B. An email about a double charge: team is Billing and payments (0.96), the customer asks for money back (0.90), urgency is medium (0.41). A JSON order record: the total is 65.0 (0.73), no discount was applied (0.91). A photo of a derailed locomotive: a locomotive derailed (0.46), people are at the scene (0.76), the damage is serious (0.47). A photo of a market in front of a church: a street market (0.76), fruit or vegetables are for sale (0.79), the large building is a church (0.79).

The open weights and the open dataset are on Hugging Face: Votum-8B, Votum-8B-FP8 (smaller) and the training data, Votum-Pool. This repository holds the code.

Quickstart

Requirements: Python 3.11 or newer and an NVIDIA GPU.

GPU memory Model Notes
24 GB or more votum-ai/Votum-8B the full model, a 16 GB download
16 GB votum-ai/Votum-8B-FP8 FP8-quantized weights, a 9 GB download; it gives the same answer as the full model 96 to 99 % of the time

1. Install the package.

pip install votum

2. Get access to the model. The model is gated: accept the Apertus Acceptable Use Policy on votum-ai/Votum-8B, then log in:

hf auth login

3. Run a request. The email from the figure above, with its three questions:

from votum import Votum

# On a 16 GB GPU, use "votum-ai/Votum-8B-FP8" instead.
vm = Votum.from_pretrained("votum-ai/Votum-8B")

request = {
    "state": "Hi, I was charged twice for my October invoice (INV-4411). Could you refund one of the two payments?",
    "questions": {
        "team": {
            "type": "choice",
            "instructions": "Which team should handle this ticket?",
            "criteria": {
                "billing": "Billing and payments",
                "tech": "Technical support",
                "sales": "Sales",
                "hr": "Human resources",
            },
        },
        "refund": {
            "type": "noul",
            "instructions": "Does the customer ask for money back?",
        },
        "urgency": {
            "type": "score",
            "instructions": "How urgent is this ticket?",
            "criteria": ["low", "medium", "high"],
        },
    },
}

out = vm.decide(request)

print(out["answers"])
{
    "team": {
        "type": "choice",
        "choice": "billing",
        "confidence": 0.9619,
        "probabilities": {
            "billing": 0.9619,
            "tech": 0.0079,
            "sales": 0.0243,
            "hr": 0.0059,
        },
    },
    "refund": {
        "type": "noul",
        "noul": 0.8994,
    },
    "urgency": {
        "type": "score",
        "score": 0.9621,
        "confidence": 0.4133,
        "legend": {
            "0": "low",
            "1": "medium",
            "2": "high",
        },
        "probabilities": {
            "0": 0.3123,
            "1": 0.4133,
            "2": 0.2744,
        },
    },
}

Votum returns probabilities, not just a label, so high-confidence answers can be acted on and the rest escalated.

Request and response

A request has two parts:

  • state: the context to decide on. A string, or any JSON object.
  • questions: up to 8 questions about that state, keyed by an id. They are answered together.

Every question has instructions (the question text), a type and, depending on the type, criteria:

type Use criteria
choice one of several options the options: {id: description}, or a list of ids
noul a yes/no question optional: {"true": description, "false": description}
score a rating on a scale the levels, lowest first

The answer to a question holds its type and these fields:

Field Returned for Value
choice choice id of the most likely option
noul noul probability that the answer is yes
score score expected level, counting from 0 (0.96 is close to level 1, the second one)
confidence choice, score probability of the most likely option or level
probabilities choice, score probability of every option or level
legend score level index to level text

Notes:

  • Option descriptions. {"billing": "Billing and payments"} works better than a bare "billing".
  • Languages. Votum was built for English, German, French and Italian; instructions can be in the language of the state or in English.
  • Context. The state, one question and its options must fit in 8,192 tokens. A longer request is refused with an error, never truncated.
  • Questions. The architecture puts no limit on the number of questions per request: each question is scored in its own pass over the shared state, so only a single question's prompt has to fit. The server accepts 64 per request by default (VOTUM_MAX_QUESTIONS).

The request format (noul, instructions, criteria) is that of Jev and Jeff, so their clients work unchanged.

Images

A state can hold images. Put one anywhere in it as {"image": ...}:

request = {
    "state": {
        "photo": {
            "image": "wreck.jpg",
        },
        "line": "mountain branch, km 41",
    },
    "questions": {
        "incident": {
            "type": "choice",
            "instructions": "What happened?",
            "criteria": {
                "derailment": "A locomotive derailed",
                "collision": "Two trains collided",
                "fire": "A fire",
                "none": "Nothing, normal operation",
            },
        },
    },
}

out = vm.decide(request)

In Python, the image can be a file path (as here), raw bytes, a PIL image or a base64 string. Over HTTP it must be base64-encoded, either plain or as a data URL ("data:image/png;base64,..."): the server never opens files or URLs named in a request.

This needs two more packages: pip install "votum[vision]".

Image support is a preview. Votum-8B was never trained on images: everyday photos work well, text inside scanned documents does not yet. docs/images.md has more examples, the measured accuracy and the settings.

Run it as a server

votum serve starts an HTTP server built on vLLM, which batches concurrent requests:

pip install "votum[vllm]"
votum serve --model votum-ai/Votum-8B --port 8011
curl -s localhost:8011/v1/systemone -H 'content-type: application/json' -d '{
  "state": "The printer on floor 3 is jammed again.",
  "questions": {
    "team": {
      "type": "choice",
      "instructions": "Which team?",
      "criteria": {
        "it": "IT support",
        "fac": "Facilities"
      }
    }
  }
}'

The endpoint takes the same request as vm.decide and returns the same answers. It follows Jev's System One API, so Jev clients work against it. docs/serving.md covers the API key, memory and the other settings.

Speed

Measured on one NVIDIA RTX 4090 (24 GB) with the full Votum-8B, running as a server:

Request Prompt tokens Latency Decisions/s, many requests at once
1 question about a short text ~450 ~40 ms 23.5
1 question about a long document ~3,000 ~320 ms 3.1
8 questions about a long document ~3,300 ~470 ms 15.8

Asking several questions about the same state at once is cheaper than asking them one by one, because the state is read only once. With eight questions per request, the long document gives 5 times as many decisions per second as with one.

For comparison, Apertus-1.5-8B generating the choice and its probabilities as structured output takes about 1.1 s for the short text, against about 40 ms. docs/benchmarks.md says exactly how each number was measured.

How good are the answers?

Accuracy on public test sets outside the training data:

Task Accuracy Accuracy among the most confident half
Yes/no questions about a passage (BoolQ) 88.9 % 98.2 %
Topic of a text, in 12 languages (SIB-200) 82.4 % 97.4 %
Customer intent among 77 options (BANKING77) 70.4 % 85.3 %
School and university exam questions (MMLU) 60.4 % 82.1 %

Accuracy is much higher on high-confidence answers, so the confidence can be used to route. The model card has the full evaluation and the limitations.

How it works

Votum is Apertus-1.5-8B with a LoRA adapter (rank 16, all 32 layers), a custom attention mask and a pointer head. The language-model head is not used: nothing is generated.

One request through the model in three panels: the prompt with header, state, questions and options; the attention mask between those blocks; the pointer-head formula z_j = <q_0, W_o LN(h_j)> / 16 with p_j = softmax(z / T)_j, and the score and probability of each option

1. One prompt. A request is rendered as a single prompt: a header that lists its questions, then the state, then each question with its options. Every option ends with an end token.

2. Custom attention mask. Eight of the 32 layers (3, 7, …, 31) attend in both directions; the other 24 are causal. On top of that, a block mask isolates the parts of the prompt:

  • the header does not attend to the state, and the state does not attend to the questions, so both are the same for every question of a request and are computed once;
  • an option attends to the header, the state and its own question, never to another option, and nothing outside an option attends to it;
  • all options of a question start at the same position id, so their order carries no signal.

The mask buys two things: answers that do not depend on the order of the options, and a header and state that are computed once and shared by every question of a request. It costs two: options cannot be weighed against each other (the model rarely picks "none of the above" when it is right), and the model only works with the votum loader, not with plain transformers or vLLM.

3. Pointer head. Option j gets a score zj from the final hidden state hj at its end token, and a softmax over the options of a question gives the probabilities pj (formula in the figure). q0 is a learned 256-dimensional query, Wo a 256 × 4096 projection, LN a layer norm, and T a temperature per question type, which can be recalibrated on your own data.

docs/internals.md covers the weights, the two implementations and how to reproduce the release.

Fine-tuning

training/README.md covers fine-tuning on your own data: prepare the rows, train from the released model, export the checkpoint and refit the calibration temperatures. One 24 GB GPU is enough.

Documentation

Page What is in it
docs/serving.md the HTTP server: API, API key, memory, settings
docs/images.md images in requests: set-up, examples, accuracy
docs/benchmarks.md speed measurements and how they were made
docs/internals.md how the model works inside, the repository layout, tests, reproducing the release
training/README.md fine-tuning on your own data

Acknowledgements

Votum builds on other people's work:

  • Apertus, by the Swiss AI Initiative (EPFL, ETH Zurich, CSCS): the open model underneath Votum.
  • Jev: the original decision models. Votum uses their request format (choice, noul, score).
  • Jeff, by Jonathan Geuter, Andrew Cheng and David Alvarez-Melis (Releasing the Inner Jev): the open recipe for turning a language model into a decision model. Our evaluation was checked against their published numbers, and the code that reads requests is derived from theirs (see NOTICE).
  • JevPertus (code): an earlier decision model built on the same Apertus-1.5-8B.
  • JevBench and the Jev Decision Index: independent public benchmarks for decision models, on which Votum is measured.

License

Apache-2.0 (LICENSE, NOTICE). The Apertus model underneath carries the Apertus Acceptable Use Policy, which applies to anyone who uses Votum. Votum is an independent project, not affiliated with or endorsed by the Swiss AI Initiative.

Metadata

Release files for votum 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for votum 0.1.0
File Size Uploaded Provenance Actions
votum-0.1.0.tar.gz 86.8 kB Without provenance Details for votum-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for votum 0.1.0
File Interpreter ABI Platform Actions
votum-0.1.0-py3-none-any.whl Python 3 none any Details for votum-0.1.0-py3-none-any.whl

Total release size: 151.4 kB

Release files / votum-0.1.0.tar.gz

Download URL votum-0.1.0.tar.gz
Size 86.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f8e2eb989efdbc4df9ed499ec3c8ef624f77fecca31cabe3e26545c6975bbf06
BLAKE2b-256 checksum
How to use checksums
dade1ec56c69cb52d5b5877809d133099f0176d051ed4f4cb604ad4ae0f952a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Release files / votum-0.1.0-py3-none-any.whl

Download URL votum-0.1.0-py3-none-any.whl
Size 64.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88d616d4de8fcf7fb94d9e75a53a0d64022cf1eb72e947d50ad43df34e8af077
BLAKE2b-256 checksum
How to use checksums
087648c0f79205da0392b6f57dc51276d008b9c5a598c4e3105d759905aadcbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Security for votum 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page