agentleFS
MicrosoftKnown publishermicrosoft/Olive/.github/copilot-instructions.md

Olive

Copilot instructions2.4k starsChanged 15 months agoMITView on GitHub

Microsoft Olive is a Python-based AI model optimization toolkit for the ONNX Runtime. It provides 40+ built-in optimization components for model compression, optimization, fine-tuning, and compilation. Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

  • Installs packages

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
  • In this repository2 other files it gives its agents.

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does …

    line 5
  2. Very specific:

    Test CLI functionality: olive optimize --help and olive auto-opt --help

    line 28
  3. Distinctive:

    When network issues occur, focus on local functionality and offline validation

    line 35
  4. Very specific:

    ALWAYS run lintrunner before committing changes or the CI (.github/workflows/lint.yml) will fail

    line 40
  5. Very specific:

    Test basic functionality: python -c "import olive.

    line 41
  6. Very specific:

    Test package import and version: python -c "import olive.

    line 45
  7. Very specific:

    Test dry run mode: olive optimize --dry_run --model_name_or_path <model> --precision int4

    line 47
  8. Distinctive:

    Test dependencies install: FAILS due to network timeouts - expect 20+ minute installs in normal environments

    line 57
  9. Distinctive:

    Test dependency installation may timeout due to network issues

    line 97
  10. Very specific:

    Use --dry_run mode for configuration validation without network access

    line 98
  11. Distinctive:

    When network connectivity is limited:

    line 102
  12. Distinctive:

    Use local model paths instead of HuggingFace model names

    line 103
  13. Distinctive:

    Test CLI help commands and basic imports

    line 105

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
copilot-instructions.md

Microsoft Olive - AI Model Optimization Toolkit

Microsoft Olive is a Python-based AI model optimization toolkit for the ONNX Runtime. It provides 40+ built-in optimization components for model compression, optimization, fine-tuning, and compilation.

Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

Working Effectively

Bootstrap the Development Environment

  • Install basic dependencies: pip install -r requirements.txt -- takes 3 minutes. NEVER CANCEL. Set timeout to 10+ minutes.
  • Install Olive in development mode: pip install -e . -- takes 10 seconds.
  • Install development dependencies: pip install -r requirements-dev.txt -- takes 20 seconds.
  • Initialize linting: lintrunner init -- takes 15 seconds.

Build and Test Commands

  • Lint code: lintrunner -- takes 1-2 seconds for single files, 5+ seconds for entire codebase. NEVER CANCEL.
  • Lint with auto-fix: lintrunner --all-files -a
  • Import test: python -c "import olive; print('Olive version:', olive.__version__)"

Command Line Interface

  • Main CLI entry point: olive --help
  • Key commands:
    • olive optimize -- Comprehensive model optimization with pass scheduling
    • olive auto-opt -- Automatic optimization with minimal configuration
    • olive finetune -- Fine-tune models using PEFT
    • olive quantize -- Quantize models
    • olive capture-onnx-graph -- Export models to ONNX format
  • Test CLI functionality: olive optimize --help and olive auto-opt --help
  • Dry run mode: olive optimize --dry_run (validates configuration without execution)

Network Limitations

  • CRITICAL: The environment has limited network connectivity
  • HuggingFace model downloads may fail with connection errors
  • PyPI package installations may timeout - use longer timeouts (10-20 minutes) for ML packages
  • When network issues occur, focus on local functionality and offline validation

Validation

Pre-commit Validation

  • ALWAYS run lintrunner before committing changes or the CI (.github/workflows/lint.yml) will fail
  • Test basic functionality: python -c "import olive; print(olive.__version__)"
  • Validate CLI: olive --help

Manual Testing Scenarios

  • Test package import and version: python -c "import olive; print('Version:', olive.__version__)"
  • Validate CLI help commands work: olive --help, olive optimize --help, olive auto-opt --help
  • Test dry run mode: olive optimize --dry_run --model_name_or_path <model> --precision int4
  • Note: Full model optimization requires network access for HuggingFace downloads

Expected Timing and Timeout Values

  • NEVER CANCEL: Basic requirements install: 3 minutes (set timeout to 10+ minutes)
  • Development install: 10 seconds (set timeout to 60 seconds)
  • Dev dependencies: 20 seconds (set timeout to 300 seconds)
  • Lintrunner init: 15 seconds (set timeout to 600 seconds)
  • Linting single file: 1-2 seconds
  • Linting full codebase: 5-10 seconds (set timeout to 300 seconds)
  • Test dependencies install: FAILS due to network timeouts - expect 20+ minute installs in normal environments

Common Tasks

Repository Structure

  • olive/ -- Main package directory with core functionality
  • test/ -- Test suite with requirements-test*.txt files
  • docs/ -- Documentation
  • .github/workflows/ -- CI/CD pipelines (lint.yml, codeql.yml)
  • olive/passes/onnx -- Directory of ONNX transformations passes
  • olive/passes/pytorch -- Directory of Pytorch passes
  • olive/data -- Data configurations and data containers
  • olive/evaluator -- Evaluator to measure quality and performance
  • olive/model -- Model handlers
  • olive/search -- Search algorithms
  • olive/systems -- Host and target systems
  • olive/engine -- Core engine responsible for executing the workflow
  • olive/cli -- Command line tools to prepare and drive the workflow

Key Configuration Files

  • pyproject.toml -- Modern Python packaging configuration with ruff, pylint, pytest settings
  • setup.py -- Package setup and console_scripts entry point
  • requirements*.txt -- Dependency specifications
  • .lintrunner.toml -- Linting configuration
  • olive_config.json -- Olive package extras configuration

Python Package Information

  • Package name: olive-ai
  • Python version: 3.10+ (currently testing on 3.12)
  • Entry point: olive command (defined in setup.py console_scripts)
  • Version location: olive/__init__.py (version)

Development Workflow

  • Code style: Black formatter with 120 character line limit
  • Linting: Multiple tools via lintrunner (ruff, pylint, editorconfig-checker, etc.)
  • Testing: pytest framework (note: full test suite requires network access)
  • Pre-commit hooks: Available via .pre-commit-config.yaml

Known Issues and Workarounds

  • Network connectivity may prevent HuggingFace model downloads
  • Test dependency installation may timeout due to network issues
  • Use --dry_run mode for configuration validation without network access
  • Focus on local testing and validation when network is unreliable

Working Offline

When network connectivity is limited:

  • Use local model paths instead of HuggingFace model names
  • Focus on configuration validation with --dry_run mode
  • Test CLI help commands and basic imports
  • Validate linting and code formatting

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.