agentleFS
Seeed-ProjectsSeeed-Projects/Seeed-Jetson-DevelopTool/skills/codex/finetune-llm-llama-factory/AGENTS.md

Seeed-Jetson-DevelopTool / finetune-llm-llama-factory

AGENTS.md57 starsChanged 4 months agoMITView on GitHub

Fine-tune LLMs on Jetson using Llama-Factory via jetson-examples one-line deployment. Covers installation, WebUI-based training with alpaca_zh dataset on Phi-1.5, and testing the fine-tuned model. Requires Jetson with ≥16GB RAM.

  • Installs packages

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run one phase at a time. After each phase:

    line 12
  2. Very specific:

    If output contains [STOP] → stop immediately, consult the failure decision tree below.

    line 14
  3. Very specific:

    If output ends with [OK] → tell the user "Phase N complete" and proceed to the next phase.

    line 15
  4. Distinctive:

    Keep other training parameters as default

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Fine-tune LLM with Llama-Factory on Jetson


Execution model

Run one phase at a time. After each phase:

  • Relay all command output to the user.
  • If output contains [STOP] → stop immediately, consult the failure decision tree below.
  • If output ends with [OK] → tell the user "Phase N complete" and proceed to the next phase.

Prerequisites

RequirementDetails
HardwareJetson device with ≥16GB RAM (tested on Orin NX 16GB and AGX Orin 64GB)
PeripheralsMonitor, mouse, keyboard, network (optional but recommended)
JetPack5.x or 6.x
InternetRequired for initial container pull

Phase 1 — Install jetson-examples (~2 min)

pip3 install jetson-examples
sudo reboot

[OK] after reboot completes and you can log back in.


Phase 2 — Deploy Llama-Factory (~5–15 min)

Launch Llama-Factory using the one-line deployment:

reComputer run llama-factory

This pulls the container and starts the Llama-Factory service.

Once running, open a web browser and navigate to:

http://127.0.0.1:7860

(Or replace 127.0.0.1 with the Jetson's IP for remote access.)

[OK] when the Llama-Factory WebUI loads in the browser. [STOP] if the container fails to start.


Phase 3 — Start training (~18 hours for default config)

In the WebUI:

  1. Set Model name to Phi-1.5 (or your chosen model)
  2. Set Dataset to alpaca_zh (or your chosen dataset)
  3. Keep other training parameters as default
  4. Click the Start button

Monitor training progress in the WebUI.

[OK] when training completes and the fine-tuned model appears in the save directory.


Phase 4 — Test the fine-tuned model (~2 min)

In the Llama-Factory WebUI:

  1. Navigate to the Chat tab
  2. Load the fine-tuned model by selecting the checkpoint path
  3. Enter a prompt in the Input text box (e.g. a Chinese language prompt if using alpaca_zh)
  4. Click Submit and check the output in the Chatbot text box

[OK] when the model responds with coherent output reflecting the fine-tuning data.


Failure decision tree

SymptomAction
pip3 install jetson-examples failsCheck Python3 and pip3 are installed. Try sudo apt install python3-pip first.
reComputer run llama-factory failsCheck internet connectivity. Ensure Docker is installed and running. Check available disk space.
WebUI not accessible at port 7860Verify the container is running with docker ps. Check firewall rules. Try http://<jetson-ip>:7860.
OOM during trainingModel too large for available RAM. Use a smaller model or reduce batch size in training parameters.
Training stalls or crashesCheck GPU temperature with jtop. Ensure adequate cooling. Reduce training parameters.
Fine-tuned model produces poor resultsUse more diverse fine-tuning data. Increase training epochs. Check dataset quality.

Reference files

  • references/source.body.md — full original Seeed tutorial with screenshots, video demo, and detailed WebUI configuration (reference only)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.