Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

H2O LLM Studio - a framework and no-code GUI for fine-tuning LLMs. Documentation:https://docs.h2o.ai/h2o-llmstudio/

License

NotificationsYou must be signed in to change notification settings

h2oai/h2o-llmstudio

Welcome to H2O LLM Studio, a framework and no-code GUI designed for
fine-tuning state-of-the-art large language models (LLMs).

homelogs

Jump to

With H2O LLM Studio, you can

  • easily and effectively fine-tune LLMswithout the need for any coding experience.
  • use agraphical user interface (GUI) specially designed for large language models.
  • fine-tune any LLM using a large variety of hyperparameters.
  • use recent fine-tuning techniques such asLow-Rank Adaptation (LoRA) and 8-bit model training with a low memory footprint.
  • use Reinforcement Learning (RL) to fine-tune your model (experimental).
  • use advanced evaluation metrics to judge generated answers by the model.
  • track and compare your model performance visually. In addition,Neptune andW&B integration can be used.
  • chat with your model and get instant feedback on your model performance.
  • easily export your model to theHugging Face Hub and share it with the community.

Quickstart

For questions, discussing, or just hanging out, come and join ourDiscord!

Use cloud-based runpod.io instance to run the latest version of H2O LLM Studio with GUI.

open_in_runpod

Using CLI for fine-tuning LLMs:

KaggleOpen in Colab

What's New

  • PR 788 New problem type for Causal Regression Modeling allows to train single target regression data using LLMs.
  • PR 747 Fully removed RLHF in favor of DPO/IPO/KTO optimization.
  • PR 741 Removing separate max length settings for prompt and answer in favor of a singlemax_length settings better resemblingchat_template functionality fromtransformers.
  • PR 592 AddedKTOPairLoss for DPO modeling allowing to train models with simple preference data. Data currently needs to be manually prepared by randomly matching positive and negative examples as pairs.
  • PR 592 Starting to deprecate RLHF in favor of DPO/IPO optimization. Training is disabled, but old experiments are still viewable. RLHF will be fully removed in a future release.
  • PR 530 Introduced a new problem type for DPO/IPO optimization. This optimization technique can be used as an alternative to RLHF.
  • PR 288 Introduced DeepSpeed for sharded training allowing to train larger models on machines with multiple GPUs. Requires NVLink. This feature replaces FSDP and offers more flexibility. DeepSpeed requires a system installation of CUDA Toolkit and we recommend using version 12.1. SeeRecommended Install.
  • PR 449 New problem type for Causal Classification Modeling allows to train binary and multiclass models using LLMs.
  • PR 364 User secrets are now handled more securely and flexible. Support for handling secrets using the 'keyring' library was added. User settings are tried to be migrated automatically.

Please note that due to current rapid development we cannot guarantee full backwards compatibility of new functionality. We thus recommend to pin the version of the framework to the one you used for your experiments. For resetting, please delete/backup yourdata andoutput folders.

Setup

H2O LLM Studio requires a machine with Ubuntu 16.04+ and at least one recent NVIDIA GPU with NVIDIA drivers version >= 470.57.02. For larger models, we recommend at least 24GB of GPU memory.

For more information about installation prerequisites, see theSet up H2O LLM Studio guide in the documentation.

For a performance comparison of different GPUs, see theH2O LLM Studio performance guide in the documentation.

Recommended Install

The recommended way to install H2O LLM Studio is usinguv with Python 3.10. To install Python 3.10 on Ubuntu 20.04+, execute the following commands:

Installing NVIDIA Drivers (if required)

If deploying on a 'bare metal' machine running Ubuntu, one may need to install the required NVIDIA drivers and CUDA. The following commands show how to retrieve the latest drivers for a machine running Ubuntu 20.04 as an example. One can update the following based on their OS.

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pinsudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.debsudo dpkg -i cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.debsudo cp /var/cuda-repo-ubuntu2204-12-4-local/cuda-*-keyring.gpg /usr/share/keyrings/sudo apt-get updatesudo apt-get -y install cuda-toolkit-12-4

Virtual environments

We offer various ways of setting up the necessary python environment.

UV virtual environment

The following command will create a virtual environment usinguv and will install the dependencies:

make setup

Using requirements.txt

If you wish to use another virtual environment, you can also install the dependencies using the requirements.txt file:

pip install -r requirements.txtpip install flash-attn==2.8.3 --no-build-isolation# optional for Flash Attention 2

Run H2O LLM Studio GUI

You can start H2O LLM Studio using the following command:

make llmstudio

This command will start theH2O Wave server and app.Navigate tohttp://localhost:10101/ (we recommend using Chrome) to access H2O LLM Studio and start fine-tuning your models!

If you are running H2O LLM Studio with a custom environment other thanuv, you need to start the app as follows:

