Skip to main content

drafters

Typed building blocks for speculative decoding with local language models.

Installation

pip install drafters

Usage

from drafters import Draft, accepted_prefix

draft = Draft(
    token_ids=(314, 159, 265),
    scores=(0.95, 0.87, 0.72),
)

verified = accepted_prefix(draft, accepted_tokens=2)

The initial API defines a provider-independent representation for draft tokens and a protocol that speculative draft models can implement.

Development

pip install -e ".[dev]"
pytest
ruff check --fix --select I
ruff format

License

MIT

Metadata

Release files for drafters 0.0.1

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

Source distribution (sdist)

Source distribution for drafters 0.0.1
File Size Uploaded
drafters-0.0.1.tar.gz 34.1 kB Details

Built distribution (wheel)

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

Total release size: 37.5 kB

Release files / drafters-0.0.1.tar.gz

Download URL drafters-0.0.1.tar.gz
Size 34.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6523f01030f6bfeb71b9fc4fd496b1f1956c2eafad189b4c6888de92cb51ae60
BLAKE2b-256 checksum
How to use checksums
0cb795214f673b008344258eee65a820916fbf406acff54a888e4d956e84d21d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / drafters-0.0.1-py3-none-any.whl

Download URL drafters-0.0.1-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d669d26158ccebc207da716b6c8dd789fc11e2566129cd87f776237ae7f9ad3b
BLAKE2b-256 checksum
How to use checksums
a2d0ff4fca3f40bffeb579ef6c8ce89124d5940a83e9b4ccd23358a7575ccb71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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