Teaching Models To Reason - Training, Fine-Tuning, and Evaluating Models with LLaMA Factory on Apolo
This is a tutorial for training, fine-tuning and evaluating models.
Prerequisites
apolo secret add HF_TOKEN <your_token>1. Deploying LLaMA Factory on Apolo
Step 1: Clone the LLaMA Factory Repository
git clone https://github.com/neuro-inc/LLaMA-Factory
cd LLaMA-Factorykind: live
title: llama_factory
defaults:
life_span: 5d
images:
llama_factory:
ref: image:$[[ project.id ]]:v1
dockerfile: $[[ flow.workspace ]]/docker/docker-cuda/Dockerfile
context: $[[ flow.workspace ]]/
volumes:
hf_cache:
remote: storage:$[[ flow.project_id ]]/hf_cache
mount: /root/.cache/huggingface
local: hf_cache
data:
remote: storage:$[[ flow.project_id ]]/data
mount: /app/data
local: data
output:
remote: storage:$[[ flow.project_id ]]/output
mount: /app/saves
local: output
jobs:
llama_factory_webui:
image: ${{ images.llama_factory.ref }}
name: llama-factory
preset: H100X1
http_port: "7860"
detach: true
browse: true
env:
HF_TOKEN: secret:HF_TOKEN
volumes:
- ${{ upload(volumes.data).ref_rw }}
- ${{ volumes.output.ref_rw }}
- ${{ volumes.hf_cache.ref_rw }}
cmd: bash -c "cd /app && llamafactory-cli webui"
Step 2: Build the LLaMA Factory Docker Image on Apolo
Step 3: Run the LLaMA Factory Web UI
Step 4: Access the Web UI

2. Training & Fine-Tuning Models with LLaMA Factory
Option 1: Fine-Tuning Using the Web UI

Parameter
Recommended Value

3. Chat


4. Evaluating Your Fine‐Tuned/Trained Model


5. Exporting the model

PreviousDeepSeek-R1 model deploymentNextAutonomous Research with AgentLaboratory: DeepSeek R1 vs. OpenAI o1
Last updated
Was this helpful?