LLaVA-OneVision-2: Skill for OpenCode

.opencode/skills/merge-ov2/SKILL.md

merge-ov2 is a skill for OpenCode from EvolvingLMMs-Lab/LLaVA-OneVision-2. It costs 29 tokens per session (9,423 once invoked), scanned A, original, Apache-2.0.

A guide for combining a separate vision encoder, language model, and processor into one Hugging Face LLaVA-OneVision-2 model checkpoint. A checkpoint is a saved set of model weights and configuration that can be loaded for inference.

In plain words
What is it for?
Use it to merge ViT image-encoding weights with an LLM, create a unified LlavaOnevision2ForConditionalGeneration checkpoint, and compare the merged model's weights and inference output with the source models.
Why use it?
It provides the required setup and validation steps so the combined model keeps the original weights and produces consistent results. It also documents the container, GPU, paths, and environment variables needed for the merge.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions OpenCode.

This is EvolvingLMMs-Lab/LLaVA-OneVision-2's own configuration. It tells OpenCode how to work on LLaVA-OneVision-2 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything LLaVA-OneVision-2 configures →

About the project

LLaVA-OneVision-2 is an openly released multimodal AI model and training framework that processes images, long-form video, and spatial information. Researchers use it to train, evaluate, and reproduce vision-language models with the project’s released data, encoders, checkpoints, and training records. The catalogue skills support work with this model and its training resources.

EvolvingLMMs-Lab/LLaVA-OneVision-2 · 1,200 stars · on GitHub · evolvinglmms-lab.github.io

Reuse

Borrowing it

Nothing to install: this file belongs to EvolvingLMMs-Lab/LLaVA-OneVision-2. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/EvolvingLMMs-Lab/LLaVA-OneVision-2/main/.opencode/skills/merge-ov2/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/EvolvingLMMs-Lab/LLaVA-OneVision-2

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for merge-ov2

README.md
[![agentmods](https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/merge-ov2/github.svg)](https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/merge-ov2)
Your own site
<a href="https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/merge-ov2"><img src="https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/merge-ov2/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for merge-ov2

Your own site · 80×15
<a href="https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/merge-ov2"><img src="https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/merge-ov2.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,423 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.09423
Opus 5 $0.00015 $0.04712
Sonnet 5 $0.00006 $0.01885
Haiku 4.5 $0.00003 $0.00942

Measured 10d ago against content hash 0265c0111378, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

merge-ov2 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/skills/merge-ov2/SKILL.md · 684 lines

How it starts

The opening of the file, as written. The whole thing — 684 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Purpose / 用途

Use this skill when merging a standalone ViT encoder and LLM into a unified LlavaOnevision2 HuggingFace checkpoint, and when validating that the merged weights and inference outputs are consistent with the originals.

当需要将独立的 ViT encoder 和 LLM 合并成统一的 LlavaOnevision2 HuggingFace checkpoint,并验证合并后权重和推理输出与原始模型一致时,使用这个 skill。

Prerequisites / 前置条件

  • Container llava_megatron_container_ax running with GPU access
  • All paths below assume execution inside the container at /workspace/LLaVA-OneVision-2
  • PYTHONPATH=transformers_impl:. must be set for all Python commands
  • For large models, use tmpfs (/train_tmp) for I/O performance

容器 llava_megatron_container_ax 需启动并有 GPU 访问权限。以下所有路径假设在容器内 /workspace/LLaVA-OneVision-2 执行。所有 Python 命令需设置 PYTHONPATH=transformers_impl:.。大模型建议用内存盘 /train_tmp

Architecture / 架构

What merge_ov2 does / merge_ov2 做了什么

ViT encoder (e.g. onevision_encoder_patch16_0424)
  + LLM (e.g. Qwen3-4B-Instruct-2507)
  + Processor (e.g. lmms-lab-encoder/LLaVA-OneVision-2-8B-Instruct)
  → Unified LlavaOnevision2ForConditionalGeneration checkpoint

Key transformations during merge:

