LLaVA-OneVision-2: Skill for OpenCode

.opencode/skills/offline-packing-env-vars/SKILL.md

offline-packing-env-vars is a skill for OpenCode from EvolvingLMMs-Lab/LLaVA-OneVision-2. It costs 65 tokens per session (4,371 once invoked), scanned A, original, Apache-2.0.

A bilingual guide to two environment variables that control sample packing during LLaVA-OneVision2 model training.

In plain words
What is it for?
Configuring training scripts, diagnosing attention leaking between packed samples, and understanding when the cu_lengths value is a placeholder or a real sequence-length tensor.
Why use it?
It explains why both settings must be enabled together, why the batch size must be one, and how to avoid a setting that has no effect.

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/offline-packing-env-vars/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 offline-packing-env-vars

README.md
[![agentmods](https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/offline-packing-env-vars/github.svg)](https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/offline-packing-env-vars)
Your own site
<a href="https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/offline-packing-env-vars"><img src="https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/offline-packing-env-vars/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 offline-packing-env-vars

Your own site · 80×15
<a href="https://agentmods.dev/skills/evolvinglmms-lab/llava-onevision-2/offline-packing-env-vars"><img src="https://agentmods.dev/badge/skills/evolvinglmms-lab/llava-onevision-2/offline-packing-env-vars.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,371 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.00065 $0.04371
Opus 5 $0.00032 $0.02185
Sonnet 5 $0.00013 $0.00874
Haiku 4.5 $0.00006 $0.00437

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

Security

Grade A, and why

offline-packing-env-vars 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/offline-packing-env-vars/SKILL.md · 271 lines

How it starts

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

Purpose / 用途

Use this skill when you set up or debug training-side sample packing for LLaVA-OneVision2 — i.e. when you need to decide which env vars to export in a training shell script (Stage-1 / Stage-1.5 / Stage-2) and want to understand why both OFFLINE_PACKING_BMR and OFFLINE_PACKED_DATA must be 1 to actually get padding-free attention.

在配置或调试 LLaVA-OneVision2 训练侧的样本 packing 时使用——比如要决定在训练 shell 脚本(Stage-1 / Stage-1.5 / Stage-2)中导出哪些环境变量,以及为什么必须 OFFLINE_PACKING_BMR=1OFFLINE_PACKED_DATA=1 同时打开才能真正获得 padding-free 的 attention。

This skill is specifically for:

  • Choosing the correct env var combination in training scripts
  • Diagnosing cross-sample attention leakage in packed runs
  • Understanding why cu_lengths is a dummy [[0]] in some runs and a real [B, P+1] tensor in others
  • Avoiding the well-known OFFLINE_PACKING_VQA red herring (it is dead code)

Companion skill: cu-lengths-attention-flow covers the consumer side (how cu_lengths is fed into ViT/LLM attention). This skill covers the producer + gate side.

姊妹 skill:cu-lengths-attention-flow消费端cu_lengths 如何送入 ViT/LLM attention)。本 skill 讲生产端 + 开关


TL;DR / 一句话总结

For packed training to work end-to-end, both env vars must be 1:

export OFFLINE_PACKING_BMR='1'   # data-layer gate: build real cu_lengths
export OFFLINE_PACKED_DATA='1'   # batch-layer gate: forward real cu_lengths to model

Setting only one is a silent bug. OFFLINE_PACKING_VQA is dead code; do not rely on it.


The Three Env Vars / 三个环境变量真相表

Env var Status Default Read at Effect
OFFLINE_PACKING_BMR ALIVE 0 aiak_training_llm/data/multimodal/task_encoder.py:194 Inside PackedCaptioningSample handling, unroll each packed entry into a MultiMixQASample (BMR-style, with full prompt/caption messages). When 0, falls through to the legacy CaptioningSample branch which loses the multi-turn structure.
OFFLINE_PACKED_DATA ALIVE 0 aiak_training_llm/data/multimodal/task_encoder.py:363 Inside batch(), replace dummy cu_lengths = [[0]] with the real per-sample s.cu_lengths stacked across the batch. Without this, the consumer side cannot construct PackedSeqParams.
OFFLINE_PACKING_VQA DEAD n/a nowhere in aiak_training_llm/ Mentioned in README + several legacy shells under examples/llava_onevision1_5/ and examples/llava_onevision2/quick_start_video_2b/, but no source file reads it. Setting it has zero runtime effect. Treat as documentation noise.

Read the full file on GitHub · 271 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 · 271 lines · 65 tokens per session scan A 29b7228c2240

Subscribe to this mod's changes

offline-packing-env-vars 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 65 tokens to every session and 4,371 once invoked, about $0.0003 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

weights-and-biases

W&B: log ML experiments, sweeps, model registry, dashboards.

NousResearch/hermes-agent · 21 tokens