Your conversational JSONL goes in. Your fine-tuned GGUF model comes out.
AarForge is an opinionated local LLM fine-tuning and deployment pipeline that transforms conversational JSONL datasets into fine-tuned GGUF models, ready to run locally with Ollama.
Built around Unsloth, LoRA, 4-bit quantization, and Hugging Face tools, AarForge makes local LLM fine-tuning more accessible on NVIDIA consumer GPUs.
No massive infrastructure. No complicated cloud setup. Just your GPU, your dataset, and a questionable amount of patience.
- Automated Setup: Creates a Python virtual environment and installs the required dependencies.
- 4-bit Fine-tuning: Uses Unsloth and BitsAndBytes to reduce GPU memory requirements.
- Conversational JSONL: Supports OpenAI-style datasets containing
system,user, andassistantmessages. - LoRA Fine-tuning: Trains lightweight adapters instead of updating the entire base model.
- GGUF Export: Merges and exports the fine-tuned model into GGUF format.
- Ollama Integration: Generates an Ollama Modelfile and deploys a local model when Ollama is installed and reachable; training and export can complete without Ollama.
- Operating system: Linux with Bash. The setup script currently supports Linux only.
- Setup tools:
curl,make, and a C++20-capable compiler (c++org++), plus standard Linux command-line utilities. Setup builds and installs the AarForge commands. - Network: Internet access to download UV, Python packages, and the selected Hugging Face model.
- GPU: NVIDIA with a compatible CUDA/PyTorch setup is the supported configuration and works properly. AMD support is experimental, is not guaranteed, and requires a compatible ROCm GPU, driver, and PyTorch build. See the Unsloth AMD guide and AMD ROCm compatibility documentation.
- Memory: 6 GB or more of VRAM is a rough recommendation; the actual requirement depends on the model, context length, and training settings.
- Disk: Plan for at least 20 GB free to start. Model weights, package downloads, training artifacts, and export files can require substantially more. AarForge limits retained run artifacts, but it does not clear Python, Hugging Face, or Ollama data stored outside its run folders.
- GGUF export tools:
git,cmake,make, and a C++ compiler. The workspace installer warns if these are missing; GGUF export may fail without them.
The workspace installer creates a Python 3.13 environment by default. Existing Python environments from 3.10 through 3.13 can be reused if they pass AarForge's dependency checks.
git clone https://github.com/AaritDev/AarForge.git
cd AarForge./setup.shFor the recommended user install, press Enter at the first prompt. AarForge installs under ~/.local. If ~/.local/bin is not on PATH, setup offers to add command aliases to your shell startup files; open a new terminal afterward.
To choose a different prefix, select option 2 and use the directory selector. 0 selects the current directory, u moves to its parent, n creates a folder, and m accepts a path. You can chain navigation keys, for example uu310.
To select a prefix without using the directory browser, or to see the available setup options:
./setup.sh --prefix "$HOME/.local"
./setup.sh --prefix "$HOME/.local" --version 1.0.0
./setup.sh --helpThe setup script can also be launched from another working directory by using its full path.
mkdir -p ~/AarForgeWorkspace
cd ~/AarForgeWorkspace
aarforge-installPress Enter to use the current directory, choose option 2 to browse for another workspace, or enter a workspace path. In the browser, 0 selects the current directory, u moves to its parent, n creates a folder, and m accepts a path; numbered folders can be chained with navigation keys, for example uu310. The installer prepares the Python environment, installs and checks dependencies, runs an accelerator preflight, and creates sample_dataset.jsonl if it does not already exist. If an existing .venv uses an unsupported Python version, AarForge offers to preserve it under a timestamped backup name before creating a new environment. If the workspace already has a different build program, the installer asks before replacing it; declining leaves the existing file untouched and cancels installation.
When both NVIDIA and AMD devices are detected, choose which backend to use. If no accelerator is detected, setup can still complete, but training requires a compatible GPU. If Ollama is not installed, the installer offers to install it; declining does not prevent training or export.
Run the builder from the workspace:
aarforge-buildOr specify the workspace from anywhere:
aarforge-build --workspace ~/AarForgeWorkspaceAarForge uses OpenAI-style conversational JSONL.
Each non-empty line in your .jsonl file must contain one valid JSON object with a top-level messages array. Blank lines are ignored.
Each conversation must contain exactly one system message followed by alternating user and assistant messages, ending with an assistant response. Every message contains:
role: The message speaker (system,user, orassistant).content: The message text.
{"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello."}, {"role": "assistant", "content": "Hello! How can I help?"}]}
{"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is 2 + 2?"}, {"role": "assistant", "content": "2 + 2 = 4."}]}- Each non-empty line represents one independent conversation and must be valid JSON.
- The JSON object must contain only the
messagesproperty. messagesmust be a non-empty array. Each message must contain onlyroleandcontent.- The first message must have the
systemrole. After it, roles must alternateuser,assistant, ending withassistant. contentmust be non-empty text. Supported roles aresystem,user, andassistant.- Conversations must fit within the selected maximum context length.
The system message supplies the instructions for that conversation. User and assistant messages provide the examples used during fine-tuning.
Save your dataset with a .jsonl extension.
For example:
my_dataset.jsonl
A small tip: Quality matters more than quantity. A thousand well-written examples are generally more useful than ten thousand conversations that look like they were generated during a caffeine overdose.
Run the global builder from your workspace:
cd ~/AarForgeWorkspace
aarforge-buildOr run it from anywhere by specifying the workspace:
aarforge-build --workspace ~/AarForgeWorkspaceThe wizard lets you select an existing model or create a new one, choose a JSONL dataset, and configure training. Saved model names use lowercase letters, digits, periods, underscores, and hyphens (up to 64 characters). Choose an existing model from the list to replace its run, or choose n to create a new model.
| Setting | Description |
|---|---|
| Model name | Name used for run artifacts and Ollama deployment. |
| Dataset | Conversational JSONL file. |
| Base model | Hugging Face model ID or existing local model directory. Default: huihui-ai/Llama-3.2-3B-Instruct-abliterated. |
| Training epochs | Number of passes through the dataset. Default: 3. |
| Training steps | Maximum optimizer steps. Default: 60; enter 0 to train by epochs instead. |
| Maximum sequence length | Context length in tokens. Default: 2048; accepted values are 128–131072. |
| Ollama temperature | Inference temperature from 0.0 to 2.0. Default: 0.7. |
| Ollama system prompt | Inference prompt written to the generated Modelfile. Defaults to AarForge's helpful-assistant prompt. |
Press Enter to accept a displayed default. Training settings are shared across the workspace. The dataset selector lists folders and .jsonl files: use u to move up, d followed by a folder number to enter it, f followed by a file number to select it, or 0 to enter a path manually. Actions can be chained, for example uud2f1.
At the Review prompt, answering n lets you either re-enter the dataset and training parameters (r) or quit (q). Pressing Enter at this follow-up prompt quits.
Every run snapshots its selected dataset as dataset.jsonl, so it can still be reused if the original file moves. Runs and logs are grouped by model under AarForge/Runs/<model-name>/ and AarForge/Logs/<model-name>/. After the new run passes environment, device, and dataset preflight, AarForge removes that model's previous run artifacts; the old and new run folders can coexist temporarily during preflight. If preflight fails, the old run is preserved and a partial new folder may remain. Up to 30 run-log directories are retained per model. These limits apply only to AarForge run and log folders, not the Python environment, Hugging Face cache, or Ollama's model storage.
The build pipeline checks dependencies and the GPU, validates the dataset, fine-tunes a LoRA adapter, and exports Q4_K_M GGUF files. If Ollama is installed and reachable, AarForge creates and verifies the model; replacing an existing Ollama model requires confirmation. Without Ollama, training and export still complete, and the GGUF files and generated Modelfile remain in the run directory.
When deployment succeeds, run your model with:
ollama run my_custom_botReplace my_custom_bot with your chosen model name.
The repository contains:
AarForge/
├── .gitignore
├── setup.sh
├── Makefile
├── README.md
├── LICENSE
├── assets/
├── src/
│ ├── ++/
│ └── python/
└── legacy/
legacy/ contains the archived shell workflow and its screenshots. It is not used by the current setup or build commands.
An installed workspace contains files similar to:
workspace/
├── .venv/
├── build
├── sample_dataset.jsonl
└── AarForge/
├── settings.json
├── runtime.json
├── worker.py
├── Models/
├── Logs/
│ └── <model-name>/
│ └── <run-code>/
│ ├── events.jsonl
│ ├── report.json
│ └── settings.json
└── Runs/
└── <model-name>/
└── <latest-run-code>/
├── dataset.jsonl
├── adapter/
├── gguf/
├── training_metadata.json
└── Modelfile
The workspace root also contains .venv/, the build command, and sample_dataset.jsonl. Settings in AarForge/settings.json are shared across models in that workspace; runtime.json records the selected GPU backend. events.jsonl stores timestamped stage messages, report.json summarizes the run, and settings.json captures the settings used for that run. Run cleanup and log retention follow the rules described in Usage.
The previous shell-based workflow is preserved in legacy/ for reference:
legacy/install.sh— previous workspace installer.legacy/build.sh— previous training and export wizard.legacy/capture_output.py— log-capture helper used by those scripts.legacy/assets/README/— screenshots from the previous workflow.
Use the current setup and usage instructions above rather than running the archived scripts.
- Command not found after setup: Open a new terminal if setup added aliases. Otherwise, make sure the install prefix's
bin/directory is onPATHor run the command by its full path. - Setup cannot build AarForge: Install
makeand a C++20 compiler, then rerun./setup.sh. - Dependency or Python preflight fails: Rerun
aarforge-installin the workspace and review the reported package or environment error. Do not delete a.venv.backup-*directory until you no longer need the preserved environment. - GPU preflight fails: Confirm the NVIDIA driver is available to
nvidia-smi, or (for AMD) that the ROCm device and compatible ROCm/PyTorch setup are available. AMD support is experimental and is not guaranteed. - GGUF export fails: Install
git,cmake,make, and a C++ compiler, then runaarforge-buildagain. - Ollama is unavailable: Training and GGUF export can still finish. Install and start Ollama later, then use the generated
Modelfileto create the model.
AarForge builds on several excellent open-source projects:
- Unsloth — Efficient LLM fine-tuning.
- PyTorch — GPU-accelerated model training.
- Hugging Face Transformers — Model and tokenizer management.
- TRL — Supervised fine-tuning.
- Datasets — Dataset loading and processing.
- PEFT — Parameter-efficient fine-tuning.
- BitsAndBytes — 4-bit quantization and quantized model loading.
- GGUF — Quantized model export format.
- Astral UV — Fast Python package and environment management.
- Ollama — Local model deployment and inference.
- NVIDIA GPUs with compatible CUDA are the properly supported configuration. AMD ROCm support is not guaranteed and may depend on GPU, driver, and model compatibility.
- Training performance depends heavily on available VRAM.
- Not every Hugging Face model architecture is necessarily supported.
- GGUF conversion compatibility depends on the selected base model.
- Fine-tuning quality depends on dataset quality and training configuration.
AarForge wouldn't exist without the work of the Unsloth, Hugging Face, and Ollama communities.
A big thank you to everyone building and maintaining the tools that make local AI development possible.
Base models retain their respective licenses and usage restrictions. Make sure to review the applicable model license before using or distributing fine-tuned models.
If you find AarForge useful, consider giving the repository a star!
It costs you nothing, but it makes me little programmer dopamine receptors go YES.
Copyright (C) 2026 Aarit Pandey
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
