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.1.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.1-py3-none-any.whl (172.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: brsx-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 71e40dbce10b5c45a47e247d07b4c14a4fe9326115a8f03e7e2920e87fd7ebac
MD5 f3ad58a1c9c62d1c3151523bde0e8a4e
BLAKE2b-256 cb379e56f7eb1808c7c935fe4729b9fdfde3236e0fab3da8de790f59fc8740b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: brsx-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ff7fae427a15115cb6e96d457bea8162de0b8a4282170b4917ac84faf38ec45
MD5 f2d98909e9281d84cc1e1f4a5c1129f4
BLAKE2b-256 a61b762ce822ea0fb1d5b7354b8e50c9876818a012992e615fa18b32c708f086

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