agentleFS
MicrosoftKnown publishermicrosoft/Olive/skills/olive/SKILL.md

olive

Skill2.4k starsChanged 15 months agoMITView on GitHub

Use Microsoft Olive through its native CLI and YAML/JSON workflow configuration files to optimize, export, quantize, fine-tune, tune, evaluate, and package AI models for ONNX Runtime. Use when a user mentions Olive, olive-ai, olive optimize, Olive passes, model conversion, ONNX optimization, execution providers, or asks to create, explain, validate, or run an Olive workflow config.

Trending

Quiet since September.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 2 mentionsJun 2026: 1 mentionJul 2026: 2 mentionsAug 2026: 0 mentionsSep 2026: 2 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/Olive repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/Olive

The biggest 5 of 17 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 17

Talked about on GitHub and Hacker News (17 times).

On GitHub · 16

11 more on GitHub

The file

Show its rules and text

We split this skill into the rules it gives an agent

34 rules. About 0 are common, 16 are distinctive, and 18 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 18

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the native olive command and Olive workflow files.

    line 13
  2. Very specific:

    Treat the installed Olive version as the source of truth.

    line 16
  3. Very specific:

    Do not invent command flags, pass names, pass parameters, model types, or execution providers.

    line 23
  4. Very specific:

    Before searching recipes, generating a workflow, inspecting candidate pass chains, or running an Olive command, confirm the target …

    line 29
  5. Distinctive:

    Always confirm the requested output precision.

    line 33
  6. Distinctive:

    Ask for every missing or ambiguous value before continuing.

    line 41
  7. Very specific:

    Do not require the user to understand Olive precision names, execution-provider internals, QNN backends, SoC IDs, or runtime versioning.

    line 48
  8. Distinctive:

    Ask one plain-language question at a time.

    line 52
  9. Distinctive:

    If a required target fact cannot be detected and the user cannot provide it, do not invent it.

    line 69
  10. Very specific:

    Do not use olive auto-opt.

    line 88
  11. Distinctive:

    Read the CLI guide for installation, command examples, dry runs, test mode, and provider selection.

    line 90
  12. Very specific:

    Check olive <command> --help in the active environment.

    line 99
  13. Very specific:

    Use an explicit output directory and --log_level 1 for meaningful progress logs.

    line 100
  14. Distinctive:

    Run the requested operation.

    line 103
  15. Very specific:

    Use --save_config_file when the user wants both execution and a saved recipe.

    line 108
  16. Distinctive:

    Use a YAML or JSON workflow when the user needs multiple passes, reusable configuration, custom data, evaluation, search, custom scripts, …

    line 115
  17. Distinctive:

    Read the workflow configuration guide before creating or editing a workflow.

    line 118
  18. Very specific:

    Read each selected recipe's README, executable workflow JSON, requirements, and version or commit pins.

    line 121
  19. Very specific:

    If the exact model and provider are absent, derive a candidate from prior recipes instead of stopping at an exact-name search or merely …

    line 124
  20. Distinctive:

    Use a high-level dry run as an installed-version compatibility scaffold after studying the reference recipes, not as the final inferred …

    line 144
  21. Distinctive:

    When authoring a workflow:

    line 161
  22. Very specific:

    Keep input_model, passes, and output settings explicit.

    line 163
  23. Very specific:

    Use a unique name for every data config.

    line 166
  24. Very specific:

    Use the bundled workflow template only as a generic Hugging Face-to-ONNX example.

    line 169
  25. Very specific:

    Never copy a model's Hugging Face config.json and treat it as an Olive workflow.

    line 172
  26. Distinctive:

    Never place tokens, credentials, or secrets in a workflow file.

    line 173
  27. Distinctive:

    Before using a nontrivial pass, inspect its installed schema from this skill's root:

    line 175
  28. Distinctive:

    Use one ONNX Runtime variant per environment.

    line 219
  29. Distinctive:

    Do not select fp16 for CPU merely to reduce model size.

    line 226
  30. Very specific:

    Use --trust_remote_code only when the user explicitly trusts the model repository or existing project configuration already requires it.

    line 232
  31. Very specific:

    Use HF_TOKEN or the Hugging Face credential store for gated models.

    line 234
  32. Very specific:

    Do not enable clean_cache, delete outputs, overwrite a nonempty output directory, or remove generated artifacts without user intent.

    line 236
  33. Distinctive:

    Do not claim quality, latency, memory, or size improvements without comparing actual outputs or metrics.

    line 240
  34. Distinctive:

    If network access or hardware is unavailable, complete local config and dry-run validation and state exactly what remains unverified.

    line 241

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Microsoft Olive

Use the native olive command and Olive workflow files. This skill does not require or assume an MCP server.

Treat the installed Olive version as the source of truth. Before using unfamiliar options, run:

olive --help
olive <command> --help

Do not invent command flags, pass names, pass parameters, model types, or execution providers. If an existing project already has an Olive config, preserve its conventions and make the smallest necessary change.

