Uplift Model Tuning logo

Uplift Model Tuning

Organization
QFIN-tech
uplift-model-tuning

已有 successful S-Learner 或 T-Learner modeling_result_path 后,用于生成、确认并执行有边界的 LightGBM learner 调参 study。不要用于首次训练、多模型比较、最终报告或模型采用决策。

Overview

PublisherQFIN-tech
Repositorymodel-evo
Skill nameuplift-model-tuning
Stars
52
Forks
17
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by QFIN-tech on GitHub. Read the source before you install it.

Installation

Install the Uplift Model Tuning AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/QFIN-tech/model-evo/tree/main/model-skills/uplift-model-tuning
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/QFIN-tech/model-evo.git /tmp/model-evo
mkdir -p .claude/skills
cp -r /tmp/model-evo/model-skills/uplift-model-tuning .claude/skills/uplift-model-tuning
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Uplift Model Tuning in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Uplift Model Tuning on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Uplift Model Tuning is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

模型调参

1. 输入依赖

本 skill 只负责基于已完成的 baseline S-Learner 或 T-Learner 做有边界调参:

  • draft_plan 生成调参计划草稿,不训练模型。
  • confirm_plan 记录用户确认和必要风险确认。
  • execute 基于 confirmed plan 真实训练候选 trial,复用 trial_000 baseline 作为对照,并输出 study winner。

本 skill 不比较多个候选集合,不生成最终建模报告,不声明 primary/final/deployment model。

本 skill 是当前 bundle 中唯一调参入口;不要新增或调用 uplift-t-learner-tuning。

已有 successful S-Learner 或 T-Learner modeling_result_path 后使用。

2. 执行入口

统一 CLI:

bash
python <skill-dir>/scripts/run.py --input - --output-dir <output_dir>

Windows 环境可按需将路径分隔符改为反斜杠。

--output-dir 必须是已存在的 run_dir;runner 不创建 run_dir,不扫描 latest/current。draft_plan / confirm_plan 输出到 tuning flow;confirm_plan 必须显式传入 outputs.flow_dir 复用该 flow。draft_plan 校验但不创建 experiment_id,execute 只能使用 confirmed tuning plan 内的 experiment_id 创建 winner experiment,目标 experiment 已存在时返回 needs_input / EXPERIMENT_ALREADY_EXISTS。

请求 JSON 必须通过 stdin 传入:

json
{"action": "draft_plan", "payload": {"experiment_id": "exp-003-s_learner_tuned", "task_config_path": "...", "modeling_sample_spec_path": "...", "feature_plan_path": "...", "modeling_result_path": "..."}}

runner stdout 是 JSON object。调用方只读取 stdout 或 result JSON 中的 outputs.* 字段,例如 outputs.tuning_plan_path、outputs.winner_model_result_path、outputs.model_candidate_path、outputs.report_path。

只接受显式 *_path / *_paths 字段。收到旧的 *_ref / *_refs 输入时,runner 返回 needs_input,并在 issues 与 next_steps 中给出对应替代字段。

3. Actions 与参数说明

draft_plan

  • 输入:experiment_id、task_config_path、modeling_sample_spec_path、feature_plan_path、modeling_result_path。
  • 可选输入:preferences.profile、preferences.selection_dataset_role、preferences.budget、preferences.fixed_parameters、preferences.search_space_overrides、preferences.candidate_grid。
  • 输出:tuning_plan_path。

tuning_plan 必须显式记录:

  • model_spec.model_type
  • model_spec.base_estimators
  • parameter_strategy

v1 只支持 parameter_strategy = "shared"。收到 parameter_strategy = "per_arm"、per_arm_parameters、component_parameters、treatment_parameters 或 control_parameters 时,runner 返回 needs_input,issues[].code = "UNSUPPORTED_PARAMETER_STRATEGY"。

如果 execute 发现 confirmed plan 中的 model_spec 和 baseline result 暴露的 model_spec 不一致,runner 返回 needs_input,issues[].code = "MODEL_SPEC_MISMATCH"。

confirm_plan

  • 输入:source_plan_path 或 tuning_plan_path、warning_acknowledgements、confirmed_by。
  • 输出:confirmed tuning_plan_path。

execute

  • 输入:confirmed tuning_plan_path。
  • 输出:
    • experiment_id
    • experiment_dir
    • tuning_plan_path
    • tuning_result_path
    • trial_metrics_path
    • leaderboard_path
    • winner_result_path
    • winner_model_result_path
    • winner_metrics
    • winner_metrics_path
    • model_candidate_path
    • evaluation_metrics_path
    • model_artifact_path
    • report_path
    • tuning_report_path

读取 baseline 时,selection split 必须存在 outputs.split_evaluations.<split>.auuc_version = {"package": "scikit-uplift", "version": "0.5.1"};缺失或版本不一致时 runner 返回明确错误并提示重跑 baseline。

快速验收只能通过显式小 max_trials、小 candidate_grid 或窄搜索空间控制耗时;这仍是真实调参执行,不是 mock。

4. 输出产物

