Fine-tuning Guide for Tensorfuse
This guide explains how to fine-tune Llama models using Tensorfuse’s QLoRA implementation.Supported Models
Dataset Preparation
Tensorfuse accepts datasets in JSONL format, where each line contains a valid JSON object. The following example shows the format for a conversational dataset using the ChatML format:Dataset Commands
Authentication
Create required secrets. Tensorkube uses Kubernetes Event Driven Autoscaling (KEDA) under the hood to scale and schedule training runs. Hence, you need to create your secrets in thekeda environment:
Programatic Access
Tensorfuse allows you to interact with the TensorKube cluster using the Python SDK, which provides a straightforward interface for creating fine-tuning jobs.Authentication
First, you need to create access keys, which are required to authenticate with the TensorKube cluster deployed in your cloud. Run the following command:get_job_status function. The function returns the status of the job as QUEUED, PROCESSING, COMPLETED, or FAILED.
- find the s3 bucket with prefix
tensorkube-keda-train-bucket. All your training lora adapters will reside here. We construct adapter id from yourjob-idand the type of gpus used for training so your adapter urls would look like this:-s3://<bucket-name>/lora-adapter/<job_name>/<job_id>
fine-tuning-job and job-id unique_id, trained on 4 gpu of type l40s
Model Deployment
- Clone Lorax repository:
- Use the following command to deploy
The below deploy command deploys lorax instance in default environment. Make sure you have created the hugging-face-secret in default environment. You can create secret in default environment by adding
--env default flag in the secret creation command.lorax library.
- Get. your deployment url using
tensorkube list deployments.
Inference
You can now use the deployment URL to make inference requests. Here is an example usingcurl. This will query the base model without any adapters.

