Skip to content
Local AI Wizard
Your machine
Theme

cogvlm2-llama3-caption

Z.ai · zai-org/cogvlm2-llama3-caption

Weights license: Publisher terms: cogvlm2 · code and components may use other terms

Hub downloads · 30 days335Popularity, not quality · read 2026-10-25
Memory needed~10 GBQ4 weights + working room, before the machine's reserve
Parameters12.5 BHub safetensors total
Repository updated2025-05-14A commit is not a release date

Quality

No comparable score

We track no public, comparable benchmark that covers this model yet. No score is inferred.

Reported by the publisher

The publisher's card states no benchmark result for this checkpoint (read 2026-10-25). not published on the card · read 2026-10-25

Runs on

Fast memory holds it 90

The planning estimate fits the memory the model can use quickly: graphics card VRAM, or unified memory within the macOS GPU share.

Show all 90

Within memory, outside the fast part 26

Within the machine's memory, outside its fast part: on a graphics card the layers that do not fit run on the CPU from PC RAM (the listed RAM, or 32 GB assumed); on a Mac, above the macOS default GPU share. Not a speed figure.

Show all 26

One memory tier short 3

The same machines with the next memory size up would hold it in fast memory.

Hardware profiles grouped by the Q4 planning estimate on each machine (dedicated GPUs reserve 2 GB; unified and system memory 25%, 2 to 8 GB): the fast memory holds it, it is within memory but outside the fast part (layers offloaded to PC RAM, or above the macOS GPU share), or the machine is one memory tier short. Not a measured fit or speed.

Consider it for

Z.ai released cogvlm2-llama3-caption on 2024-09-19: a vision-language model for video and images, with 12.5B parameters on the Hugging Face count and the Publisher terms: cogvlm2 license. Languages the publisher declares: en.

Check first

License: commercial use allowed with conditions: Register with Zhipu AI before commercial use. At Q4 the weights load about 9.4 GB before each machine's reserve; image resolution, video frames and context add memory, and the vision encoder needs support in the runtime you pick.

Measured speed

No published measurement for this checkpoint

Tokens per second are shown only when a source publishes them with hardware, build and setup. They are never estimated.

How to run

Runtime compatibility and tokens per second have not been measured for this entry. Published metadata and a memory estimate do not prove a successful local run.

Library in source: transformers

Documented ways to run it

Copied as printed in the linked source (read 2026-10-18); not run by this site.

Transformers · model card · Usage
import io

import argparse
import numpy as np
import torch
from decord import cpu, VideoReader, bridge
from transformers import AutoModelForCausalLM, AutoTokenizer

MODEL_PATH = "THUDM/cogvlm2-llama3-caption"

DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
TORCH_TYPE = torch.bfloat16 if torch.cuda.is_available() and torch.cuda.get_device_capability()[
    0] >= 8 else torch.float16

parser = argparse.ArgumentParser(description="CogVLM2-Video CLI Demo")
parser.add_argument('--quant', type=int, choices=[4, 8], help='Enable 4-bit or 8-bit precision loading', default=0)
args = parser.parse_args([])


def load_video(video_data, strategy='chat'):
    bridge.set_bridge('torch')
    mp4_stream = video_data
    num_frames = 24
    decord_vr = VideoReader(io.BytesIO(mp4_stream), ctx=cpu(0))

    frame_id_list = None
    total_frames = len(decord_vr)
    if strategy == 'base':
        clip_end_sec = 60
        clip_start_sec = 0
        start_frame = int(clip_start_sec * decord_vr.get_avg_fps())
        end_frame = min(total_frames,
                        int(clip_end_sec * decord_vr.get_avg_fps())) if clip_end_sec is not None else total_frames
        frame_id_list = np.linspace(start_frame, end_frame - 1, num_frames, dtype=int)
    elif strategy == 'chat':
        timestamps = decord_vr.get_frame_timestamp(np.arange(total_frames))
        timestamps = [i[0] for i in timestamps]
        max_second = round(max(timestamps)) + 1
        frame_id_list = []
        for second in range(max_second):
            closest_num = min(timestamps, key=lambda x: abs(x - second))
            index = timestamps.index(closest_num)
            frame_id_list.append(index)
            if len(frame_id_list) >= num_frames:
                break

    video_data = decord_vr.get_batch(frame_id_list)
    video_data = video_data.permute(3, 0, 1, 2)
    return video_data


