Skip to main content

AutoForge — build, train, and fine-tune language models that calibrate themselves to your hardware. Transformer, MTP, and hybrid (mamba/transformer/cnn/gru) architectures in pure PyTorch.

Project description

brsx

AutoForge — build, train, and fine-tune models that calibrate themselves to your hardware.

brsx probes your GPU/CPU by actually running a few steps, picks a model size that fits your memory and speed target, and trains it. No config wrestling — pick a mode and go.

Everything is pure PyTorch. No custom CUDA kernels, no compilation step: if torch runs on your machine, brsx runs on your machine.

Install

pip install brsx

Optional extras:

pip install brsx[sound]   # hear your loss while it trains (needs PortAudio)
pip install brsx[qlora]   # 4-bit QLoRA (bitsandbytes, Linux/CUDA only)

Everything else — transformers, peft, accelerate, tokenizers — comes with the base install. You don't need an extra for those.

Usage

from brsx import automodel

automodel.run()

You'll get a menu:

1)  Transformer training        — train a standard Transformer from scratch
2)  MTP Transformer training    — Multi-Token Prediction heads (DeepSeek-V3 style)
3)  HuggingFace model fine-tune — fine-tune a HF model (local path or hub id)
4)  brsx (.pt) model fine-tune  — fine-tune an existing brsx model
5)  Fine-tune an MTP model
6)  Find the right config for your PC
7)  Dataset editor for json, jsonl, parquet...
8)  Convert a brsx model (.pt) to safetensors
9)  Resume training — continue a half-finished run without an optimizer state
10) Hybrid model training — transformer, mamba, gru and cnn in one model
11) Hybrid fine-tune (full or LoRA)
12) Chat with a .safetensors brsx model or a standard HF model

Pick one and follow the prompts — everything (mode, learning rate, steps, checkpointing, data source) is asked interactively.

What's in it

Auto-calibration. Pick min, mid, max, or my (your own parameter target) and brsx measures your actual hardware — running real steps, not guessing from specs — then sizes the model to fit. On OOM it shrinks the batch and keeps going instead of crashing.

Hybrid architectures. Mix four block types in a single model, in any order you like:

mamba,transformer,cnn,gru,transformer,mamba

That list is the architecture. Each type brings something different — mamba for cheap long-range context, transformer for global attention, cnn for local patterns, gru for sequential state — and a small model can borrow from all four. Removing a name from the list and retraining is all an ablation takes.

Multi-Token Prediction. DeepSeek-V3-style sequential MTP heads: the model predicts 3 tokens ahead, and generation emits them a block at a time — roughly 3× fewer forward passes.

Resume without optimizer state. Checkpoints stay small (weights only, no 2× bloat from Adam moments). On resume the LR re-warms over the first few steps and the data stream fast-forwards past what was already seen, so you don't re-train on the same tokens.

Fine-tuning. Full or LoRA, on brsx models, hybrids, MTP models, or HuggingFace checkpoints. LoRA rank is yours to pick; the adapters are merged back into plain weights on save, so the output is just a normal model.

Audio feedback. With brsx[sound] installed, the loss becomes a tone: the pitch falls as the model learns, and a siren tells you it went NaN. Leave a run in the background and hear when something breaks instead of watching the log.

Portable chat. Every trained model folder gets a standalone chat.py that reads config.json, rebuilds whatever architecture it describes, and runs. Move the folder anywhere — it only needs torch and tokenizers.

Design

brsx is built for small models on ordinary hardware. Not a 70B on a cluster: a 50M that trains on the laptop you already own. Everything in it — the calibration, the pure-PyTorch blocks, the small checkpoints — follows from that.

License

Apache-2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brsx-1.0.0.tar.gz (147.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brsx-1.0.0-py3-none-any.whl (172.2 kB view details)

Uploaded Python 3

File details

Details for the file brsx-1.0.0.tar.gz.

File metadata

  • Download URL: brsx-1.0.0.tar.gz
  • Upload date:
  • Size: 147.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for brsx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3e32c1b6612a8ca779b5c09c24378a1a45b7791ca0fc73ab796aa9fc0320f3dc
MD5 82b7b4e742da032a07ed03859554199c
BLAKE2b-256 e7be4eb874a8c795e7a43b2c8bacd6d0a30dcf0313746dd61b674bc907988627

See more details on using hashes here.

File details

Details for the file brsx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: brsx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 172.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for brsx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 216fcc767564f31e12ed2735bebaa6f8955585e189bff0cd7374da4b9a2ef392
MD5 a399c3c7b5b2772724b952fe9fce31a1
BLAKE2b-256 24639bb52a56e9a7755d0740ad2177de0afadb509e20399f6cc8f8471521647c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page