H2O_WAVE_MAX_REQUEST_SIZE=25MB \H2O_WAVE_NO_LOG=true \H2O_WAVE_PRIVATE_DIR="/download/@output/download" \wave run llm_studio.app

Run H2O LLM Studio GUI using Docker

Install Docker first by following instructions fromNVIDIA Containers. Make sure to havenvidia-container-toolkit installed on your machine as outlined in the instructions.

H2O LLM Studio images are stored in the h2oai Docker Hub container repository.

mkdir -p`pwd`/llmstudio_mntchmod 777`pwd`/llmstudio_mnt# make sure to pull latest image if you still have a prior version cacheddocker pull h2oairelease/h2oai-llmstudio-app:latest# run the containerdocker run \    --runtime=nvidia \    --shm-size=64g \    --init \    --rm \    -it \    -u`id -u`:`id -g` \    -p 10101:10101 \    -v`pwd`/llmstudio_mnt:/mount \    h2oairelease/h2oai-llmstudio-app:latest

Navigate tohttp://localhost:10101/ (we recommend using Chrome) to access H2O LLM Studio and start fine-tuning your models!

(Note other helpful docker commands aredocker ps anddocker kill.)

Run H2O LLM Studio with command line interface (CLI)

You can also use H2O LLM Studio with the command line interface (CLI) and specify the configuration .yaml file that contains all the experiment parameters. To fine-tune using H2O LLM Studio with CLI use the following command:

uv run python llm_studio/train.py -Y {path_to_config_yaml_file}

To run on multiple GPUs in DDP mode, run the following command:

bash distributed_train.sh {NR_OF_GPUS} -Y {path_to_config_yaml_file}

By default, the framework will run on the firstk GPUs. If you want to specify specific GPUs to run on, use theCUDA_VISIBLE_DEVICES environment variable before the command.

To start an interactive chat with your trained model, use the following command:

uv run python llm_studio/prompt.py -e {experiment_name}

whereexperiment_name is the output folder of the experiment you want to chat with (see configuration).The interactive chat will also work with model that were fine-tuned using the UI.

To publish the model to Hugging Face, use the following command:

uv run python llm_studio/publish_to_hugging_face.py -p {path_to_experiment} -d {device} -a {api_key} -u {user_id} -m {model_name} -s {safe_serialization}

path_to_experiment is the output folder of the experiment.device is the target device for running the model, either 'cpu' or 'cuda:0'. Default is 'cuda:0'.api_key is the Hugging Face API Key. If the user is logged in, it can be omitted.user_id is the Hugging Face user ID. If the user is logged in, it can be omitted.model_name is the name of the model to be published on Hugging Face. It can be omitted.safe_serialization is a flag indicating whether safe serialization should be used. Default is True.

Troubleshooting

If running on cloud-based machines such as runpod, you may need to set the following environment variable to allow the H2O Wave server to accept connections from the proxy:

H2O_WAVE_ALLOWED_ORIGINS="*"

If you are experiencing timeouts when running the H2O Wave server remotely, you can increase the timeout by setting the following environment variables:

H2O_WAVE_APP_CONNECT_TIMEOUT="15"H2O_WAVE_APP_WRITE_TIMEOUT="15"H2O_WAVE_APP_READ_TIMEOUT="15"H2O_WAVE_APP_POOL_TIMEOUT="15"

All default to 5 (seconds). Increase them if you are experiencing timeouts. Use -1 to disable the timeout.

Data format and example data

For details on the data format required when importing your data or example data that you can use to try out H2O LLM Studio, seeData format in the H2O LLM Studio documentation.

Training your model

With H2O LLM Studio, training your large language model is easy and intuitive. First, upload your dataset and then start training your model. Start bycreating an experiment. You can thenmonitor and manage your experiment,compare experiments, orpush the model to Hugging Face to share it with the community.

Example: Run on OASST data via CLI

As an example, you can run an experiment on the OASST data via CLI. For instructions, seeRun an experiment on the OASST data guide in the H2O LLM Studio documentation.

Model checkpoints

All open-source datasets and models are posted onH2O.ai's Hugging Face page and ourH2OGPT repository.

Documentation

Detailed documentation and frequently asked questions (FAQs) for H2O LLM Studio can be found athttps://docs.h2o.ai/h2o-llmstudio/. If you wish to contribute to the docs, navigate to the/documentation folder of this repo and refer to theREADME.md for more information.

Contributing

We are happy to accept contributions to the H2O LLM Studio project. Please refer to theCONTRIBUTING.md file for more information.

License

H2O LLM Studio is licensed under the Apache 2.0 license. Please see theLICENSE file for more information.


[8]ページ先頭

©2009-2025 Movatter.jp