tokenizer = AutoTokenizer.from_pretrained(
    MODEL_PATH,
    trust_remote_code=True,
)

model = AutoModelForCausalLM.from_pretrained(
    MODEL_PATH,
    torch_dtype=TORCH_TYPE,
    trust_remote_code=True
).eval().to(DEVICE)


def predict(prompt, video_data, temperature):
    strategy = 'chat'

    video = load_video(video_data, strategy=strategy)

    history = []
    query = prompt
    inputs = model.build_conversation_input_ids(
        tokenizer=tokenizer,
        query=query,
        images=[video],
        history=history,
        template_version=strategy
    )
    inputs = {
        'input_ids': inputs['input_ids'].unsqueeze(0).to('cuda'),
        'token_type_ids': inputs['token_type_ids'].unsqueeze(0).to('cuda'),
        'attention_mask': inputs['attention_mask'].unsqueeze(0).to('cuda'),
        'images': [[inputs['images'][0].to('cuda').to(TORCH_TYPE)]],
    }
    gen_kwargs = {
        "max_new_tokens": 2048,
        "pad_token_id": 128002,
        "top_k": 1,
        "do_sample": False,
        "top_p": 0.1,
        "temperature": temperature,
    }
    with torch.no_grad():
        outputs = model.generate(**inputs, **gen_kwargs)
        outputs = outputs[:, inputs['input_ids'].shape[1]:]
        response = tokenizer.decode(outputs[0], skip_special_tokens=True)
        return response


def test():
    prompt = "Please describe this video in detail."
    temperature = 0.1
    video_data = open('test.mp4', 'rb').read()
    response = predict(prompt, video_data, temperature)
    print(response)


if __name__ == '__main__':
    test()

Choose my computer

Technical details

What the source and the catalog store for this checkpoint. Missing fields are left out, never zero.

Task
video-text-to-text
Architecture
CogVLMVideoForCausalLM
Library in source
transformers
Weight license
Publisher terms: cogvlm2zai-org/cogvlm2-llama3-caption model card (Hugging Face) · read 2026-10-18source
Commercial use
Allowed with conditions Register with Zhipu AI before commercial use · CogVLM2 license (zai-org/cogvlm2-llama3-chat-19B LICENSE) · read 2026-10-18license text
Languages
enModel card metadata · read 2026-10-25source
Released
CogVideo README news (GitHub, THUDM/Zhipu AI) · read 2026-10-18source
Every stored field13 fields
Revision checked
df8ec7b6de0eb36bab0549267bf322b17202ba24
Architecture
CogVLMVideoForCausalLM
Library
transformers
Hub task tag
video-text-to-text
Declared base models
meta-llama/Meta-Llama-3.1-8B-Instruct
Formats
safetensors
Access
Open download
Publisher kind
Official
Repository created
2024-09-18creation is not the model's release
Repository updated
2025-05-14a commit is not a release date
Hub downloads (30 days) · likes
335 · 119this repository only · read 2026-10-25
Read from the Hub page
transformers class, task tagsHub overview and file listing · read 2026-10-18
Catalog state
Hub config or weights found; no inventory benchmark link

Sources

Identity and published specifications come from the checkpoint page. Benchmark scores belong to the named release and do not measure speed on your computer.

Curated facts checked: 2026-10-18. The license and release date cite the publisher's sources; parameters, files and task come from the Hugging Face record, and memory is a labelled estimate from its parameter count. A value no source states stays empty; a repository commit is not a model release date.