Last Update: April 23, 2025

Fine-Tuning

Fine-tuning is a powerful tool for customizing pre-trained models to fit specific needs. At Hyperstack Gen AI Platform, we've made it easier than ever for users to fine-tune their models using our User Interface or API.

Fine-tuning Through API

You can start a fine-tuning job by making a POST request to the training pod endpoint:

MODEL_NAME="finetuned-mistral-7b"
BASE_MODEL="mistral-7b-instruct-v0.3"
curl -X POST https://api.genai.hyperstack.cloud/tailor/v1/training-pod \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "base_model": "'$BASE_MODEL'",
    "model_name": "'$MODEL_NAME'",
    "tags": ["tag1", "tag2"],
    "custom_logs_filename": "optional-filename",
    "save_logs_with_tags": true,
    "custom_dataset": "optional-dataset-name",
    "skip_logs_with_errors": true,
    "use_synthetic_data": true,
    "parent_model_id": "optional-parent-model-id",
    "batch_size": 1,
    "epoch": 1,
    "learning_rate": 0.0001,
    "lora_r": 8,
    "lora_alpha": 16,
    "lora_dropout": 0.1
  }'

Required Parameters:

  • base_model: The name of the base model to fine-tune
  • model_name: A unique name for your fine-tuned model (cannot start with reserved prefixes)

Optional Parameters:

  • tags: Array of tags to filter training data
  • custom_logs_filename: Filename for custom logs upload
  • save_logs_with_tags: Whether to save uploaded logs with tags
  • custom_dataset: Name of a custom dataset to use
  • skip_logs_with_errors: Whether to skip invalid logs (default: true)
  • use_synthetic_data: Whether to use synthetic data (default: true)
  • parent_model_id: ID of the parent model for incremental training
  • batch_size: Training batch size
  • epoch: Number of training epochs
  • learning_rate: Learning rate for training
  • lora_r: LoRA rank parameter
  • lora_alpha: LoRA alpha parameter
  • lora_dropout: LoRA dropout rate

Fine-tuning Through UI

The starting a training job page guides you through the process of initiating model training.

Step by Step Guide:

1. Configure Basic Settings

  • Model Name: Enter a name for your fine-tuned model.
  • Base Model: Select the base model you would like to use for fine-tuning.

2. Select Training Data

Users can choose the type of data to use for the training:

  • All logs: Use all available logs.
  • By tags: Select logs based on specific tags.
  • By dataset: Select logs based on the dataset name.
  • Upload logs: Upload logs specifically for this training job. You can choose to save these logs with custom tags or not save them, in which case the data will not be stored on our servers after the training.

3. Adjust Advanced Settings

For advanced users, we provide the option to adjust the following parameters:

  • Epochs: The number of complete passes through the training dataset.
  • Batch Size: The number of training examples utilized in one iteration.
  • Learning Rate: The step size at each iteration while moving toward a minimum of the loss function.
  • LoRA Rank (r): The rank of the low-rank adaptation matrices.
  • LoRA Alpha: The scaling factor for the LoRA weights.
  • LoRA Dropout: The dropout rate for LoRA layers.

4. Review Estimates

To help users make informed decisions, we provide an estimation box that includes:

  • Estimated Time to Train: An estimate of how long the training will take.
  • Training Progress: The current status of the training job.
  • Recommended Minimum Number of Logs: A recommendation on the minimum number of logs needed for significant model improvement.

5. Start Training!

Once you've configured all the necessary parameters, click the "Start Training" button to begin the fine-tuning process. Here's what happens next:

  1. Data Validation: The system will validate your training data:

    • If no specific data selection is made (tags, custom logs, or dataset), all available chat logs in your account will be used
    • Invalid logs will be handled according to your error handling preference
    • You'll be notified if there are insufficient valid logs for training
  2. Training Initialization:

    • The system will allocate necessary computing resources
    • You'll receive a confirmation that training has started
  3. Progress Monitoring:

    • Track the training progress in real-time through the UI
    • View metrics such as training loss and validation loss

See more details about monitoring your training job in the Monitoring Jobs section.

Was this page helpful?