合并时的关键转换:

  1. ViT weights are prefixed with visual. (e.g. encoder.layers.0.self_attn.q_proj.weightvisual.encoder.layers.0.self_attn.qkv.weight)
  2. QKV fusion: separate q_proj / k_proj / v_proj are concatenated into fused self_attn.qkv (introduces ~1e-7 bf16 divergence)
  3. LLM weights are prefixed with language_model. (e.g. model.layers.0.self_attn.q_proj.weightlanguage_model.model.layers.0.self_attn.q_proj.weight)
  4. Adapter (multi_modal_projector) is randomly initialized if no adapter checkpoint is provided
  5. layernorm_post from ViT is dropped (not used in LlavaOnevision2)
  6. class_embedding may not exist in some ViT encoders (e.g. patch16 variant)

Source code layout / 源码结构

transformers_impl/merge_ov2/
├── __main__.py          # CLI entry point
├── cli.py               # Argument parsing for merge / validate / dry-run
├── remap.py             # Weight key remapping logic
├── loader.py            # Weight loading from source checkpoints
├── save.py              # Save merged checkpoint
├── io.py                # I/O utilities
├── utils.py             # Shared utilities
├── variants/
│   ├── dense.py         # Dense model variant
│   └── moe.py           # MoE model variant
└── validators/
    ├── vit_layerwise.py   # ViT layer-wise weight validator
    ├── vit_blockorder.py  # ViT block-order validator (patch14+sms=2 only)
    ├── llm_parallel.py    # LLM parallel validator
    ├── llm_sequential.py  # LLM sequential validator
    └── e2e.py             # End-to-end validator

Read the full file on GitHub · 684 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 684 lines · 29 tokens per session scan A 0265c0111378

Subscribe to this mod's changes

merge-ov2 is a skill published in the GitHub repository EvolvingLMMs-Lab/LLaVA-OneVision-2 (1,200 stars, last pushed yesterday), licensed Apache-2.0. It adds 29 tokens to every session and 9,423 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

add-new-model

Use this skill when the user wants to add or port a new model architecture to MLX-VLM — mapping a Hugging Face modeltype to a new file under mlxvlm/models, writing the ModelConfig, matching layer/weight names, reusing a similar existing model, adding a test class, and validating the port. Covers vision-language…

Blaizzy/mlx-vlm · 83 tokens

cli-inference

Use this skill when the user wants to run or debug MLX-VLM inference from the command line, including uv run mlxvlm.generate, image/audio/video inputs, local model paths, Hugging Face model IDs, deterministic repro commands, and CLI errors around processors, prompts, model loading, or missing weights.

Blaizzy/mlx-vlm · 67 tokens

convert-quantize

Use this skill when the user wants to convert a Hugging Face model to MLX or quantize/dequantize one with mlxvlm.convert, including bits and group size, quant modes (affine, mxfp4, nvfp4, mxfp8), RTN vs AWQ, mixed-bit recipes, dtype casts, calibration (text or multimodal), local vs Hub paths, revisions, uploading to…

Blaizzy/mlx-vlm · 99 tokens

server-inference

Use this skill when the user wants to run or debug MLX-VLM server inference, including uv run mlxvlm.server, /v1/models, /v1/chat/completions, /v1/responses, streaming, OpenAI-compatible clients, health checks, metrics, model unload/reload, adapters, trust-remote-code, and server request/response failures.

Blaizzy/mlx-vlm · 80 tokens

hf-cache-models

Use this skill when the user wants to list, inspect, or report MLX-VLM model candidates available in the local Hugging Face cache directory, including the server's opt-in hf-cache discovery mode, cache-dir overrides, JSON output, or issue-ready cached model lists.

Blaizzy/mlx-vlm · 60 tokens

mle-workflow

Production machine-learning engineering workflow for data contracts, reproducible training, model evaluation, deployment, monitoring, and rollback. Use when building, reviewing, or hardening ML systems beyond one-off notebooks.

affaan-m/ECC · 44 tokens