oxbitnet
Run BitNet b1.58 ternary LLMs with GPU acceleration (wgpu).
Python bindings for 0xBitNet — also available as 0xbitnet (npm) and oxbitnet (Rust).
Install
pip install oxbitnet
Quick Start
from oxbitnet import BitNet
model = BitNet.load_sync("model.gguf")
# Chat with streaming output
model.chat(
[("system", "You are a helpful assistant."), ("user", "Hello!")],
on_token=lambda t: print(t, end="", flush=True),
temperature=0.7,
top_k=40,
)
model.dispose()
API
| Method | Description |
|---|---|
BitNet.load_sync(source) |
Load a GGUF model from URL or path |
model.chat(messages, on_token, ...) |
Chat with template + streaming callback |
model.generate(prompt, on_token, ...) |
Generate with streaming callback |
model.generate_sync(prompt, ...) |
Generate, return full string |
model.generate_tokens_sync(prompt, ...) |
Generate, return list of token strings |
model.dispose() |
Release GPU resources |
Parameters
All generate methods accept:
max_tokens(default: 256)temperature(default: 1.0)top_k(default: 50)repeat_penalty(default: 1.1)
License
MIT
Metadata
Release files for oxbitnet 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| oxbitnet-0.5.2-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details for oxbitnet-0.5.2-cp312-cp312-win_amd64.whl |
| oxbitnet-0.5.2-cp312-cp312-manylinux_2_38_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.38+ x86-64 | Details for oxbitnet-0.5.2-cp312-cp312-manylinux_2_38_x86_64.whl |
| oxbitnet-0.5.2-cp312-cp312-macosx_11_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 11.0+ ARM64 | Details for oxbitnet-0.5.2-cp312-cp312-macosx_11_0_arm64.whl |
| oxbitnet-0.5.2-cp312-cp312-macosx_10_12_x86_64.whl | CPython 3.12 | CPython 3.12 | macOS 10.12+ x86-64 | Details for oxbitnet-0.5.2-cp312-cp312-macosx_10_12_x86_64.whl |
Total release size: 20.5 MB
Release files / oxbitnet-0.5.2-cp312-cp312-win_amd64.whl
| Download URL | oxbitnet-0.5.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9117c697c2923174f90ef092aa5bbc6119aab8b09f45dacb66aa3e9f28618407
|
|
BLAKE2b-256 checksum How to use checksums |
b73510397837333d5bd95fc5c3891cf59744227ad50574699228fd32b82a4658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency logRelease files / oxbitnet-0.5.2-cp312-cp312-manylinux_2_38_x86_64.whl
| Download URL | oxbitnet-0.5.2-cp312-cp312-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.12 Linux glibc 2.38+ x86-64 |
|
SHA-256 checksum How to use checksums |
ea1cf3f33bf44a9a2beaf9b6508d94ebf3536d241af802e807bb53168c17dcb1
|
|
BLAKE2b-256 checksum How to use checksums |
732740268364b3f5082f56a38cf79d386c842215deb4f72839e5c5b2f93078d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency logRelease files / oxbitnet-0.5.2-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | oxbitnet-0.5.2-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3bee326d580429a759eb556adcb57cf55d3e7e94c6f8379f52872b2837dd2446
|
|
BLAKE2b-256 checksum How to use checksums |
021ec0ae70ef9ab6a2fb928b598e7c9adf42b842523ac83d22613c8e8d80582a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency logRelease files / oxbitnet-0.5.2-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | oxbitnet-0.5.2-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4f65322462fec75e9b5a0e442747a7527984e367854ad2cea7e2ccef162e6d82
|
|
BLAKE2b-256 checksum How to use checksums |
321d66d69430542336d278a522a36713bc632469913a669d0507f635a25c485d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency logSecurity for oxbitnet 0.5.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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for oxbitnet-0.5.2-cp312-cp312-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2026.
Transparency logA 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.