Lightcompress Quant Explore logo

Lightcompress Quant Explore

Organization
HorizonRobotics
lightcompress-quant-explore

执行 LightCompress 量化实验并生成精度报告。当用户要求运行量化实验、量化精度测试或 PPL 评估时触发。

Overview

PublisherHorizonRobotics
RepositoryOE-Skills
Skill namelightcompress-quant-explore
Stars
28
Forks
4
Bundled files
15
LicenseApache-2.0
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.

  • 15 bundled files

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

  • Open source

    Published by HorizonRobotics on GitHub. Read the source before you install it.

Installation

Install the Lightcompress Quant Explore 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/HorizonRobotics/OE-Skills/tree/main/horizon/skills/llm/lightcompress/lightcompress-quant-explore
  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/HorizonRobotics/OE-Skills.git /tmp/OE-Skills
mkdir -p .claude/skills
cp -r /tmp/OE-Skills/horizon/skills/llm/lightcompress/lightcompress-quant-explore .claude/skills/lightcompress-quant-explore
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Lightcompress Quant Explore 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 Lightcompress Quant Explore 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 Lightcompress Quant Explore 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.

LightCompress 量化探索实验

执行流程(4 阶段)

Phase 1: 准备实验

调用 prepare_experiment.py 创建实验目录和 YAML 配置:

bash
python {skill_dir}/scripts/prepare_experiment.py \
  --model /path/to/model \
  --model-type Qwen2 \
  --method smoothquant \
  --w-bit 8 \
  --a-bit 8

注意:不指定 --workspace 时,脚本默认使用 {当前工作目录}/experiments 作为输出目录。

脚本输出 JSON 包含:

  • experiment_dir: 实验目录路径
  • config_path: YAML 配置路径
  • yaml_content: 完整 YAML 配置内容

Phase 2: 用户确认

向用户展示完整的 YAML 配置内容,让用户检查是否符合预期。

使用 AskUserQuestion 询问:开始实验 / 取消

Phase 3: 执行实验

用户确认后,调用 execute_experiment.py 执行实验:

bash
python {skill_dir}/scripts/execute_experiment.py {experiment_dir}

Phase 4: 保存精度缓存

实验成功后,检查 <project_root>/.claude/skills/quant-accuracy-cache/ 是否存在:

  • 存在:调用 quant-accuracy-cache skill 保存结果
  • 不存在:跳过

参数说明

prepare_experiment.py 参数

参数必需说明默认值
--model✅模型路径-
--model-type✅模型类型-
--method✅量化方法-
--w-bit权重量化位宽4
--a-bit激活量化位宽8
--fast-mode快速验证模式false
--save-artifacts保存量化产物false
--workspace工作目录./experiments
--mix-bits混合精度组(可多次),见下方示例-
--special覆盖 quant.special 参数(可多次),KEY=VAL-
--calib-path校准数据集路径内置 wikitext2_calib
--calib-name校准数据集名wikitext2
--calib-n-samples校准样本数(显式值不被显存降级)自动
--calib-seq-len校准序列长度模板默认
--calib-preproc校准预处理wikitext2_gptq
--eval-path评估数据集路径内置 wikitext2_eval
--eval-seq-len评估序列长度模板默认
--no-eval-pretrain只评 fake_quant,跳过 pretrainfalse
--inference-per-block逐 block 推理评测(大模型省显存)false
--save-pathfakequant 保存路径(指定即开 save_fake)-

混合精度 (mix_bits) 示例

将 q/o_proj + MoE expert 设为 W4、其余 W8(Gemma4Moe 常用):

bash
python {skill_dir}/scripts/prepare_experiment.py \
  --model /jfs-public/openexplorer_llm/models/gemma-4-26B-A4B-it \
  --model-type Gemma4Moe --method gptq --w-bit 8 --a-bit 8 \
  --mix-bits "name=qo_experts_w4;bit=4;layers=self_attn.q_proj,self_attn.o_proj,experts.experts.*.gate_proj,experts.experts.*.up_proj,experts.experts.*.down_proj" \
  --calib-n-samples 256 --calib-seq-len 1024 \
  --no-eval-pretrain --inference-per-block \
  --save-path /path/to/save/ \
  --env-activate ~/miniconda3/etc/profile.d/conda.sh
  • --mix-bits 格式:"name=组名;bit=位宽;layers=层1,层2,...",层名支持通配符 *(如 experts.experts.*.gate_proj)。多组混合精度可多次传 --mix-bits。
  • 未列入 mix_bits 的层使用全局 --w-bit 位宽。

支持的模型类型

模型系列type 值
QwenQwen, Qwen2, Qwen3, Qwen3Moe
InternVLInternVL2, InternVL3_5
DeepSeekDeepSeekV2, DeepSeekV3
Gemma4Gemma4, Gemma4Moe(MoE 自动识别 num_experts)

外部配置文件

文件用途
base_template.ymlYAML 模板
methods_config.yml量化方法参数
pretrain_accuracy_cache.ymlpretrain 缓存

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 Lightcompress Quant Explore AI skill do?

执行 LightCompress 量化实验并生成精度报告。当用户要求运行量化实验、量化精度测试或 PPL 评估时触发。

Why use Lightcompress Quant Explore on TypingMind?

Because you install it once and use it with any model. Lightcompress Quant Explore 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 Lightcompress Quant Explore in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HorizonRobotics/OE-Skills/tree/main/horizon/skills/llm/lightcompress/lightcompress-quant-explore. 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 Lightcompress Quant Explore?

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 Lightcompress Quant Explore?

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

Is the Lightcompress Quant Explore AI skill free?

Yes. It is published on GitHub by HorizonRobotics under the Apache-2.0 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 👇