Skip to main content

CI Docs PyPI Python Ruff docs vetted

typevet

Kind: landing page (the project overview; the one page that mixes kinds).

typevet is a Python library that asks a model typed questions and returns typed answers. The three question types are Noul (yes or no), Choice (one label) and Score (one rubric level). typevet computes each answer from the model's next-token probabilities, read before sampling. typevet also returns JSON objects that pass a JSON Schema you supply, or it raises an error. The receipts cover Gemma 4 31B on llama.cpp for local work and on vLLM for hosting.

Read the documentation at https://alberto-codes.github.io/typevet/.

Status

  • typevet is pre-1.0. The package version is 0.2.0.
  • Install typevet from PyPI: pip install typevet or uv add typevet. See Install typevet.
  • typevet requires Python 3.12 or later.
  • Each tested pin has one receipt. The receipt gives the full pin and its limits.
Backend Tested pin Receipt
vLLM vllm/vllm-openai:v0.30.0, BF16 google/gemma-4-31B-it, one H100 80 GB #170
llama.cpp Build b11223-4da633776, local alias gemma-4-31b-kv9-q4km-mm: file gemma-4-31b-24gib-kv9-decoder.gguf, ftype Q2_K - Medium (not Q4_K_M), 16.0 GB, --chat-template-file override (#233) #203
llama.cpp grammar Build b11243-fc07d781e, Gemma 4 31B QAT Q4_0 GGUF #129

Performance: on one H100 at concurrency level 64, 480 Banking77 records took 12.1 s at 39.6 records/s. That run had 0 errors. Banking77 calibration passed; DIFrauD SMS failed parity (ECE 0.158 against 0.10). One run, one pod, one pin. See Performance on one H100 and Serve Gemma 4 31B on a rented H100. A valid structure does not prove accuracy or calibration. The receipts are small samples.

See it run

https://github.com/user-attachments/assets/4d6dd426-a3a1-4e3e-9e93-17e3513fe333

This recording is from 2026-10-02: model gemma-4-31b-kv9-q4km-mm, llama.cpp build b11347-5fc4f3c8c, one NVIDIA GeForce RTX 4090. It shows four live cases, each with its receipt. Three image cases return a Choice label. One text case asks a Noul, a Choice and a Score question. The type system refuses the GIF upload before typevet calls the router. The recording shows typed answers and receipts. It does not prove accuracy. To run the live demo, follow Stand up the live demo.

Quickstart

Get one offline typed judgment from a scripted fake. This step needs no model.

pip install typevet
python -c "
from typevet.domain import Noul
from typevet.runtime import ScoringJudgmentAdapter
from typevet.testing import ScriptedScoringFake
fake = ScriptedScoringFake(logprobs={'True': -0.2, 'False': -1.0})
port = ScoringJudgmentAdapter(fake, tokenize_content=lambda t: (ord(t[0]),))
r = port.judge('text', {'q': Noul(instructions='Ok?', criteria={'true': 'Y', 'false': 'N'})}, 'fake')
print('noul', r.nouls['q'].noul)
"

The command prints the probability of yes, near 0.69. The offline tutorial explains each step. Then connect a model server:

Learn more

TypeLLM is a research reference for the decision model. It is not a runtime dependency.

For contributors

Read CLAUDE.md first. It states the gates, the issue workflow and the rules for agents and people.

uv sync
uv run pre-commit install -t pre-commit -t pre-push -t commit-msg
uv run pytest -q

The default test run skips live tests. Pull requests and pushes to main run the hook stages in the CI workflow. The writing system and the commit rules apply to every change.

Metadata

Release files for typevet 0.8.2

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

Source distribution (sdist)

Source distribution for typevet 0.8.2
File Size Uploaded Provenance
typevet-0.8.2.tar.gz 137.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 321.3 kB

Release files / typevet-0.8.2.tar.gz

Download URL typevet-0.8.2.tar.gz
Size 137.0 kB
Tags Source
SHA-256 checksum
How to use checksums
40e4847462e4bd77a7b68e3b7fae2ad265f06be3270d7e65ee2c7485f6d1aea5
BLAKE2b-256 checksum
How to use checksums
9447bcb393d04b71b37a054b6ae796001f9749361198e9319d5e31568fe246b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / typevet-0.8.2-py3-none-any.whl

Download URL typevet-0.8.2-py3-none-any.whl
Size 184.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24039e34e00e85908cd6455281b0e84fba96c122337411e2131d830c36936951
BLAKE2b-256 checksum
How to use checksums
960e5cd5d189cf6d2a13e4a719c81448eaac8c51d5230e9c160aed3c5bdbba0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for typevet 0.8.2

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.

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