End-to-End Fine-Tuning of a Text Generation Model
This page walks through a complete fine-tuning run using the HTTP API andcurl, mirroring the minimal Python example you provided.
You will:
- Create a fine-tune
- Start the fine-tune run
- Monitor the fine-tune until it completes
NAMESPACE = "Tutorials"REPO = "FinancialSentiment"
Prerequisites
- Repository on Oxen with your training data committed, for example:
- Namespace:
Tutorials - Repository:
FinancialSentiment
- Namespace:
- Dataset resource inside that repo, for example:
main/train_financial_sentiment.parquet- You can view this example dataset (including columns like
textandsentiment) and its repository here: Tutorials / FinancialSentiment dataset
- API key with access to the repo:
- Exported as
OXEN_API_KEY
- Exported as
- Base URL for the Oxen API:
- Local dev example:
https://hub.oxen.ai - Exported as
OXEN_BASE_URL(optional, defaults shown below)
- Local dev example:
resource:main/train_financial_sentiment.parquetbase_model:Qwen/Qwen3-0.6Bscript_type:text_generation
question_column:textanswer_column:sentimentepochs:1batch_size:1learning_rate:0.0001grad_accum:1lora_alpha:16lora_rank:16seq_length:1024logging_steps:10enable_thinking:falseneftune_noise_alpha:0.0save_steps_ratio:0.25save_strategy:epochuse_lora:true
Step 1 – Create a Fine-Tune
EndpointPOST /api/repos/{owner}/{repo}/fine_tunes
curl request (mirrors the Python payload):
fine_tune object. For example:
id (for example ft_12345) for the next steps.
If you have jq installed, you can capture it directly:
Step 2 – Start the Fine-Tune Run
Once you have afine_tune.id, trigger the run.
Endpoint
POST /api/repos/{owner}/{repo}/fine_tunes/{fine_tune_id}/actions/run
curl request:
Step 3 – Monitor Fine-Tune Status
You can poll the fine-tune to see when it completes. EndpointGET /api/repos/{owner}/{repo}/fine_tunes/{fine_tune_id}
curl loop (bash):
curl equivalent of the Python monitoring loop:
With these three steps, you have a complete end-to-end fine-tuning run using only
curl, matching the minimal Python example but fully scriptable from the command line.