DEV Community

Cover image for I Was Tired of Configuring Every LLM Parameter, So I Built Tensorless 🤯
Puneet-Kumar2010
Puneet-Kumar2010

Posted on

I Was Tired of Configuring Every LLM Parameter, So I Built Tensorless 🤯

About a year ago, I was learning PyTorch.

I was learning about model training, transformers, language models, tokenization, architectures, and all the other things that come with building models.

And honestly?

There were a LOT of parameters.

d_model

hidden_size

layers

heads

max_seq_len

top_k

top_p

sampling parameters...

And then there was tokenization.

And then the dataset.

And then training.

And then the hardware.

And then CUDA.

And then multi-GPU.

And then...

You get the idea. 😭

At some point I started thinking:

What if I could just give the system my data and let it figure most of this stuff out?

That thought eventually became Tensorless.


Before Tensorless

I wasn't starting completely from zero.

While learning PyTorch and experimenting with language models, I eventually built two models myself.

One was around 91M parameters.

Another was around 35M parameters.

That experience was actually what pushed me toward Tensorless.

Because once you build a model yourself, you start seeing just how many decisions are involved.

And I started wondering:

What if someone just wants to experiment with a small or medium-sized language model without having to become an expert in every single configuration option first?

That was the problem I wanted to solve.


My first approach was probably too ambitious 💀

The original Tensorless idea was much more extreme.

I wanted Tensorless to have its own neural-network components, its own processing, its own structure, and its own training system.

Basically, I was trying to build a lot of the stack myself.

It sounded cool.

It also caused a ridiculous number of problems.

GPU support had issues.

Multi-GPU had issues.

TPU setup had issues.

There were bugs I had to chase because I was trying to control things that frameworks like PyTorch already handle extremely well.

Eventually I realized:

I don't need to reinvent PyTorch to simplify model training.

So I changed the direction.


Tensorless-PyTorch

The current version uses PyTorch underneath.

Tensorless becomes the higher-level layer that tries to automate the annoying parts.

The package is available on PyPI:

Tensorless PyTorch on PyPI

Install it:

pip install tensorless-pytorch
Enter fullscreen mode Exit fullscreen mode

Then:

import tensorless as tl

model = tl.train("./corpus.txt", task="text-generation")

print(model.generate("The", max_new_tokens=40))
Enter fullscreen mode Exit fullscreen mode

That's an actual example from the package's current PyPI documentation.

And that's basically the philosophy of Tensorless:

Give it data. Train. Generate.


So what does Tensorless actually automate?

When you train a text-generation model, Tensorless can derive a number of settings from the data instead of making you configure everything manually.

The current package automatically derives things such as:

  • model size
  • batch size
  • epochs
  • validation setup
  • device
  • BPE vocabulary size

The model size is automatically scaled according to corpus size across several tiers.

And if you do want control, you can override the automatically selected settings.

So you can start simple:

model = tl.train(
    "./corpus.txt",
    task="text-generation"
)
Enter fullscreen mode Exit fullscreen mode

Or start taking control of the configuration:

model = tl.train(
    "./corpus.txt",
    task="text-generation",
    epochs=20,
    max_seq_len=128
)
Enter fullscreen mode Exit fullscreen mode

The idea isn't:

"You are never allowed to configure anything."

It's:

"You shouldn't have to configure everything just to get started."


Tokenization is handled too

For text training, Tensorless currently uses BPE as the default tokenizer.

You can also explicitly choose character-level tokenization:

model = tl.train(
    "./corpus.txt",
    task="text-generation",
    tokenizer="char"
)
Enter fullscreen mode Exit fullscreen mode

The text is tokenized once up front and then streamed through PyTorch in fixed-size batches.

That means the user doesn't have to manually build an entire tokenization → batching → training pipeline before experimenting.


What about pretraining?

There is also a starter English pretraining workflow.

For example:

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
    )
)
Enter fullscreen mode Exit fullscreen mode

Tensorless includes an offline starter corpus for demonstrations and smoke tests.

But it's important to say this clearly:

That starter corpus isn't supposed to magically produce a powerful LLM.

It's there to demonstrate the pipeline.

For actual pretraining, you should provide your own substantially larger corpus.


And you can fine-tune

This is one of the things I wanted to support beyond just:

"Here's a dataset, train from scratch."

You can train a base model:

base = tl.train(
    "./big_corpus.txt",
    task="text-generation",
    out="base.tl",
    epochs=20
)
Enter fullscreen mode Exit fullscreen mode

Then fine-tune it:

tuned = tl.train(
    "./my_conversations.json",
    task="text-generation",
    out="tuned.tl",
    pretrained="base.tl",
    epochs=5
)
Enter fullscreen mode Exit fullscreen mode

The current implementation keeps the architecture and tokenizer aligned with the pretrained model when using pretrained=, rather than silently accepting incompatible overrides.

That's useful because the whole point of fine-tuning is to build on what the base model already learned.


It isn't only text generation

Tensorless isn't limited to language models.

The current package also exposes other training tasks.

For example:

tl.train(
    "reviews/",
    task="text-classification"
)
Enter fullscreen mode Exit fullscreen mode

And tabular regression:

tl.train(
    "housing.csv",
    task="regression"
)
Enter fullscreen mode Exit fullscreen mode

The package also supports tabular classification, with preprocessing for things such as numeric values, ISO dates, and high-cardinality categories.

So the broader idea became:

Don't make every experiment start with a giant configuration file.


What about GPUs?

This was one of the reasons the original from-scratch version became difficult.

In the current PyTorch-based implementation, CUDA training can automatically use mixed precision where supported.

The current version also supports TPU training through:

