executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
backend-export-optimizationUse when selecting Sentence Transformers inference backends or exporting/optimizing models for PyTorch, ONNX, or OpenVINO. Covers backend="onnx"/"openvino", optional extras, model_kwargs, optimized and quantized artifacts, and export troubleshooting.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when a user asks how to speed up inference with backend-level model formats, diagnose ONNX/OpenVINO installation or loading failures, or prepare optimized/quantized model artifacts for local use or Hugging Face Hub pull requests.
backend="torch" for the default PyTorch path, GPU dtype tweaks such as model_kwargs={"torch_dtype": "float16"}, or simplest compatibility.backend="onnx" when the user installed the onnx or onnx-gpu extra and wants ONNX Runtime inference, optimized ONNX files, or dynamic int8 ONNX quantization.backend="openvino" when the user installed the openvino extra and targets Intel/CPU OpenVINO inference or static OpenVINO quantization.model_kwargs={"provider": ...} for ONNX Runtime execution providers and model_kwargs={"file_name": ...} to load a specific exported, optimized, or quantized artifact.model.save_pretrained(...) after exporting a local model and model.push_to_hub(..., create_pr=True) for Hub models so future loads do not re-export.references/backend-reference.mdreferences/troubleshooting.mdscripts/backend_export_check.pyfrom sentence_transformers import SentenceTransformer
model = SentenceTransformer(
"sentence-transformers/all-MiniLM-L6-v2",
backend="onnx",
model_kwargs={"provider": "CPUExecutionProvider"},
)
embeddings = model.encode(["backend export smoke test"])
model.push_to_hub("sentence-transformers/all-MiniLM-L6-v2", create_pr=True)
from sentence_transformers import SentenceTransformer, export_optimized_onnx_model
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2", backend="onnx")
export_optimized_onnx_model(
model=model,
optimization_config="O3",
model_name_or_path="sentence-transformers/all-MiniLM-L6-v2",
push_to_hub=True,
create_pr=True,
)