Skip to main content

LoRA fine-tuning

Produce lightweight adapters from a pinned base model and instruction dataset.

Import this workflow from AkôFlow Hub

Open the public README and measured execution results. The Hub includes the execution capture, activity metrics, logs and version history. Reading public results does not require an account.

In Desktop, choose Create workflow → Import from Hub and paste this version-specific URI:

akoflow://hub/publications/3c09eb33-fb13-4069-a278-0e82c4445ce3/versions/1

Download the exact workflow YAML (v1). Configure the runtime prerequisites below before planning and executing it.

Run this example locally

Freeze a bundled 2×2 base matrix and learn a rank-one additive adapter with gradient descent. Validate loss reduction, publish the adapter weights, and record dataset/base lineage in a parallel branch. This CPU teaching model does not download or fine-tune an LLM.

Install Go and Python 3.12 or newer.

git clone https://github.com/UFFeScience/akoflow-examples.git &&
cd akoflow-examples &&
git checkout --detach d890c3171e3661890305b763b8fc3ede48bb61b4 &&
cd machine-learning/lora-fine-tuning &&
./prepare.sh &&
./run.sh

Run the block from the directory where you keep your repositories. If you already cloned the repository, enter this example's directory and run ./prepare.sh && ./run.sh.

Preparation downloads the Go module and any declared Python packages once. The workload then runs locally with offline input data. Every meaningful step is a separate process; independent activities run in parallel after their dependencies complete.

Read outputs/manifest.json for the generated artifacts, outputs/dag-validation.json for dependency waves, and outputs/stage-<activity>.json for each activity's observed result. A failed stage stops the run and prevents a successful final manifest.

Expected outputs: adapter.bin, evaluation.json, lineage.json.

Run the same activities in Desktop

Start your local AkôFlow daemon with Docker available and configure AKOFLOW_API_TOKEN in your shell. From this example's directory, run:

go run ../../tools/daemon-local -root ../.. -example machine-learning/lora-fine-tuning

This command validates the daemon connection, builds the declared image, registers the local environment and workflow, and submits a real run. The daemon owns execution and file transfers. Open the printed run ID in Desktop to inspect each activity.

LoRA fine-tuning. Nodes in the same column can run in parallel once their dependencies complete.

Activity responsibilities

ActivityResponsibility
fetch-base-modelExecute the fetch-base-model stage and publish its declared outputs for downstream activities.
prepare-examplesExecute the prepare-examples stage and publish its declared outputs for downstream activities.
fine-tune-adaptersExecute the fine-tune-adapters stage and publish its declared outputs for downstream activities.
evaluateExecute the evaluate stage and publish its declared outputs for downstream activities.
publish-adapterExecute the publish-adapter stage and publish its declared outputs for downstream activities.
record-lineageExecute the record-lineage stage and publish its declared outputs for downstream activities.

Inputs

  • Base-model revision
  • Instruction dataset
  • LoRA configuration

Outputs

  • adapter.bin
  • evaluation.json
  • lineage.json

Provenance to preserve

  • Model and dataset revisions
  • GPU/runtime profile
  • Evaluation results

Source bundle

The executable workflow and its implementation files are maintained in the separate AkôFlow examples repository. The documentation intentionally keeps code, container recipes, generators, and validation scripts out of the narrative page.

Open the complete source bundle ↗

Execution evidence

Verified on local Docker: 6/6 activities completed. These captures belong to run showcase-lora-fine-tuning-local-2accb78860-run-20261020t191024.394965000.

Read the daemon execution record · Local output manifest

Open full resolution ↗LoRA fine-tuning: observed activity DAG
The observed activity graph. Click to see the complete capture.

Each stage also ran through the standalone local command. Read the dependency and artifact validation.

fetch-base-model

After: workflow start.

Open full resolution ↗Execution record for activity fetch-base-model

Read the measured local activity result

prepare-examples

After: fetch-base-model.

Open full resolution ↗Execution record for activity prepare-examples

Read the measured local activity result

fine-tune-adapters

After: prepare-examples.

Open full resolution ↗Execution record for activity fine-tune-adapters

Read the measured local activity result

evaluate

After: fine-tune-adapters.

Open full resolution ↗Execution record for activity evaluate

Read the measured local activity result

publish-adapter

After: evaluate.

Open full resolution ↗Execution record for activity publish-adapter

Read the measured local activity result

record-lineage

After: evaluate.

Open full resolution ↗Execution record for activity record-lineage

Read the measured local activity result

Execution considerations

Keep the base model near the accelerator or cache it as a reusable artifact. Every adapter must remain linked to its compatible base revision.

AkôFlow boundary: the engine schedules, deploys, executes, transfers data, and records evidence. The ML or agent framework remains an implementation choice inside each activity.