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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
drafters-0.0.1.tar.gz
(34.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drafters-0.0.1.tar.gz.
File metadata
- Download URL: drafters-0.0.1.tar.gz
- Upload date:
- Size: 34.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6523f01030f6bfeb71b9fc4fd496b1f1956c2eafad189b4c6888de92cb51ae60
|
|
| MD5 |
a512f3a0ee49dd918d67048863639fe0
|
|
| BLAKE2b-256 |
0cb795214f673b008344258eee65a820916fbf406acff54a888e4d956e84d21d
|
File details
Details for the file drafters-0.0.1-py3-none-any.whl.
File metadata
- Download URL: drafters-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d669d26158ccebc207da716b6c8dd789fc11e2566129cd87f776237ae7f9ad3b
|
|
| MD5 |
a777d1b97b328943e69a363028ed27a2
|
|
| BLAKE2b-256 |
a2d0ff4fca3f40bffeb579ef6c8ce89124d5940a83e9b4ccd23358a7575ccb71
|