model-merging

Merge fine-tuned language models with mergekit using SLERP, TIES, DARE, and task arithmetic.

2|Updated Aug 15, 2026
One-click install
npx skills add https://github.com/Jensen-Yao/agents-skills --skill model-merging-jensen-yao
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: model-merging
Source: https://github.com/Jensen-Yao/agents-skills/tree/main/skills/model-merging
Command: npx skills add https://github.com/Jensen-Yao/agents-skills --skill model-merging-jensen-yao

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Combining capabilities from multiple fine-tuned models normally requires expensive retraining; this Skill merges pre-trained models directly in weight space so you can blend math, coding, and chat expertise into one model without GPUs or training runs. ## Core Features & Use Cases - Multiple Merge Algorithms: Configure linear, SLERP, task arithmetic, TIES-Merging, and DARE merges through mergekit YAML configs, including layer-wise and MoE-style merging. - Unsupervised Coefficient Tuning: Select optimal merge coefficients via generation consistency (AdaMMS method) without labeled evaluation data. - Evaluation & Deployment Guidance: Benchmark merged models on Open LLM Leaderboard, MT-Bench, MMLU, HumanEval, and GSM8K, then quantize and publish to HuggingFace Hub. - Use Case: Merge a math-specialized Mistral model with a chat-tuned variant using SLERP at t=0.5, benchmark the result against both parents, and ship a single model that handles both domains. ## Quick Start Merge the models mistralai/Mistral-7B-v0.1 and teknium/OpenHermes-2.5-Mistral-7B using SLERP with equal weighting and evaluate the result on GSM8K.

Frequently Asked Questions about model-merging

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

FAQPage Schema
How do I merge two language models without retraining?▼

Use mergekit with a YAML config specifying a merge method like SLERP or linear, listing the source models and their weights. Run mergekit-yaml config.yml ./merged-model --cuda to produce the merged model in minutes on CPU or GPU.

Which merge method should I use: SLERP, TIES, or DARE?▼

SLERP works best for smoothly blending two models, linear suits simple averages of similar models, and TIES or DARE-TIES handle many task-specific models by resolving sign conflicts and reducing redundancy. Task arithmetic fits combining specialized skills onto a shared base model.

Can I merge models with different architectures like Llama and Mistral?▼

No, merging requires models that share the same architecture, since parameters are combined element-wise. Merging Llama with Mistral will fail or produce a broken model; only merge fine-tunes derived from the same base architecture.

How do I choose merge weights without labeled evaluation data?▼

Use generation consistency: merge with several candidate coefficients, generate responses on 50-200 unlabeled prompts, and pick the coefficient whose outputs are most similar to its neighbors. This unsupervised proxy from the AdaMMS paper avoids manual grid search.

Why does my merged model perform worse than its parents?▼

Common causes include mismatched architectures, over-weighting one model beyond the 0.3-0.7 range, or skipping density tuning in TIES/DARE. Always benchmark the merged model on tasks like MMLU and GSM8K before deploying and adjust weights or density accordingly.