Bytewise MIME detector
Working name:
bytewisemay change before the first public Git release.
Bytewise is a standalone neural MIME detector trained on raw file bytes. It does not require Java, a Tika server, a filename, or a file extension. The repository preserves its complete research lineage: BFA/BFC baselines, neural experiments, strict-host validation, deduplication audits, and D3 reports.
The frozen v1 release candidate is a compact Transformer trained on the first 4,096 bytes of 863,871 TREC-DD POLAR payloads. It predicts 57 MIME classes.
Usage
Homebrew Python is an externally managed environment and must not be modified
with pip --break-system-packages. For the command-line application, install
Bytewise into an isolated Python 3.12 environment with uv:
uv tool install --python 3.12 --editable "$HOME/git/bytewise[metal]"
uv tool update-shell
Open a new terminal (or add $HOME/.local/bin to PATH) and verify it:
bytewise --version
bytewise model-info
The metal extra pins the validated TensorFlow 2.18.1 and
tensorflow-metal 1.2 runtime. On a non-Mac system, replace metal with
inference.
For development or library use, keep the dependency in a project environment:
cd "$HOME/git/bytewise"
uv sync --python 3.12 --extra metal --group tests
uv run bytewise model-info
uv run python
Inside that uv run python session:
from bytewise import Detector
detector = Detector.load_default()
result = detector.detect_file("document.bin")
print(result.mime_type)
print(result.confidence)
print(result.alternatives)
The same model is available from the command line:
bytewise detect document.bin image.dat
bytewise detect document.bin --top-k 5 --threshold 0.80 --json
cat unknown.bin | bytewise detect -
bytewise supported
bytewise model-info
Allow uncertain inputs to abstain so another detector can handle them:
detector = Detector.load_default(confidence_threshold=0.80)
result = detector.detect_bytes(payload)
if result.abstained:
# Fall back to tika-python, libmagic, or another detector.
pass
Frozen v1 model
The selected model is polar-byte-transformer-seed550-v1:
- Validation accuracy: 96.77%
- Independent-reference accuracy: 94.59%
- Input: first 4,096 raw bytes
- Labels: 57 MIME types
- Model SHA-256:
72a2f5f2dd0fbb4ffaf88488618bc8e034c03876c7cea94d11da23439ed5b849
See the model card and Full-v3 report for the complete evidence.
Repository organization
src/bytewise/: production API and migrated byte-frequency research codeartifacts/: immutable model release bundleconfigs/,scripts/: reproducible experiments and evaluationreports/: curated D3 reports from early pilots through Full-v3docs/: research and repository-extraction documentationtests/: standalone production and research regression tests
Dataset bytes, feature caches, databases, raw predictions, and transient logs are intentionally kept outside Git.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 bytewise-0.1.0.tar.gz.
File metadata
- Download URL: bytewise-0.1.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da9d90d2cf523840e1f735bcb75c87b6444995af444e5160ad06757221380704
|
|
| MD5 |
c3386c71379fd1dfaf6280ca614bbcde
|
|
| BLAKE2b-256 |
0fe907c4ed36a0f4bd7804f47f8b291cd70f9c7c881eb88c64f2fd013078f16c
|
Provenance
The following attestation bundles were made for bytewise-0.1.0.tar.gz:
Publisher:
publish.yml on chrismattmann/bytewise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bytewise-0.1.0.tar.gz -
Subject digest:
da9d90d2cf523840e1f735bcb75c87b6444995af444e5160ad06757221380704 - Sigstore transparency entry: 2341594793
- Sigstore integration time:
-
Permalink:
chrismattmann/bytewise@a46d1d50de693ae61db8c0fff50d06026f7b9aa1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/chrismattmann
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a46d1d50de693ae61db8c0fff50d06026f7b9aa1 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file bytewise-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bytewise-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3218d1093cf5678d035434a0fd3777d9f97dd7a0492eeccc15a1bc20e13f8f1c
|
|
| MD5 |
ee7aad39dd21cde6079e4fd6df00e79e
|
|
| BLAKE2b-256 |
b234f319bcdecccd3a7fb3a1fcd51d7bb33698b48542460b9705e667788d0a3e
|
Provenance
The following attestation bundles were made for bytewise-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on chrismattmann/bytewise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bytewise-0.1.0-py3-none-any.whl -
Subject digest:
3218d1093cf5678d035434a0fd3777d9f97dd7a0492eeccc15a1bc20e13f8f1c - Sigstore transparency entry: 2341594806
- Sigstore integration time:
-
Permalink:
chrismattmann/bytewise@a46d1d50de693ae61db8c0fff50d06026f7b9aa1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/chrismattmann
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a46d1d50de693ae61db8c0fff50d06026f7b9aa1 -
Trigger Event:
workflow_dispatch
-
Statement type: