Oe Package Detection logo

Oe Package Detection

Organization
HorizonRobotics
oe-package-detection

OE 包环境检测 Skill。当任务涉及量化、编译、部署等工具链操作,且 .horizon/.env.oe-package 不存在时触发。自动完成 OE 包路径定位、版本采集、本地环境匹配检查、GPU/CPU Docker 判定,并将结果写入 .env 文件。

Overview

PublisherHorizonRobotics
RepositoryOE-Skills
Skill nameoe-package-detection
Stars
28
Forks
4
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Oe Package Detection 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/horizon-router/oe-package-detection
  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/horizon-router/oe-package-detection .claude/skills/oe-package-detection
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Oe Package Detection 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 Oe Package Detection 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 Oe Package Detection 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.

OE 包环境检测

执行方式

本 Skill 应通过 subagent 执行。 主 agent 在前置检查中发现 .env.oe-package 缺失或不完整时,应将本文件的完整内容作为 subagent prompt 派发执行。subagent 完成后汇报写入结果(OE 路径、版本、执行模式),主 agent 读取 .env.oe-package 继续后续流程。

目标

检测 OE 包路径、版本及本地环境匹配情况,写入 .horizon/.env.oe-package,供后续所有工具链任务直接使用。

触发条件

任何涉及量化、编译、部署、板端推理、性能/精度评估的任务进入 horizon-router 前,如果 .horizon/.env.oe-package 不存在,顶层 Skill 会中断任务并提示用户:

未检测到 OE 包环境配置(.horizon/.env.oe-package)。请提供 OE 包路径,或回复"跳过"暂不配置。

  • 用户提供路径 → 进入本检测流程
  • 用户回复"跳过" → 记录跳过(仅当次对话有效,下次仍会提示),继续后续任务

检测流程

1. 检查 .horizon/.env.oe-package 是否存在

  • 文件存在且内容完整(包含 OE_DIR、OE_VERSION、EXECUTION_MODE 等字段)→ 直接读取,跳过后续步骤
  • 文件不存在或不完整 → 进入步骤 2

2. 定位 OE 包路径

按优先级查找:

  1. 环境变量:OE_DIR、OPEN_EXPLORER_DIR、HORIZON_OE_DIR
  2. 项目配置文件:.env、.horizon/oe.env、CLAUDE.md 中声明的路径
  3. 常见路径探测:/open_explorer、~/open_explorer、/opt/openexplorer
  4. 以上都没有 → 询问用户 OE 包路径

找到路径后,验证目录中存在 OE 包的标志性文件(如 run_docker.sh、samples/、docs/、toolchain/ 等至少两个),否则提示用户确认路径是否正确。

3. 采集 OE 版本信息

从 OE 包目录中提取以下信息:

OE 包整体版本:

  • 检查 version.txt、VERSION、release_notes.md 或 release_notes.txt
  • 从文件名推断(如 OpenExplorer_v3.9.0_rc4)
  • 以上都无法确定时询问用户

各组件版本(通过 pip show 检查已安装版本,同时记录 OE 包内 whl 文件名中的版本):

组件pip 包名说明
horizon_tc_uihorizon-tc-ui模型集成工具
hmcthmct模型转换/量化工具
horizon_plugin_pytorchhorizon-plugin-pytorchPyTorch 量化插件(QAT)
hbdk4_compilerhbdk4-compiler编译器

Docker 信息:

  • 检查 run_docker.sh 是否存在
  • 从 run_docker.sh 内容或 OE 版本推断 Docker 镜像名称:
    • CPU:openexplorer/ai_toolchain_ubuntu_22_j6_cpu:{version}
    • GPU:openexplorer/ai_toolchain_ubuntu_22_j6_gpu:{version}

4. 本地环境匹配检查

在当前环境中逐项检测:

  1. Python 版本:python3 --version,要求 >= 3.8
  2. pip 组件:对每个组件执行 pip show <包名>,记录:
    • 是否安装
    • 版本号是否与 OE 包声明一致
  3. CLI 工具可用性:检查以下命令是否可执行:
    • hb_compile --version(或 which hb_compile)
    • hb_model_info --version(或 which hb_model_info)
    • hmct-debugger --version(或 which hmct-debugger)

根据检查结果判定执行模式:

  • 全部匹配 → EXECUTION_MODE=local
  • 部分缺失或版本不匹配 → EXECUTION_MODE=docker,记录缺失项

5. Docker 模式下的 GPU/CPU 判定

