model-pruning

Prune large language models with Wanda and SparseGPT techniques.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/hhhi21g/HealthCenter --skill model-pruning-hhhi21g
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-pruning
Source: https://github.com/hhhi21g/HealthCenter/tree/main/.codex/skills/model-pruning
Command: npx skills add https://github.com/hhhi21g/HealthCenter --skill model-pruning-hhhi21g

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformers, torch, accelerate, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of reducing the size and inference time of large language models (LLMs) while maintaining high accuracy.

Core Features & Use Cases

  • Model Compression: Achieve 50% sparsity with minimal accuracy loss using techniques like Wanda and SparseGPT.
  • Inference Acceleration: Enable faster inference on hardware accelerators with reduced memory footprint.
  • Use Case: Optimize LLMs for deployment on mobile devices, edge computing, or constrained hardware environments.

Quick Start

Run the 'wanda_prune' script with the model and calibration data to apply Wanda pruning to the LLM.

Frequently Asked Questions about model-pruning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce LLM size for edge deployment?

Reduce LLM size for edge deployment through model pruning techniques like Wanda and SparseGPT. This Skill achieves 50% sparsity with minimal accuracy loss to enable faster inference on constrained hardware environments.

What is the best way to accelerate LLM inference on mobile devices?

Accelerate LLM inference on mobile devices by applying pruning techniques to reduce memory footprint. This Skill uses Wanda and SparseGPT algorithms to compress models while maintaining high accuracy for constrained hardware.

Do I need torch and transformers libraries to prune large language models?

Yes, you need both torch and transformers libraries to manipulate large language models during pruning. This Skill requires these dependencies alongside the accelerate library to execute model compression scripts effectively.

Can I achieve 50% sparsity with minimal accuracy loss using Wanda pruning?

Yes, you can achieve 50% sparsity with minimal accuracy loss using Wanda pruning. Run the wanda_prune script with your model and calibration data to apply this compression technique to your LLM.

Does SparseGPT work with Hugging Face transformers for model compression?

SparseGPT works with Hugging Face transformers for model compression by leveraging the transformers and torch libraries. This Skill integrates these frameworks to reduce model size and inference time while preserving accuracy.

Why does model pruning cause accuracy loss in LLM compression?

Model pruning causes accuracy loss in LLM compression when sparsity removes critical weights. This Skill mitigates this by using techniques like Wanda and SparseGPT, which target less important weights to maintain high accuracy at 50% sparsity.