llm-finetune
Operate RD-Agent FT-Agent workflows for benchmark-driven LLM data processing, fine-tuning, merge, evaluation, and feedback loops.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- llm-finetune
- license
- MIT
- metadata
- { "disco-role": "operating", "parent-skill": "rd-agent" }
- description
- Operate RD-Agent FT-Agent workflows for benchmark-driven LLM data processing, fine-tuning, merge, evaluation, and feedback loops.
- disable-model-invocation
- true
02 资源文件 1
- 参考文档references/fine-tune-contract.md1.2 KB
03 SKILL.md 正文
RD-Agent LLM fine-tuning
Use this sub-skill for rdagent llm_finetune, FT-Agent datasets/benchmarks, LLaMA-Factory training configuration, OpenCompass evaluation, batch jobs, and the fine-tune UI.
Prerequisites and cost gate
A realistic run can download models and datasets, call an LLM provider, start Docker or conda training environments, and consume GPU hours. Before running, confirm Linux, a usable Docker/conda backend, NVIDIA/CUDA capacity when required, Hugging Face access, provider credentials, and a stable FT_FILE_PATH. A missing prerequisite is a blocked run, not a reason to substitute a toy score.
Keep the main settings explicit and secret-free in the shell or a private .env:
BACKEND
CHAT_MODEL
OPENAI_API_KEY / OPENAI_API_BASE
EMBEDDING_MODEL
FT_FILE_PATH
FT_Coder_CoSTEER_env_type=docker|conda
FT_TARGET_BENCHMARK
FT_BENCHMARK_DESCRIPTION
FT_BASE_MODEL
FT_UPPER_DATA_SIZE_LIMIT
FT_API_MAX_WORKERS
FT_STRONG_MODELS / FT_WEAK_MODELS
HF_TOKEN (only when required)
Use validate_ft_env.py to print presence only; it never prints values.
Single-task workflow
Start with help and a bounded configuration:
rdagent llm_finetune --help
rdagent llm_finetune \
--benchmark <benchmark> \
--benchmark-description "<task and output format>" \
--base-model <huggingface-model-id> \
--loop-n 1 \
--timeout <short-budget>
The checked-in implementation follows this progression:
- inspect the benchmark and registered raw datasets;
- generate data-processing code and a training config;
- fail fast on schema/config/runtime errors;
- fine-tune the target model;
- evaluate with the configured evaluation stack;
- feed validation feedback into the next iteration while keeping test results for final reporting.
The --dataset option selects the agent's dataset after registered resources are prepared; it does not necessarily avoid initial dataset preparation. Reuse a stable FT_FILE_PATH when intentionally caching assets.
Batch jobs and UI
For repeatable multi-task runs, copy the checked-in task template to a private file, copy the private .env into the job directory, and run the bundled job shell script only after inspecting its commands. The Streamlit fine-tune UI is a reporting/interaction surface, not proof that training or evaluation succeeded. Preserve training config, dataset schema, checkpoint path, merge/evaluation output, and validation metric.
Failure boundaries
- dataset/download/license failure → data/provider block;
- generated data schema failure → fix processing before training;
- Docker/CUDA/model-load failure → backend block;
- training completes but evaluation cannot consume the checkpoint → artifact/evaluator failure;
- provider quota or context failure → provider failure, not a model-quality result.
Read fine-tune-contract.md before a costly run and the parent troubleshooting guide for recovery.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.