ForgeLM
Fine-tune LLMs. Keep the evidence.
YAML-driven training, evaluation gates, and audit artifacts — from your terminal, Python, or CI.
Website · Quick start · Documentation · Contribute · Türkçe
ForgeLM turns a validated YAML configuration into a fine-tuning run, a saved model, and an audit trail. Start with SFT, use preference or reasoning methods when you need them, and opt into safety evaluation, human approval, and EU AI Act documentation. The same configuration works locally and in a CI/CD pipeline.
Here to contribute? Pick an unassigned good first issue and follow your first pull request. Documentation, Turkish translations, examples, and tests are welcome alongside code.
Why ForgeLM
| You need to… | ForgeLM provides |
|---|---|
| Keep training reproducible | Validated YAML, model revision pins, and a typed Python API. |
| Move beyond a single SFT run | SFT · DPO · SimPO · KTO · ORPO · GRPO, plus sequential pipelines such as SFT → DPO → GRPO. |
| Check data before training | Dataset audits for PII, secrets, duplicates, leakage, and quality; document-to-JSONL ingestion with masking. |
| Make promotion conditional | Opt-in loss, benchmark, safety, and judge gates; human-approval staging and stable CLI exit codes. |
| Keep reviewable evidence | Hash-chained audit logs, model-integrity manifests, model cards, and optional compliance exports. |
| Use your own infrastructure | LoRA/QLoRA, optional Unsloth and distributed backends, plus export and serving configuration generation. |
ForgeLM fine-tunes existing Hugging Face models. Serving is handed off to tools such as Ollama, vLLM, TGI, or llama.cpp. See the architecture for how the pieces fit together. ORPO and SimPO may use experimental TRL APIs; see alignment compatibility.
Try it without a GPU
Use Python 3.10–3.13 in a virtual environment. Install the core package, then generate a starter configuration and a tiny customer-support dataset:
python -m pip install forgelm
python -m forgelm quickstart customer-support --output configs/support.yaml --dry-run
This writes configs/support.yaml, configs/customer-support.jsonl, and a
quickstart audit record. The generation step downloads no model and starts no
training. Use a fresh output directory when repeating it, so your edited dataset
is not overwritten. The bundled data is a demonstration seed, not a production corpus.
Validate the generated YAML and audit the seed dataset:
python -m forgelm --config configs/support.yaml --dry-run
python -m forgelm audit ./configs/customer-support.jsonl
List other templates with python -m forgelm quickstart --list, or generate a
configuration interactively with python -m forgelm --wizard.
For a recorded CPU walkthrough of configuration validation, dataset auditing, and
audit-log verification, see the CPU sample and its limitations.
When you are ready to train
Review the generated model, dataset, and output paths first. The bundled templates enable 4-bit loading: on Linux + CUDA, install the QLoRA extra, estimate memory, and start training explicitly:
python -m pip install "forgelm[qlora]"
python -m forgelm --config configs/support.yaml --fit-check
python -m forgelm --config configs/support.yaml
The memory estimate is guidance, not a guarantee that a run will fit. For Apple
Silicon or another unquantized setup, set model.load_in_4bit: false and choose a
model that fits your hardware. Intel Macs are unsupported by the required PyTorch
versions. See installation and platform support
for optional backends and extras.
One configuration, a reviewable workflow
The generated YAML is yours to edit. For example, this standalone SFT configuration
uses the seed dataset created above and saves to ./checkpoints/customer-support:
model:
name_or_path: "Qwen/Qwen2.5-7B-Instruct"
load_in_4bit: true
data:
dataset_name_or_path: "./configs/customer-support.jsonl"
training:
trainer_type: "sft"
output_dir: "./checkpoints/customer-support"
num_train_epochs: 3
lora:
r: 8
alpha: 16
Configuration keys and cross-field constraints are validated before training. Add safety, compliance, or a multi-stage pipeline when your workflow needs them: configuration reference · alignment methods · pipeline guide.
Data → configure → train → evaluate → review → export.
Audit your own corpus before committing GPU time. After training, use
python -m forgelm chat ./checkpoints/customer-support/final_model
to inspect the result, then follow the post-training examples
for export and deployment. K-quant GGUF export also requires a separate llama.cpp
quantization step; see the CLI reference.
Evidence and gates
| Artifact or control | What it does |
|---|---|
| Saved model and model card | Records the trained output and its configuration. |
| Model-integrity manifest | Detects changed, missing, or added files with verify-integrity. |
| Append-only audit log | Records decisions in a hash chain, checked with verify-audit. |
| Optional evaluation gates | Apply configured loss, benchmark, safety, or judge thresholds. |
| Optional human approval | Stages a model for review before promotion; the CLI exits 4. |
| Optional compliance export | Produces Annex IV metadata, data-governance reports, and training provenance. |
CLI exit codes let your pipeline distinguish configuration errors (1), runtime
errors (2), evaluation failures (3), pending approval (4), wizard cancellation
(5), and integrity mismatches (6); success is 0. See the
CLI contract.
Safety evaluation, compliance export, human approval, and auto-revert are opt-in.
With evaluation.auto_revert: true, a failed evaluation can delete the saved model
directory; review the gate behavior
before enabling it. Evidence artifacts support a review process; they do not
certify model safety or legal compliance. For adversarial tamper-evidence, configure
FORGELM_AUDIT_SECRET and protect storage — an unkeyed hash alone is insufficient.
Documentation
| Start here | Go deeper |
|---|---|
| Quick start | Configuration reference |
| Dataset auditing | Safety and compliance |
| Document ingestion | Enterprise deployment |
| Python API | CI/CD integration |
| Troubleshooting | Public roadmap |
Türkçe: Hızlı başlangıç · Yapılandırma · Veri denetimi · Güvenlik ve uyumluluk.
Learn in a notebook: SFT fine-tuning in Colab · GRPO reasoning in Colab · all notebooks. Model access, dependencies, and hardware requirements are documented in each notebook.
Contribute
Help make fine-tuning easier to reproduce and review. You can improve a guide, translate an example, reproduce a bug, add a regression test, or work on a planned feature. Start small; you do not need a GPU to run the unit tests or documentation checks.
- Start at the Front door: the open, unassigned
good first issues with their size and area. You can also search by label. The rest of the planned work is in the project plan. - Follow your first pull request to set up the environment and run the relevant checks.
- Open a PR against
developmentand link its issue. Keep English/Turkish documentation mirrors together where they exist.
Report a bug · Suggest a feature · Engineering standards. Report vulnerabilities privately using SECURITY.md.
Who decides what, and who owns which area: GOVERNANCE.md ·
MAINTAINERS.md.
To cite ForgeLM, use GitHub's Cite this repository button or
CITATION.cff.
License
Code: Apache 2.0. Bundled seed datasets: CC-BY-SA 4.0, with attribution and share-alike requirements. Models and datasets you bring retain their respective licenses; review them before training or distributing artifacts.
Metadata
Release files for forgelm 0.11.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| forgelm-0.11.1.tar.gz | 1.7 MB | With provenance | Details for forgelm-0.11.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| forgelm-0.11.1-py3-none-any.whl | Python 3 | none | any | Details for forgelm-0.11.1-py3-none-any.whl |
Total release size: 2.4 MB
Release files / forgelm-0.11.1.tar.gz
| Download URL | forgelm-0.11.1.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c18f28adfc3fc7a97de9a814e0e0872b86ec5cbb8701cc513d020c77879142cc
|
|
BLAKE2b-256 checksum How to use checksums |
b0b488718bb81f864a0e72e68d3b40eb631d189e08795ad32424319b801f9c28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logRelease files / forgelm-0.11.1-py3-none-any.whl
| Download URL | forgelm-0.11.1-py3-none-any.whl |
|---|---|
| Size | 769.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
702f5cb7c7a433650766dd8ac3fc42dc6c1dbfdb1e9365b8ba77b92c543b829c
|
|
BLAKE2b-256 checksum How to use checksums |
7692a1c3d3104d05447aa1d0449fd725c4cd38d12911c8f4634e58e622bb8959
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logSecurity for forgelm 0.11.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for forgelm-0.11.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.