典型输出目录:

text
{run_dir}/uplift-model-tuning/{timestamp}_model_tuning/
  inputs/0001_draft_plan.request.json
  results/0001_draft_plan.result.json
  artifacts/
    tuning_plan.draft.v1.json
    tuning_plan.confirmed.v1.json
  _flow_manifest.json
  _flow_log.jsonl

{run_dir}/new-models/{experiment_id}/
  inputs/0001_execute.request.json
  results/0001_execute.result.json
  artifacts/
    trial_metrics.v1.json
    leaderboard.v1.csv
    winner_metrics.v1.json
    winner_model_result.v1.json
    model_candidate.v1.json
    tuning_report.md
    s_learner_tuned_model.v1.joblib
    t_learner_tuned_model.v1.joblib
    t_learner_tuned_treatment_model.v1.txt
    t_learner_tuned_control_model.v1.txt
  _experiment_manifest.json
  _experiment_log.jsonl
  report.md

所有 stdout、result、manifest 和 log 中的持久化 path 都是 run_dir 相对路径。下游比较优先通过 experiment_ids 进入 uplift-model-result-comparison 的 draft_comparison_plan。

如果 winner 是 trial_000,model_artifact_path 可指向 baseline 模型文件;winner_model_result_path 仍由本次 study 生成,便于下游比较。

T-Learner 的非 baseline trial 使用同一组 shared LightGBM 参数训练 treatment/control 两个子模型。trial_000 复用 baseline T-Learner model 和 baseline evidence,不重新训练。

5. 与其他 skill 的关联

方向Skill关系
上游uplift-model-s-learner-modeling / uplift-model-t-learner-modeling提供 successful baseline modeling_result_path
下游uplift-model-result-comparison消费 winner experiment_id、winner_model_result_path 或 model_candidate_path 参与模型比较
下游uplift-model-reporting可消费 winner_model_result_path、model_candidate_path、tuning_result_path 生成最终报告

6. 执行约束

本 skill 不比较多个候选集合,不生成最终建模报告,不声明 primary/final/deployment model。

本 skill 是当前 bundle 中唯一调参入口;不要新增或调用 uplift-t-learner-tuning。

快速验收只能通过显式小 max_trials、小 candidate_grid 或窄搜索空间控制耗时;这仍是真实调参执行,不是 mock。

7. 异常处理

7.1 缺依赖处理

本 skill 需要 pandas、numpy、joblib、lightgbm 和 scikit-uplift==0.5.1。runner 不安装依赖。缺包或 LightGBM 无法加载时返回结构化失败,并在 issue/next_steps 中提示阅读本 skill 的缺依赖处理说明,不返回 skill 安装目录文件路径。

7.2 计划、版本与 experiment 异常

收到 parameter_strategy = "per_arm"、per_arm_parameters、component_parameters、treatment_parameters 或 control_parameters 时,runner 返回 needs_input,issues[].code = "UNSUPPORTED_PARAMETER_STRATEGY"。

如果 execute 发现 confirmed plan 中的 model_spec 和 baseline result 暴露的 model_spec 不一致,runner 返回 needs_input,issues[].code = "MODEL_SPEC_MISMATCH"。

读取 baseline 时,selection split 必须存在 outputs.split_evaluations.<split>.auuc_version = {"package": "scikit-uplift", "version": "0.5.1"};缺失或版本不一致时 runner 返回明确错误并提示重跑 baseline。

目标 experiment 已存在时返回 needs_input / EXPERIMENT_ALREADY_EXISTS。收到旧的 *_ref / *_refs 输入时,runner 返回 needs_input,并在 issues 与 next_steps 中给出对应替代字段。

8. 面向用户回复

普通用户回复默认使用中文。先给调参是否完成、winner 是否改善、使用的 selection split、主要风险和下一步。不要把 raw JSON、内部目录结构、长路径清单或实现术语作为主回复内容。

除非用户明确要求查看 JSON、调试、获取产物路径或手动接力下游流程,否则不要在用户回复中展示工程中的 .json 文件路径;tuning_plan_path、winner_model_result_path、model_candidate_path 等 JSON 路径只作为内部/下游输入传递。人类可读报告可以按需给出。

确需精确交接时,可在“技术详情”里保留 tuning_plan_path、winner_model_result_path、model_candidate_path、report_path 等字段名,并说明用途。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Uplift Model Tuning AI skill do?

已有 successful S-Learner 或 T-Learner modeling_result_path 后,用于生成、确认并执行有边界的 LightGBM learner 调参 study。不要用于首次训练、多模型比较、最终报告或模型采用决策。

Why use Uplift Model Tuning on TypingMind?

Because you install it once and use it with any model. Uplift Model Tuning is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Uplift Model Tuning in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/QFIN-tech/model-evo/tree/main/model-skills/uplift-model-tuning. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Uplift Model Tuning?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Uplift Model Tuning?

As many as you like. As long as a model supports skills, you can use Uplift Model Tuning with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Uplift Model Tuning AI skill free?

Yes. It is published on GitHub by QFIN-tech under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