当 EXECUTION_MODE=docker 时,需要确定使用 GPU 还是 CPU 镜像:

  1. 启动 GPU Docker 容器并测试 GPU 可用性(注意 GPU 镜像 Entrypoint 为 /bin/bash,必须用 --entrypoint + -c 传命令):

    bash
    docker run --rm --gpus all --entrypoint /bin/bash \
      openexplorer/ai_toolchain_ubuntu_22_j6_gpu:{version} -c "nvidia-smi"
  2. 检查 nvidia-smi 输出:

    • 能正常输出 GPU 信息 → DOCKER_TYPE=gpu
    • 报错或无 GPU 设备 → DOCKER_TYPE=cpu
  3. 采集 GPU 详细信息(仅当 GPU 可用时):

    bash
    docker run --rm --gpus all --entrypoint /bin/bash \
      openexplorer/ai_toolchain_ubuntu_22_j6_gpu:{version} -c "python3 -c \"
    import torch, json
    info = {'cuda_version': torch.version.cuda, 'gpu_count': torch.cuda.device_count(), 'gpus': []}
    for i in range(torch.cuda.device_count()):
        p = torch.cuda.get_device_properties(i)
        info['gpus'].append({'index': i, 'name': p.name, 'memory_gb': round(p.total_memory/1024**3,1), 'compute_capability': f'{p.major}.{p.minor}'})
    print(json.dumps(info))
    \""

    将返回的 JSON 写入 GPU_INFO 字段。如果 PyTorch 无法识别 GPU(cuda.is_available()=False),则 GPU_INFO 设为空。

  4. 向用户提示判定结果:

    • GPU 可用时:检测到 N 张 <GPU型号>,默认使用 GPU Docker 镜像
    • GPU 不可用时:未检测到可用 GPU,将使用 CPU Docker 镜像。如需 GPU 加速,请检查 NVIDIA 驱动和 Docker GPU 支持

6. 写入 .horizon/.env.oe-package

bash
# OE 包环境信息(自动生成)
# 检测时间:<timestamp>

# === OE 包基本信息 ===
OE_DIR=<OE 包路径>
OE_VERSION=<OE 版本号,如 3.9.0_rc4>

# === 组件版本 ===
HORIZON_TC_UI_VERSION=<版本>
HMCT_VERSION=<版本>
HORIZON_PLUGIN_PYTORCH_VERSION=<版本>
HBDK_COMPILER_VERSION=<版本>

# === 执行模式 ===
EXECUTION_MODE=<local | docker>

# --- 以下仅在 EXECUTION_MODE=docker 时填写 ---
DOCKER_TYPE=<gpu | cpu>
DOCKER_IMAGE=openexplorer/ai_toolchain_ubuntu_22_j6_<gpu|cpu>:<version>
DOCKER_RUN_CMD=bash <OE_DIR>/run_docker.sh ./data
DOCKER_EXEC_PREFIX=docker run --rm [--gpus all] --entrypoint /bin/bash <DOCKER_IMAGE> -c
MISSING_COMPONENTS=<缺失或不匹配的组件列表,逗号分隔>

# --- 以下仅在 DOCKER_TYPE=gpu 时填写 ---
GPU_INFO=<JSON: {"cuda_version":"...","gpu_count":N,"gpus":[{"index":0,"name":"...","memory_gb":...,"compute_capability":"..."},...]}>

DOCKER_EXEC_PREFIX 说明:GPU 镜像的 Entrypoint 为 ['/bin/bash'],非交互式执行命令时如果直接 docker run image cmd,实际会执行 /bin/bash cmd(把 cmd 当脚本文件名),报 cannot execute binary file。必须用 --entrypoint /bin/bash image -c "cmd" 的方式。DOCKER_EXEC_PREFIX 已包含正确的 entrypoint 处理,子 Skill 直接拼接即可:$DOCKER_EXEC_PREFIX "hb_compile ..."。CPU 镜像无此问题,但统一使用 DOCKER_EXEC_PREFIX 可避免遗漏。

  • 后续任务直接读取此文件,无需重复检测
  • 如果 EXECUTION_MODE=local,不填写 Docker 相关字段

后续任务的使用方式

顶层 Skill 路由到子 Skill 后,子 Skill 在执行 CLI 命令前读取 EXECUTION_MODE:

  • local → 直接在当前环境执行 CLI 命令
  • docker → 读取 DOCKER_EXEC_PREFIX,拼接 CLI 命令:
    bash
    # 非交互式单命令(推荐,直接拼 DOCKER_EXEC_PREFIX)
    eval "$DOCKER_EXEC_PREFIX 'hb_compile -m model.onnx -o output.hbm'"
    
    # 交互式(通过 run_docker.sh 启动 shell)
    bash <OE_DIR>/run_docker.sh ./data
    
    # 手动 docker run
    docker run -it --rm \
      -v <OE_DIR>:/open_explorer \
      -v ./dataset:/data/horizon_j6/data \
      <DOCKER_IMAGE>

注意事项

  • OE 包版本决定了各组件的兼容版本,混用不同版本可能导致量化或编译失败
  • 如果用户更换了 OE 包或升级了组件,需要删除 .horizon/.env.oe-package 重新检测
  • Docker 模式下,OE 包路径会自动挂载到容器内的 /open_explorer,命令中应使用容器内路径

Frequently asked questions

What does the Oe Package Detection AI skill do?

OE 包环境检测 Skill。当任务涉及量化、编译、部署等工具链操作,且 .horizon/.env.oe-package 不存在时触发。自动完成 OE 包路径定位、版本采集、本地环境匹配检查、GPU/CPU Docker 判定,并将结果写入 .env 文件。

Why use Oe Package Detection on TypingMind?

Because you install it once and use it with any model. Oe Package Detection 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 Oe Package Detection in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HorizonRobotics/OE-Skills/tree/main/horizon/skills/horizon-router/oe-package-detection. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Oe Package Detection?

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 Oe Package Detection?

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

Is the Oe Package Detection 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 👇