> [!NOTE] > Note: This version ONLY works with `Gemma4` merges. use the "[old version](https://huggingface.co/datasets/Naphula-Archives/master_python_list_mergekit_windows)" if you need support for previous archs (Mistral, Llama, etc.) > # Master Python List for MergeKit (guaranteed stable on Windows 10 for Gemma 4) It appears that all recent merge tests in the past 5 days were broken and must be retested. This includes several `karcher_stock` 24B tests, 8B and 12B merges. **I knew for sure something was wrong once I noticed early terminations with known compatible models that had always merged fine previously. This already happened before. I swapped out the python library, re-ran the same merge yaml again, and suddenly it was fixed.** This happened because updating the python libraries to merge `Gemma 4` models on my PC somehow ended up breaking compatibility for all older architectures. So now I have 2 copies of python libraries archived: - The old version, works for archs up until G4 - The new version, only works for G4, and also requires a hotswap for `huggingface_hub` to either merge or upload Here is the `pip freeze > env_versions.txt` of both versions: - [Old](https://huggingface.co/datasets/Naphula-Archives/master_python_list_mergekit_windows) - [G4 Only](https://huggingface.co/datasets/Naphula-Archives/master_python_list_mergekit_windows_G4-only) --- Based on a comparison of your two environment files, the discrepancy in model merging behavior is caused by a few critical machine learning libraries. Your `g4only` environment relies on bleeding-edge, unreleased code to support the newer Gemma 4 architecture, which is inherently unstable and contains regressions that break older architectures like Llama and Mistral. Here are the key library differences and the explanation of why they cause merge corruption. ### 1. The Core LLM / Merging Differences | Package | `working_env` (Llama/Mistral) | `g4only_env` (Gemma 4) | | :--- | :--- | :--- | | **transformers** | `4.56.1` (Stable) | `git+https://github.com/huggingface/transformers.git@d379...` (Dev Commit) | | **mergekit** | `0.1.3` | `0.1.4` | | **tokenizers** | `0.22.0` | `0.22.2` | | **huggingface_hub** | `0.34.4` | `1.13.0` | | **regex** | `2024.11.6` | `2026.4.4` | *Note: The `g4only` environment also installed a suite of UI/Render tools (`PyQt6`, `PyOpenGL`, `pyqtgraph`) and `hf-xet` (a Hugging Face data transfer tool) which are not present in the working environment, but these do not affect tensor math.* ### Why this causes merge corruption and broken outputs: **1. `transformers`: Stable Release vs. Bleeding-Edge Git Commit** This is the primary culprit. To support Gemma 4 (which is likely too new for stable releases in this environment setup), the `g4only` env pulls a specific, unreleased development commit of the Hugging Face `transformers` library directly from GitHub. * **The Problem:** Development branches frequently introduce breaking changes or temporary bugs for existing architectures. The git commit likely altered how tensors are mapped, how Rotary Position Embeddings (RoPE) are scaled, or how attention heads are parsed. When `mergekit` asks this dev version of `transformers` to load Llama 8B or Mistral 12B, it is likely loading or saving the tensor metadata incorrectly, resulting in misaligned weights during the merge. **2. `mergekit`: Version 0.1.3 vs. 0.1.4** Mergekit is the engine doing the actual math (SLERP, TIES, DARE, etc.) to combine your models. * **The Problem:** Version `0.1.4` was likely pushed specifically to add the dimensional parsing required for Gemma 4's new architecture. However, in doing so, it seems a regression was introduced for Llama/Mistral models. If `mergekit` incorrectly identifies layer aliases, ties word embeddings incorrectly, or fails to properly normalize the tensor chunks of Llama/Mistral models, the resulting model's math will be completely destroyed, resulting in "brain damage" (broken output). **3. `tokenizers`: Version 0.22.0 vs. 0.22.2** When you merge models, the tokenizers are also merged or inherited. * **The Problem:** If there is a mismatch in how `0.22.2` processes special tokens (like BOS/EOS tokens or chat templates) compared to how Llama/Mistral expect them, the embedding layer will become offset. Even a 1-index shift in the vocabulary matrix means the model tries to output the word "hello" but actually selects a completely random token, generating pure gibberish. ### Summary & Recommendation The `g4` environment forces the use of unstable beta code necessary to make Gemma 4 work, but that beta code has active bugs regarding tensor and configuration handling for Llama and Mistral. Until `transformers` releases a unified stable version (likely >4.57.x) and `mergekit` updates to natively handle all architectures safely, **you must keep these environments sandboxed**. Continue using `working_env` for your Llama 8B and Mistral 12B merges, and strictly reserve `g4only_env` for Gemma 4. ``` accelerate==1.11.0 aiofiles==24.1.0 aiohappyeyeballs==2.6.1 aiohttp==3.11.18 aiosignal==1.3.2 alembic==1.17.2 annotated-types==0.7.0 anyio==4.9.0 argon2-cffi==25.1.0 argon2-cffi-bindings==25.1.0 arrow==1.3.0 asttokens==3.0.0 async-lru==2.0.5 attrs==25.3.0 babel==2.17.0 beautifulsoup4==4.13.4 bitsandbytes==0.48.2 bleach==6.2.0 blis==1.3.0 Brotli==1.1.0 cachetools==5.5.2 catalogue==2.0.10 certifi==2025.4.26 cffi==2.0.0 charset-normalizer==3.4.2 click==8.2.1 cloudpathlib==0.21.0 cmudict==1.0.32 colorama==0.4.6 colorlog==6.10.1 comm==0.2.3 confection==0.1.5 configparser==7.2.0 contourpy==1.3.2 corpus-toolkit==0.32 cramjam==2.10.0 ctransformers==0.2.27 cycler==0.12.1 cymem==2.0.11 datasets==4.4.1 debugpy==1.8.17 decorator==5.2.1 defusedxml==0.7.1 dill==0.3.8 distro==1.9.0 docker==7.1.0 einops==0.8.1 en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl#sha256=1932429db727d4bff3deed6b34cfc05df17794f4a52eeb26cf8928f7c1a0fb85 executing==2.2.1 fastapi==0.115.13 fastjsonschema==2.21.2 fastparquet==2024.11.0 ffmpy==0.6.1 filelock==3.18.0 fonttools==4.57.0 fqdn==1.5.1 frozenlist==1.6.0 fsspec==2025.3.0 gguf==0.17.1 google-ai-generativelanguage==0.6.15 google-api-core==2.25.0rc0 google-api-python-client==2.169.0 google-auth==2.39.0 google-auth-httplib2==0.2.0 google-generativeai==0.8.5 googleapis-common-protos==1.70.0 gradio==5.46.1 gradio_client==1.13.1 gradio_huggingfacehub_search==0.0.12 graphviz==0.21 greenlet==3.2.4 groovy==0.1.2 grpcio==1.71.0 grpcio-status==1.71.0 h11==0.16.0 h2==4.3.0 # Editable install with no version control (heretic-llm==1.0.1) -e c:\mergekit-main\heretic-1.0.1 hf-xet==1.4.3 hf_transfer==0.1.9 hpack==4.1.0 httpcore==1.0.9 httplib2==0.22.0 httpx==0.28.1 huggingface_hub==1.13.0 hyperframe==6.1.0 idna==3.10 immutables==0.21 importlib_metadata==8.7.0 importlib_resources==6.5.2 inquirerpy==0.3.4 ipykernel==6.30.1 ipython==9.6.0 ipython_pygments_lexers==1.1.1 ipywidgets==8.1.7 isoduration==20.11.0 jaxtyping==0.3.3 jedi==0.19.2 jellyfish==1.2.0 Jinja2==3.1.6 jiter==0.9.0 joblib==1.4.2 json5==0.12.1 jsonlines==4.0.0 jsonpointer==3.0.0 jsonschema==4.25.1 jsonschema-specifications==2025.9.1 jupyter==1.1.1 jupyter-console==6.6.3 jupyter-events==0.12.0 jupyter-lsp==2.3.0 jupyter_client==8.6.3 jupyter_core==5.8.1 jupyter_server==2.17.0 jupyter_server_terminals==0.5.3 jupyterlab==4.4.9 jupyterlab_pygments==0.3.0 jupyterlab_server==2.27.3 jupyterlab_widgets==3.0.15 keyboard==0.13.5 kiwisolver==1.4.8 langcodes==3.5.0 language_data==1.3.0 lark==1.3.0 lexical-diversity==0.1.1 lxml==5.4.0 Mako==1.3.10 marisa-trie==1.2.1 Markdown==3.8 markdown-it-py==3.0.0 MarkupSafe==3.0.2 matplotlib==3.10.1 matplotlib-inline==0.1.7 mdurl==0.1.2 mergekit==0.1.4 mistune==3.1.4 mpmath==1.3.0 mss==10.0.0 multidict==6.4.3 multiprocess==0.70.16 murmurhash==1.0.12 nbclient==0.10.2 nbconvert==7.16.6 nbformat==5.10.4 nest-asyncio==1.6.0 networkx==3.4.2 ninja==1.13.0 nltk==3.9.1 notebook==7.4.7 notebook_shim==0.2.4 NRCLex==3.0.0 numpy==1.26.4 nvidia-cublas-cu12==12.9.1.4 nvidia-cuda-runtime-cu12==12.9.79 nvidia-ml-py==12.575.51 openai==1.76.2 optuna==4.6.0 orjson==3.11.3 overrides==7.7.0 packaging==23.2 pandas==2.2.3 pandocfilters==1.5.1 parso==0.8.5 pdfkit==1.0.0 peft==0.15.2 pfzy==0.3.4 pillow==11.2.1 platformdirs==4.4.0 preshed==3.0.9 prometheus_client==0.23.1 prompt_toolkit==3.0.51 propcache==0.3.1 proto-plus==1.26.1 protobuf==5.29.4 psutil==7.0.0 pure_eval==0.2.3 py-cpuinfo==9.0.0 pyarrow==22.0.0 pyasn1==0.6.1 pyasn1_modules==0.4.2 pycparser==2.23 pydantic==2.10.6 pydantic-settings==2.12.0 pydantic_core==2.27.2 pydub==0.25.1 pygame==2.6.1 Pygments==2.19.1 pynvml==12.0.0 PyOpenGL==3.1.10 pyparsing==3.2.3 pyphen==0.17.2 pypiwin32==223 PyQt6==6.11.0 PyQt6-Qt6==6.11.0 PyQt6_sip==13.11.1 pyqtgraph==0.14.0 PySide6==6.9.1 PySide6_Addons==6.9.1 PySide6_Essentials==6.9.1 python-dateutil==2.9.0.post0 python-dotenv==1.1.1 python-json-logger==3.3.0 python-multipart==0.0.20 pytz==2025.2 pywin32==311 pywinpty==3.0.0 PyYAML==6.0.2 pyzmq==27.1.0 quant_clone==0.1.2 questionary==2.1.1 referencing==0.36.2 regex==2026.4.4 requests==2.32.3 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rfc3987-syntax==1.1.0 rich==14.2.0 rpds-py==0.27.1 rsa==4.9.1 ruff==0.13.1 safehttpx==0.1.6 safetensors==0.5.3 scikit-learn==1.6.1 scipy==1.15.2 seaborn==0.13.2 segtok==1.5.11 semantic-version==2.10.0 Send2Trash==1.8.3 sentence-transformers==4.1.0 sentencepiece==0.2.0 shellingham==1.5.4 shiboken6==6.9.1 simpleaudio==1.0.4 six==1.17.0 smart-open==7.1.0 sniffio==1.3.1 soupsieve==2.7 spacy==3.8.5 spacy-legacy==3.0.12 spacy-loggers==1.0.5 SQLAlchemy==2.0.44 srsly==2.5.1 stack-data==0.6.3 starlette==0.46.2 sympy==1.13.1 tabulate==0.9.0 terminado==0.18.1 textblob==0.19.0 textstat==0.7.5 thinc==8.3.6 threadpoolctl==3.6.0 tinycss2==1.4.0 tkinterdnd2==0.4.3 tokenizers==0.22.2 tomlkit==0.13.3 torch==2.5.1+cu121 torchaudio==2.5.1+cu121 torchvision==0.20.1+cu121 tornado==6.5.2 tqdm==4.67.1 traitlets==5.14.3 transformers @ git+https://github.com/huggingface/transformers.git@d379ac18db61a4e194f0d53c0c57105d08183c59 trl==0.25.1 typer==0.15.3 types-python-dateutil==2.9.0.20250822 typing-inspection==0.4.0 typing_extensions==4.13.2 tzdata==2025.2 uri-template==1.3.0 uritemplate==4.1.1 urllib3==2.4.0 uv==0.8.3 uvicorn==0.34.3 vaderSentiment==3.3.2 wadler_lindig==0.1.7 wasabi==1.1.3 wcwidth==0.2.13 weasel==0.4.1 webcolors==24.11.1 webencodings==0.5.1 websocket-client==1.8.0 websockets==15.0.1 widgetsnbextension==4.0.14 win10toast==0.9 wrapt==1.17.2 xxhash==3.5.0 yake==0.4.8 yarl==1.20.0 zipp==3.21.0 ```