Step-by-step tutorials for common workflows
End-to-end walkthrough from dataset to deployed model
First, create a JSONL file with your training examples. Each line should be a valid JSON object.
{"messages": [{"role": "user", "content": "What is machine learning?"}, {"role": "assistant", "content": "Machine learning is..."}]}
{"messages": [{"role": "user", "content": "Explain neural networks"}, {"role": "assistant", "content": "Neural networks are..."}]}curl -X POST https://finetunelab.ai/api/training/datasets \
-F "file=@training_data.jsonl" \
-F "name=My Training Dataset"curl -X POST https://finetunelab.ai/api/training \
-d '{
"name": "my-finetuned-model",
"base_model": "meta-llama/Llama-3.2-1B",
"dataset_id": "dataset-123",
"epochs": 3
}'curl -X POST https://finetunelab.ai/api/training/execute \
-d '{"id": "config-456"}'curl https://finetunelab.ai/api/training/metrics/job-789"Walk me through fine-tuning a model on my custom dataset"
Professional guide for creating high-quality training datasets
Quality Over Quantity: A smaller, high-quality dataset is often more effective than a large, noisy one.
Research shows: For every 1% increase in training data error, you may see a ~4% increase in model error (quadratic impact).
| Use Case | Minimum | Recommended | Optimal |
|---|---|---|---|
| Simple tasks (formatting, tone) | 50-100 | 200-500 | 500-1,000 |
| Domain-specific assistant | 500 | 1,000-2,000 | 5,000-10,000 |
| Technical support bot | 1,000 | 2,000-5,000 | 10,000-20,000 |
| Complex reasoning | 5,000 | 10,000-50,000 | 100,000+ |
A well-balanced dataset should include these categories in the following ratios:
Standard Q&As about features, capabilities, and workflows. What the system DOES do.
Explicitly state what the system does NOT support. Critical to prevent hallucinations.
Example: "Q: Can I train on AWS? A: No. Training only runs on RunPod infrastructure."
Define edges of functionality - when it works, when it doesn't. Prevents overgeneralization.
Clarify concepts that could be confused. Distinguish similar concepts.
Granular UI navigation and step-by-step workflows. Enable self-service.
Power user details, pricing nuances, performance tips. Expert insights and gotchas.
Common errors, troubleshooting, and solutions. Prevent user frustration.
Model fills gaps with prior knowledge, creates plausible but wrong answers. Maintain 15-20% adversarial examples.
1% error in data → ~4% error in model (quadratic). Invest in cleaning upfront.
Dedicate 15-20% of dataset to edge cases and boundary examples. Model fails on unusual inputs otherwise.
For every major feature, include "what we DON'T do" examples to prevent confident wrong answers.
"Help me create a balanced training dataset using the 7-category framework"
This section is based on comprehensive research from 2025 enterprise best practices. For the full detailed guide with sources and advanced techniques, see:
Professional Dataset Creation Guide →Format, validate, and optimize your training data
Poor quality data leads to poor models. Spend time cleaning and formatting your dataset properly.
Training data must be in JSONL format (JSON Lines) with each line containing a messages array:
{
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "User question here"},
{"role": "assistant", "content": "Model response here"}
]
}Minimum 50 examples, optimal 500-5000 examples
Better to have 100 high-quality examples than 1000 poor ones
Cover different scenarios and edge cases
Use the same structure and tone across all examples
messages arrayrole and content fieldsOptimize training parameters for best results
Learning rate, batch size, and epochs are the most impactful parameters to tune.
Controls how fast the model learns. Too high = unstable, too low = slow convergence.
1e-5 to 1e-4Recommended for most fine-tuning tasks1e-4 to 1e-3For smaller models or large datasets> 1e-3Usually too high, may cause training instabilityNumber of examples processed before updating model weights.
1-2Small GPU memory (<8GB VRAM)4-8Medium GPU (8-16GB VRAM)16-32Large GPU (>16GB VRAM)Number of times the model sees the entire dataset.
1-3Large datasets (>1000 examples)3-5Medium datasets (100-1000 examples)5-10Small datasets (<100 examples){
"learning_rate": 0.0001,
"batch_size": 4,
"epochs": 3,
"warmup_steps": 100,
"eval_steps": 50,
"save_steps": 100
}Deploy your trained model to cloud inference with RunPod Serverless
Deploy to cloud with auto-scaling, pay-per-request pricing, and built-in budget controls.
Go to Settings → Secrets and add your RunPod API key with name "runpod".
curl -X POST https://finetunelab.ai/api/inference/deploy \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"provider": "runpod-serverless",
"deployment_name": "my-model-prod",
"training_job_id": "your-job-id",
"gpu_type": "NVIDIA RTX A4000",
"budget_limit": 10.0
}'Navigate to /inference page to view deployment status, cost tracking, and manage your endpoint.
curl https://finetunelab.ai/api/inference/deployments/dep-xyz789/status \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"curl -X POST https://api.runpod.ai/v2/endpoint-id/runsync \
-d '{
"input": {"prompt": "Hello", "max_tokens": 100}
}'Budget Limits: Set minimum budget of $1.00, recommended $10-50 for production
Cost Tracking: View real-time spend, request count, and cost per request on /inference page
Budget Alerts: Automatic alerts at 50%, 80%, and 100% budget utilization
Auto-Stop: Deployment automatically stops when budget limit is reached (optional)
GPU Pricing: A4000 ($0.0004/req) | A5000 ($0.0006/req) | A6000 ($0.0008/req) | H100 ($0.0035/req)
Track training progress and analyze results
curl https://finetunelab.ai/api/training/metrics/job-789{
"job_id": "job-789",
"current_step": 150,
"total_steps": 300,
"train_loss": 0.234,
"eval_loss": 0.298,
"learning_rate": 0.00009,
"epoch": 1.5,
"gpu_memory_used": "12.5GB"
}curl https://finetunelab.ai/api/training/logs/job-789curl https://finetunelab.ai/api/training/analytics/job-789Training loss decreases steadily, eval loss follows similar pattern
Training loss decreases but eval loss increases or plateaus
Loss increases, stays flat, or shows erratic behavior
When training isn't going well, it's crucial to identify whether the problem is your model choice or your dataset. Here's how to tell:
💡 Solutions:
💡 Solutions:
"Show me the training metrics and explain if my model is learning properly"
You now have comprehensive guides covering the complete fine-tuning workflow. Start with a small dataset and experiment!