Required target questions

Before searching recipes, generating a workflow, inspecting candidate pass chains, or running an Olive command, confirm the target requirements with the user. Do not infer them from the model, provider defaults, installed hardware, or the source checkpoint:

  • Always confirm the requested output precision. For quantized workflows, confirm weight precision and activation precision separately when both apply.
  • Confirm the execution provider if the user has not specified it.
  • For QNN, confirm the target device or backend, such as QNN GPU versus HTP/NPU, and the target Qualcomm SoC or product. Derive and confirm the corresponding ORT soc_model setting when the workflow requires it.
  • For OpenVINO, confirm the target device, such as CPU, GPU, or NPU, and the target OpenVINO runtime or toolkit version.

Ask for every missing or ambiguous value before continuing. These values are recipe-search constraints: include the model or architecture, provider, device, precision, and, when applicable, SoC model or runtime version in the search. A recipe for the wrong device, SoC, precision, or runtime version is reference material, not a drop-in starting point.

Guide users who do not know the target details

Do not require the user to understand Olive precision names, execution-provider internals, QNN backends, SoC IDs, or runtime versioning. If the user does not know a required value, switch to guided discovery before searching for a final recipe:

  1. Ask one plain-language question at a time. For precision, first ask whether the priority is quality, balanced quality and resource use, or minimum model size and highest feasible speed.
  2. Determine whether the target is the current machine or another device. Inspect local hardware, available execution providers, SDKs, and runtime versions when the actual target is accessible; otherwise ask for the target product or chip name.
  3. Inspect the source model configuration and existing weight format so unsupported or redundant precision conversions are not offered.
  4. Map the user's goal and detected target to only the combinations supported by the installed Olive version, exporter, provider, and relevant model family.
  5. Present a small set of valid choices with short tradeoffs, mark a recommended choice, and get explicit confirmation before searching recipes or generating a workflow.

For QNN, translate a product or chip name into QNN GPU versus HTP/NPU and the required SoC setting; do not ask a non-expert for a numeric soc_model value when it can be derived from authoritative QNN or ONNX Runtime documentation. For OpenVINO, detect the installed version and available target devices when possible, then ask the user to confirm the intended device.

If a required target fact cannot be detected and the user cannot provide it, do not invent it. Explain which decision remains unresolved. Produce a portable non-AOT or experimental scaffold only if the user explicitly chooses that fallback, and do not label it as a hardware-specific final recipe.

Choose the right interface

User goalPreferred interface
Wants guided setup or does not know which operation to chooseolive init
Wants an end-to-end optimized modelolive optimize
Wants only ONNX exportolive capture-onnx-graph
Wants only quantizationolive quantize
Wants text LoRA or QLoRA trainingolive finetune
Wants diffusion LoRA trainingolive diffusion-lora
Wants one known Olive passolive run-pass
Wants a repeatable multi-pass pipeline, evaluation, search, or custom dataolive run --config ...
Wants ONNX Runtime session tuningolive tune-session-params
Wants lm-eval benchmarkingolive benchmark

Do not use olive auto-opt; it is deprecated in favor of olive optimize.

Read the CLI guide for installation, command examples, dry runs, test mode, and provider selection.

Execution workflow

  1. Identify the input model format and path or Hugging Face ID.
  2. Identify the desired output: optimized ONNX, quantized model, adapter, benchmark, or reusable workflow.
  3. Complete the required target questions above. Do not search recipes or generate a config while a required value is missing or ambiguous.
  4. Check olive <command> --help in the active environment.
  5. Use an explicit output directory and --log_level 1 for meaningful progress logs.
  6. For expensive or unfamiliar high-level commands, add --dry_run. Inspect the generated <output_path>/config.json, then run it with olive run --config <path> after it is correct.
  7. Run the requested operation. Do not claim success until the process exits successfully and the expected output exists.
  8. Report the output path, selected provider and precision, passes that ran, and metrics that Olive actually returned.

Use --save_config_file when the user wants both execution and a saved recipe. It saves olive_config.json while the command continues. Use --dry_run when the user wants configuration generation without optimization; it saves config.json and stops. It does not perform full workflow or pass-schema validation.

Write workflow configuration

Use a YAML or JSON workflow when the user needs multiple passes, reusable configuration, custom data, evaluation, search, custom scripts, remote systems, or settings not exposed by a high-level command.

Read the workflow configuration guide before creating or editing a workflow. For a model- and provider-specific workflow, search microsoft/olive-recipes before generating a generic config. Read each selected recipe's README, executable workflow JSON, requirements, and version or commit pins; info.yml and info.yaml are recipe catalog metadata, not files for olive run --config.

If the exact model and provider are absent, derive a candidate from prior recipes instead of stopping at an exact-name search or merely replacing model_path in one recipe. Triangulate from:

  • The same architecture or model family on any provider for model type, exporter, component layout, and architecture-specific graph transformations.
  • The same provider and device for systems, lowering, static-shape, compilation or AOT passes, environment boundaries, and provider options.
  • The same source weight format and quantization scheme for compatible quantization, calibration, and data settings.

