Tensorless
Tensorless trains small custom models with sensible defaults. It uses a native NumPy engine on CPU and optional JAX or MLX backends for accelerator execution. It supports text generation, text classification, tabular classification, and regression.
Install
pip install -e .
Optional accelerator backends:
pip install -e '.[cuda]' # JAX CUDA
pip install -e '.[tpu]' # JAX TPU
pip install -e '.[mps]' # Apple Silicon MLX
CUDA, TPU, and MPS backends accelerate both transformer text tasks and
tabular MLP tasks. Whatever device is auto-detected (or passed via
device=...) is what training and inference actually run on; only
unsupported platforms (no CUDA/TPU/MPS available) fall back to the native
CPU engine.
Train on your data
import tensorless as tl
model = tl.train("./corpus.txt", task="text-generation")
print(model.generate("The", max_new_tokens=40))
Text files are trained as next-token language models. BPE is the default
tokenizer; use tokenizer="char" for a character-level model. Tensorless
derives model size, batch size, epochs, validation, device, and BPE vocabulary
size from the data, while every setting can be overridden.
Long text is tokenized lazily and fed through the native engine in fixed-size batches.
The automatic batch size uses a token budget; reduce batch_size if your
available memory is limited.
English starter pretraining
import tensorless as tl
model = tl.pretrain(out="english.tl", epochs=20, max_seq_len=128)
print(model.generate("A complete sentence", max_new_tokens=30))
This offline starter corpus contains English prose and grammar examples. It is
for demos and smoke tests, not a replacement for a large language dataset. For
real pretraining, pass your own .txt corpus to tl.train() and increase the
training settings as your hardware allows.
Other tasks
tl.train("reviews/", task="text-classification")
tl.train("housing.csv", task="regression")
Tabular preprocessing automatically handles numeric values, ISO dates, and
high-cardinality categories. Missing and rare values are handled using the
fitted training data, and the same preprocessing is stored in the .tl file.
Models are saved as .tl files and can be loaded later:
model = tl.load("model.tl")
print(model.info())
The native extension API is in tensorless.engine: Module, Parameter,
Adam, and SGD provide model parameters, gradients, and optimization
without a PyTorch dependency. Accelerator cache helpers are available as
tensorless.devices.clear_memory() and tensorless.devices.memory_stats().
See the documentation for data formats, configuration, checkpointing, and the command-line interface.
Metadata
Release files for tensorless 0.9.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tensorless-0.9.4.tar.gz | 136.1 kB | Without provenance | Details for tensorless-0.9.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tensorless-0.9.4-py3-none-any.whl | Python 3 | none | any | Details for tensorless-0.9.4-py3-none-any.whl |
Total release size: 254.5 kB
Release files / tensorless-0.9.4.tar.gz
| Download URL | tensorless-0.9.4.tar.gz |
|---|---|
| Size | 136.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4241366aefef2c6fee3c195d761ba710c093827436308bbcbebeeb832d534b67
|
|
BLAKE2b-256 checksum How to use checksums |
c09665ac12955c2893da14ebd887e167e9317bb9cbb16d41b817d06240027e18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.1
|
Release files / tensorless-0.9.4-py3-none-any.whl
| Download URL | tensorless-0.9.4-py3-none-any.whl |
|---|---|
| Size | 118.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
752ca739766d025b577ba6bfc5fc77413b767e882ebec48462553f1029472be8
|
|
BLAKE2b-256 checksum How to use checksums |
3c3165763f10e646e928d8eee6f9077f22c13f86f060bb78ffbdce65c5f6209e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.1
|
Security for tensorless 0.9.4
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.