计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
models-and-embeddings【效率与协作】Guides Semantra embedding model selection, OpenAI and Hugging Face backends, pooling options, and backend troubleshooting.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is to choose, inspect, or troubleshoot the embedding model Semantra uses while indexing documents and running semantic queries.
--model value to use: mpnet, minilm, sgpt,
sgpt-1.3B, or openai.--transformer-model.OPENAI_API_KEY
diagnosis.--pool-size, --pool-count, document/query special
tokens, or SGPT-style asymmetric query/document tokens.torch, transformers, tiktoken, openai, or
missing scikit-learn while using model-related options.Route file preprocessing, cache artifacts, --windows, and --semantra-dir to
document-indexing. Route query arithmetic,
result tags, and local web UI behavior to
interactive-search.
For private local search, start with a local transformer model. The default
mpnet is the documented quality-oriented default. Use minilm when speed
and small memory footprint matter more than accuracy.
For larger or more accurate local models, consider sgpt or sgpt-1.3B.
SGPT presets are asymmetric: queries and documents are wrapped in different
special tokens. Do not combine asymmetric models with --svm.
For non-English or specialized domains, use a custom Hugging Face model:
semantra --transformer-model intfloat/multilingual-e5-base <files>
Add --query-token-pre, --query-token-post, --doc-token-pre, and
--doc-token-post only when the model documentation requires those tokens.
Use --model openai only after the user accepts the privacy, network, API
key, and cost implications. Semantra sends document windows and queries to
OpenAI in that mode.
Confirm the installed registry before a risky run:
python path/to/inspect_model_registry.py
semantra --list-models
Semantra's transformer backend asks PyTorch whether CUDA is available. If it is,
TransformerModel(..., cuda=None) moves the model and token tensors to CUDA;
otherwise CPU execution is used. CUDA is an acceleration path, not a requirement
for core Semantra behavior.
The first transformer run may download tokenizer/model files from Hugging Face unless they are already cached. Plan disk, network, and privacy constraints before indexing a large or sensitive corpus.
pkg_resources. Some modern Setuptools environments
no longer provide it; see the root troubleshooting reference for the
setuptools<81 workaround or code-update option.openai.Embedding.create API. If a current
OpenAI SDK reports an APIRemovedInV1Proxy or similar error, use a compatible
openai<1 environment or update Semantra's OpenAI integration before relying
on --model openai.--svm lazily imports sklearn.svm, but scikit-learn is not declared in
Semantra's package dependencies. Install it explicitly if that route is
selected.A model-selection answer should include:
semantra --list-models or
inspect_model_registry.py --json before a costly indexing run.