device="tpu"
Enter fullscreen mode Exit fullscreen mode

And larger automatically sized models can enable gradient checkpointing to reduce memory usage.

That's one of the big lessons I learned from the original Tensorless:

Sometimes the best engineering decision is not to rebuild something that already works.


Then I built a cat. 🐈

After building a framework for training models, I needed an actual project to play with it.

So obviously...

I made a chatbot that talks like a dramatic cat.

Introducing:

CatTongue on GitHub

CatTongue is a tiny Tensorless-powered chatbot trained on human messages and cat responses.

The repository is intentionally simple.

Its structure looks roughly like:

CatTongue/
├── data/
│   └── conversations.json
├── train.py
├── chat.py
├── README.md
└── .gitignore
Enter fullscreen mode Exit fullscreen mode

The actual repository also contains trained .tl model files and the training/chat scripts.


Running CatTongue

First install Tensorless:

pip install tensorless-pytorch
Enter fullscreen mode Exit fullscreen mode

Then train:

python train.py
Enter fullscreen mode Exit fullscreen mode

That produces:

cat.tl
Enter fullscreen mode Exit fullscreen mode

Then:

python chat.py
Enter fullscreen mode Exit fullscreen mode

And you can talk to the cat.

That's the actual workflow documented in the CatTongue repository.


The dataset is ridiculously simple

The training data lives in:

data/conversations.json
Enter fullscreen mode Exit fullscreen mode

An individual example looks like:

{
  "user": "what are you doing?",
  "cat": "mrrp... watching the wall. the wall is suspicious."
}
Enter fullscreen mode Exit fullscreen mode

So if you want to experiment with the personality, you can literally add more conversations.

More data.

Different responses.

Different personality.

Then train again.

That's one of the things I like most about this experiment: the entire pipeline is accessible enough to mess with.


And yes, the model is imperfect 😂

Some of the CatTongue outputs are genuinely funny.

Others are completely broken.

And that's expected.

This isn't a massive pretrained language model.

It's a small experiment trained on a small dataset.

The repository even has examples where the model produces grammatically broken or nonsensical responses.

But that's actually useful.

Because you can see the relationship between:

data → training → model behavior.

Change the dataset and train again.

The behavior changes.

That's exactly the kind of experimentation I wanted Tensorless to make easier.


Why "Tensorless"?

The name came from the original idea.

I wanted the user to think less about the underlying tensor/model configuration and more about:

What data do I want to train on?

It's not literally "tensor-free."

PyTorch is underneath it.

The name is more about the abstraction.

You don't need to manually deal with every underlying detail before you can start experimenting.


A year later...

It's kind of funny looking back.

I started this because I was learning PyTorch and getting confused by all the configuration.

Then I tried building basically everything myself.

That caused problems.

Then I realized I could use PyTorch instead of fighting it.

And now Tensorless is an actual Python package.

The current PyPI release is 0.8.0, published on August 27, 2026, and the package is MIT licensed.

The project is still evolving.

There are things I want to improve.

There will definitely be bugs.

And there are probably design decisions I'll change later.

But that's what makes open source interesting.


So, what can you do with it?

You can start ridiculously simply:

import tensorless as tl

model = tl.train(
    "./my_data.txt",
    task="text-generation"
)
Enter fullscreen mode Exit fullscreen mode

Or you can go deeper and configure the training yourself.

You can pretrain.

You can fine-tune.

You can do text classification.

You can work with tabular data.

You can save models as .tl.

You can load them later:

model = tl.load("model.tl")

print(model.info())
Enter fullscreen mode Exit fullscreen mode

All of these are part of the current package API.


It's not trying to replace serious ML frameworks

Tensorless isn't meant to replace PyTorch.

Actually, it uses PyTorch.

That's intentional.

PyTorch already gives us an enormous amount of mature infrastructure.

Tensorless sits above it and tries to make certain workflows more automated.

Think of it as:

Your data
   ↓
Tensorless
   ↓
automatic configuration
   ↓
tokenization / preprocessing
   ↓
model + training setup
   ↓
PyTorch
   ↓
trained model
Enter fullscreen mode Exit fullscreen mode

The goal is to reduce the amount of boilerplate between:

"I have some data"

and

"I have a model I can experiment with."


Where it goes from here

I don't know exactly.

That's part of the fun.

I want to keep improving the automation, hardware support, training behavior, documentation, and model capabilities.

And I want people to actually use it.

Break it.

Experiment with it.

Build weird projects with it.

Find bugs I didn't find.

Send pull requests.

Maybe someone will build something genuinely useful with it.

Maybe someone will build another ridiculous chatbot.

Both are fine. 😂


Try it yourself 🚀

PyPI:
tensorless-pytorch

CatTongue:
DeveloperPuneet/CatTongue

Install:

pip install tensorless-pytorch
Enter fullscreen mode Exit fullscreen mode

Then try:

import tensorless as tl

model = tl.train(
    "./corpus.txt",
    task="text-generation"
)

print(
    model.generate(
        "The",
        max_new_tokens=40
    )
)
Enter fullscreen mode Exit fullscreen mode

And if you want something more entertaining, clone CatTongue and train the dramatic cat. 🐈


One last thing

Tensorless started because I thought:

"Why are there so many things I have to configure just to train a model?"

A year later, I ended up publishing the answer I came up with.

It's not perfect.

It's not some revolutionary new architecture.

It's not going to train a frontier model on your laptop.

It's simply an attempt to make model training less annoying to start with.

And honestly?

I'm pretty happy that the idea that started with me being confused about PyTorch eventually became a package people can actually pip install.

Now I want to see what other people do with it. 🚀

Top comments (0)