Inspect the target model's Hugging Face configuration and repository metadata before merging those references. Check its architecture, task, context and cache design, modality, parameter and checkpoint size, and existing quantization_config. Do not schedule dequantization or a second quantizer for a pre-quantized checkpoint unless the selected exporter explicitly supports that conversion.

Preserve multi-stage workflows from the provider recipe, such as separate quantization and QNN AOT environments. Copy a pass or setting only when its model format, graph, precision, device, and runtime preconditions still hold. Never infer that two models are compatible from repository names alone; a distilled model can use a different base architecture than its name suggests.

Use a high-level dry run as an installed-version compatibility scaffold after studying the reference recipes, not as the final inferred recipe:

olive optimize \
  --model_name_or_path Qwen/Qwen2.5-0.5B-Instruct \
  --precision int4 \
  --provider CPUExecutionProvider \
  --output_path olive-output \
  --dry_run

Compare its output with the reference pass chains, inspect every nontrivial pass schema, and explain which recipe supplied each model-specific or provider-specific decision. If the installed exporter or a required pass does not support the target architecture, report the recipe as blocked rather than presenting a structurally valid config as runnable.

When authoring a workflow:

  • Keep input_model, passes, and output settings explicit.
  • Define pass entries in execution order; mapping order is pipeline order.
  • Reference systems, data configs, and evaluators by their declared names.
  • Use a unique name for every data config.
  • Olive accepts JSON and YAML. Recipes normally use JSON for executable workflows; YAML remains useful for hand-maintained workflows with comments.
  • Use the bundled workflow template only as a generic Hugging Face-to-ONNX example. Current generative LLM recipes often use ModelBuilder; follow the closest recipe instead of substituting OnnxConversion.
  • Never copy a model's Hugging Face config.json and treat it as an Olive workflow.
  • Never place tokens, credentials, or secrets in a workflow file.

Before using a nontrivial pass, inspect its installed schema from this skill's root:

python scripts/inspect_pass.py OnnxConversion

Validate a workflow without running model optimization:

python scripts/validate_config.py workflow.yaml
olive run --config workflow.yaml --list_required_packages

The second command writes olive_requirements.txt in the current directory. Review it, install the listed packages into the intended environment, and check model-loader and exporter requirements described in the CLI guide before running:

olive run --config workflow.yaml

Structural validation cannot prove that remote models are accessible, local data is semantically correct, the model is supported by every pass, or the target hardware has enough memory. Surface those constraints instead of presenting validation as execution success.

Deep dives for quantization work

For PyTorch/Hugging Face weight quantization (RTN, GPTQ, and related passes), read these before making nontrivial changes or answering detailed questions:

  • Quantization onboarding -- pass overview, shared config surface, RTN vs. GPTQ trade-offs, calibration data and split-hygiene notes.
  • MoE GPTQ onboarding -- per-expert calibration mechanics, the K-last layout requirement and architecture allow-list, the dual fallback-threshold design (routing skew vs. statistical sufficiency), and what a three-model benchmark showed about fallback rates and quantization wall-time.
  • Profiling/benchmark example -- how to use scripts/quantize_and_compare_perplexity.py to compare a pass against baseline on a real model, with a worked three-model example table.

Dependency and hardware rules

  • Reuse the user's active environment when it already contains the required Olive and runtime packages.
  • Install dependencies only when Olive or a required optional package is missing.
  • Use one ONNX Runtime variant per environment. Do not combine CPU, CUDA, DirectML, OpenVINO, or QNN runtime packages in the same environment unless the installed package documentation explicitly supports it.
  • Match device, execution provider, and runtime: CPU with CPUExecutionProvider, NVIDIA GPU with CUDAExecutionProvider, WebGPU with WebGpuExecutionProvider, Windows DirectX GPU with DmlExecutionProvider, and Qualcomm NPU with QNNExecutionProvider. Configure only one execution provider per accelerator.
  • Do not select fp16 for CPU merely to reduce model size. Prefer int4 or int8 when supported.
  • Calibration-based quantization and fine-tuning may require datasets and substantial compute. Do not silently replace the user's dataset or algorithm.

Safety and correctness

  • Use --trust_remote_code only when the user explicitly trusts the model repository or existing project configuration already requires it.
  • Use HF_TOKEN or the Hugging Face credential store for gated models. Never write a token into a command, config, script, log, or committed file.
  • Do not enable clean_cache, delete outputs, overwrite a nonempty output directory, or remove generated artifacts without user intent.
  • A --test run uses a small randomly initialized model with the same architecture. It checks pipeline compatibility, not real model quality.
  • Do not claim quality, latency, memory, or size improvements without comparing actual outputs or metrics.
  • If network access or hardware is unavailable, complete local config and dry-run validation and state exactly what remains unverified.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.