用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/qualcomm/geniex-qairt-plugin --skill add-model命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | add-model |
| description | Add a new LLM model to the geniex runtime (creates spec header, example executable, CMakeLists) |
| allowed-tools | Read, Edit, Write, Bash, Grep |
| arguments | ["model_name"] |
Add a new model called $ARGUMENTS (or ask the user for the model name if not provided).
Create model directory: models/<name>/
Create <name>.h — header-only spec:
makeSpec() returning an LLMSpecmakeModel() returning an LLMModel with appropriate InputProvidersmakeModel() — only a new example .cpp with different paths is neededCreate <name>_example.cpp — example executable:
QnnRuntimeConfig (backend paths)ModelConfig (model binary paths, tokenizer)model.initialize(runtime_cfg, model_cfg)model.generate()Create CMakeLists.txt:
add_executable(<name> <name>_example.cpp)
target_link_libraries(<name> PRIVATE geniex_core geniex-proc)
set_target_properties(<name> PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
Update root CMakeLists.txt:
add_subdirectory(${CMAKE_SOURCE_DIR}/models/<name>)geniex_core targetVerify build: cmake --build build --config Release --target <name> -j32
LLMSpec uses two key fields for shard layout:
.shards — vector of ShardSpec{in_state_name, out_state_name}, one per shard.state_blocks — vector of StateBlockSpec. Use makeKVOnlyStateBlock(...) with per-shard LayerRange{begin, end} or std::nullopt for shards with no KV cacheExample (3-shard model with embedding shard + 2 KV shards):
.shards = {
{"input_ids", "_model_model_embed_tokens_Gather_output_0"},
{"_model_model_embed_tokens_Gather_output_0", "_model_model_layers_7_Add_1_output_0"},
{"_model_model_layers_7_Add_1_output_0", "logits"},
},
.state_blocks = {
makeKVOnlyStateBlock({std::nullopt, LayerRange{0, 7}, LayerRange{8, 15}}),
},
| Provider | When to use |
|---|---|
TokenIdInputProvider | Genie/AI Hub exports (on-device embedding, shard 0 takes input_ids) |
EmbeddingInputProvider | Custom exports with CPU-side embedding table (needs model_cfg.embedding_path) |
RoPEInputProvider | Standard RoPE, no scaling (Qwen3, Falcon3, etc.) |
LongRoPEInputProvider | Long-rope with dynamic scaling + per-dimension ext_factors (Phi3.5) |
PartialRoPEInputProvider | Partial-dimension RoPE with rope_fraction and scale |
Llama3RoPEInputProvider | Llama 3 frequency-dependent scaling (factor=32 for 3.2, factor=8 for 3.1) |
/model/model/...) but QNN graphs may use underscores (_model_model_...). Verify at runtime via graph.inputSpecs()/graph.outputSpecs().LLMModel::onInitialized auto-detects both prefixed (prompt_arN_clM_S_of_T, token_arN_clM_S_of_T) and unprefixed (arN_clM_S_of_T) graph names via regex; nothing to set on LLMSpec.Graph::write(float*) / Graph::read(float*) handle conversion.geniex-proc explicitly (PRIVATE linkage in geniex_core doesn't propagate)..json buildId field.