LLM Finetuning Toolkit
Overview
The LLM Finetuning Toolkit offers a simple yet powerful way to conduct a variety of fine-tuning experiments on Language Learning Models (LLMs) using your data. It's a Command Line Interface (CLI) tool that simplifies the experimentation process. With one yaml
configuration file, users can manage various elements of a typical experimentation pipeline, such as prompts, open-source LLMs, optimization strategies, and LLM testing.
Installation
To start using the toolkit, users can install it either through pipx
or pip
.
-
Pipx (recommended): Installs the package and dependencies in a separate virtual environment, preventing interference with other Python installations.
pipx install llm-toolkit
-
Pip: Installs the toolkit directly.
pip install llm-toolkit
Quick Start
The toolkit aims to accelerate users through three stages: Basic, Intermediate, and Advanced.
Basic
Start by running a simple experiment:
llmtune generate config
llmtune run ./config.yml
The first command generates a starter config.yml
file, and the second command uses it to begin the fine-tuning process.
Intermediate
The toolkit's behavior is largely defined by the configuration file written in YAML. This file contains several sections that can be tailored to specific needs:
- Data Ingestion: Users can specify different data formats and paths, whether it's a public dataset or their own.
- LLM Definition: Configuration allows the selection and customization of open-source models available on Hugging Face.
- Quality Assurance: Set up metrics to test whether the fine-tuned model meets the desired characteristics.
Example configurations for attention enabling, data paths, and model specifics are showcased in the toolkit documentation, allowing for easy customization.
Advanced
For more complex workflows, users can conduct ablation studies by manipulating different prompt designs, varying LLMs, and adjusting optimization techniques. This is achieved by defining multiple options within the same YAML file.
Extending
The toolkit is designed with modularity in mind, enabling developers to effortlessly extend and customize its components, such as data processing, fine-tuning methods, inference models, and quality checks, to better fit their unique requirements.
Contributing
The LLM Finetuning Toolkit is an open-source project that encourages community contributions. Developers interested in contributing can refer to the guidelines provided in the CONTRIBUTING.md
file.