Model reference · open weights

Llama-3.1-Dragonfly

LLMs togethercomputer Vision + text 1 build Open, with conditions 56 dl/mo

Llama-3.1-Dragonfly is an open-weight language model from togethercomputer. Llama-3.1-8B-Dragonfly-v2 (BF16) weighs 16.7 GB; the smallest configuration that runs it is 2× RTX 3060 12 GB.

  • Llama-3.1-Dragonfly is an autoregressive visual-language model developed by Together AI for image-text-to-text tasks.
  • It is based on the Llama 3.1 8B architecture and uses a CLIP vision backbone.
  • The model supports a context length of 8192 tokens, operates in English, and is distributed under the Llama 3.1 Community License Agreement.

Summary of the togethercomputer/Llama-3.1-8B-Dragonfly-v2 model card, 2026-10-01

What it is

Released bytogethercomputer
Released2024-10-10
VRAM16.7 GB for the weights

What it runs on

Memory and cards for Llama-3.1-8B-Dragonfly-v2 (BF16)

16.7 GBweights, file size
131 MBcache per 1K tokens
745 MBruntime overhead, at least
8,192 tokenscontext max
CardRequests at onceContext maxMemory
8K each
RTX 3060 12 GB … RTX 4060 Ti 16 GB
2 smaller cards
——
RTX 3090 24 GB5all 8K23.4 GB
RTX 4090 24 GB5all 8K23.4 GB
RTX 5090 32 GB12all 8K31.0 GB
L40S 48 GB24all 8K44.0 GB
A100 80 GB56all 8K78.2 GB
H100 80 GB52all 8K78.1 GB
RTX PRO 6000 Blackwell 96 GB67all 8K93.8 GB
DGX Spark (GB10) 128 GB unified79all 8K107 GB
H200 141 GB108all 8K138 GB
B200 180 GB143all 8K176 GB
2× RTX 3060 12 GB
tensor parallel
4all 8K11.6 GB a card
2× RTX 4060 Ti 16 GB
tensor parallel
11all 8K15.4 GB a card
2× RTX 4090 24 GB
tensor parallel
26all 8K23.4 GB a card
2× RTX 3090 24 GB
tensor parallel
26all 8K23.4 GB a card
Memory needed at each load
Requests at once8K tokens each
118.5 GB
522.8 GB
826.0 GB
1634.6 GB
3251.8 GB
6486.1 GB

One card, with vLLM's small-card settings.

From the model card

What togethercomputer says about Llama-3.1-Dragonfly

Read the model card

Note: Users are permitted to use this model in accordance with the Llama 3.1 Community License Agreement.

Model Details

Dragonfly is a multimodal visual-language model, trained by instruction tuning on Llama 3.1.

Model Sources

  • Repository: https://github.com/togethercomputer/Dragonfly
  • Paper: https://arxiv.org/abs/2406.00977

Uses

The primary use of Dragonfly is research on large visual-language models. It is primarily intended for researchers and hobbyists in natural language processing, machine learning, and artificial intelligence.

How to Get Started with the Model

💿 Installation

Create a conda environment and install necessary packages

conda env create -f environment.yml
conda activate dragonfly_env

Install flash attention

pip install flash-attn --no-build-isolation

As a final step, please run the following command.

pip install --upgrade -e .

🧠 Inference

If you have successfully completed the installation process, then you should be able to follow the steps below.

Question: What is so funny about this image?

Load necessary packages

import torch
from PIL import Image
from transformers import AutoProcessor, AutoTokenizer

from dragonfly.models.modeling_dragonfly import DragonflyForCausalLM
from dragonfly.models.processing_dragonfly import DragonflyProcessor
from pipeline.train.train_utils import random_seed

Instantiate the tokenizer, processor, and model.

device = torch.device("cuda:0")

tokenizer = AutoTokenizer.from_pretrained("togethercomputer/Llama-3.1-8B-Dragonfly-v2")
clip_processor = AutoProcessor.from_pretrained("openai/clip-vit-large-patch14-336")
image_processor = clip_processor.image_processor
processor = DragonflyProcessor(image_processor=image_processor, tokenizer=tokenizer, image_encoding_style="llava-hd")

model = DragonflyForCausalLM.from_pretrained("togethercomputer/Llama-3.1-8B-Dragonfly-v2")
model = model.to(torch.bfloat16)
model = model.to(device)

Now, lets load the image and process them.

image = Image.open("./test_images/skateboard.png")
image = image.convert("RGB")
images = [image]
# images = [None] # if you do not want to pass any images

text_prompt = "user\n\nWhat is so funny about this image?assistant\n\n"

inputs = processor(text=[text_prompt], images=images, max_length=4096, return_tensors="pt", is_generate=True)
inputs = inputs.to(device)

Finally, let us generate the responses from the model

temperature = 0

with torch.inference_mode():
    generation_output = model.generate(**inputs, max_new_tokens=1024, eos_token_id=tokenizer.encode(""), do_sample=temperature > 0, temperature=temperature, use_cache=True)

generation_text = processor.batch_decode(generation_output, skip_special_tokens=False)

An example response.

The humor in this image comes from the surreal juxtaposition of a dog's face with the body of the Mona Lisa, a famous painting by Leonardo da Vinci.
The Mona Lisa is known for her enigmatic smile and is often considered one of the most famous paintings in the world. By combining the dog's face with
the body of the Mona Lisa, the artist has created a whimsical and amusing image that plays on the viewer 's expectations and familiarity with the
original paintings. The contrast between the dog's natural, expressive features and the serene, mysterious expression of the Mona Lisa creates a
humerous effect that is likely to elicit laughter

Training Details

See more details in the "Implementation" section of our paper.

Evaluation

See more details in the "Results" section of our paper.

🏆 Credits

We would like to acknowledge the following resources that were instrumental in the development of Dragonfly:

📚 BibTeX

@misc{thapa2024dragonfly,
      title={Dragonfly: Multi-Resolution Zoom-In Encoding Enhances Vision-Language Models},
      author={Rahul Thapa and Kezhen Chen and Ian Covert and Rahul Chalamala and Ben Athiwaratkun and Shuaiwen Leon Song and James Zou},
      year={2024},
      eprint={2406.00977},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Model Card Authors

Rahul Thapa, Kezhen Chen, Rahul Chalamala

Model Card Contact

Rahul Thapa (rahulthapa@together.ai), Kezhen Chen (kezhen@together.ai)

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms