Bring Your Own GPU

Fine-tune SmolLM2-360M on your text using your own GPU. In ~15-30 minutes, you get a unique AI personality. Export to ONNX and upload to the browser for fully client-side inference — no server needed.

Local Python (Mac / Linux / Windows)

Requires Python 3.10+, a CUDA-capable GPU (4GB+ VRAM), or use CPU for slower training. All training scripts are in this repo.

# 1. Clone the repo
git clone https://github.com/batraaryan03/browser-ai.git
cd browser-ai

# 2. Install dependencies
python3 -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install unsloth trl accelerate torch transformers datasets
pip install optimum[onnx]  # for ONNX export

# 3. Prepare your training text (.txt file)
#    Paste any book, articles, or writing into a .txt file

# 4. Train + export to ONNX for browser inference
python train/smol_lora_train.py \
  --data ./my-book.txt \
  --steps 60 --export-onnx

# 5. Upload ./output/personality-onnx.zip to the Chat page
#    Open the browser → /models/chat → Upload ZIP
#    Chat with your personality — all in-browser, no server!

Google Colab (Free T4 GPU)

No setup needed. Google gives you a free T4/P100 GPU. Upload your .txt file and run the notebook — ~5-10 minutes training.

# Open the training notebook in Colab:
https://colab.research.google.com/github/batraaryan03/browser-ai/
blob/main/train/smol_lora_train.ipynb

# Follow the notebook:
1. Install dependencies + optimum[onnx]
2. Upload your .txt file
3. Run training (~5-10 min on T4)
4. ONNX export happens automatically
5. Download the ZIP from Colab output
6. Open browser Chat page → Upload ZIP → Chat!

The pipeline

  1. 1.Export your training text as a .txt file (50K+ characters recommended)
  2. 2.Run smol_lora_train.py --export-onnx on your GPU — trains + exports to ONNX
  3. 3.Training produces a ZIP in ./output/personality-onnx.zip (~350 MB)
  4. 4.Open the browser Chat page and upload the ZIP
  5. 5.Chat with your personality — all inference runs in your browser
  6. 6.No server needed — powered by ONNX Runtime Web + WebGPU

Share your personality

Share your personality-onnx.zip and training text so others can upload to the Chat page and experience your personality. Every personality is unique — trained by you, owned by you. All inference runs locally in the browser.