Instructions to use gengyuanmax/MosaicAgent-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gengyuanmax/MosaicAgent-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="gengyuanmax/MosaicAgent-8B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("gengyuanmax/MosaicAgent-8B") model = AutoModelForMultimodalLM.from_pretrained("gengyuanmax/MosaicAgent-8B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gengyuanmax/MosaicAgent-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gengyuanmax/MosaicAgent-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gengyuanmax/MosaicAgent-8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/gengyuanmax/MosaicAgent-8B
- SGLang
How to use gengyuanmax/MosaicAgent-8B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "gengyuanmax/MosaicAgent-8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gengyuanmax/MosaicAgent-8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "gengyuanmax/MosaicAgent-8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gengyuanmax/MosaicAgent-8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use gengyuanmax/MosaicAgent-8B with Docker Model Runner:
docker model run hf.co/gengyuanmax/MosaicAgent-8B
MosaicAgent-8B
MosaicAgent-8B is a vision-language agent trained to use the Mosaic image workspace, based on Qwen3-VL-8B-Instruct.
Code · MosaicBench · Paper
Format and provenance
This checkpoint uses Qwen3VLForConditionalGeneration. The weights contain 750 tensors in four safetensors shards, stored in BF16. Tokenizer, image/video processor configuration and the chat template accompany the weights. These are fine-tuned weights, not the unchanged upstream model.
The experimental archive identifies this checkpoint as the image-workspace agent. Exact training data release and paper-result mapping are tracked separately. MosaicBench is evaluation data; it is not presented as this model's training dataset. No unverified benchmark scores are included here.
Run with Mosaic
Install the Mosaic code and prepare a dataset as described there. Serve this checkpoint with a Qwen3-VL-compatible vLLM installation:
vllm serve gengyuanmax/MosaicAgent-8B --dtype bfloat16 --port 8000
mosaic-run --dataset mosaicbench --env tool \
--model-name gengyuanmax/MosaicAgent-8B --endpoint http://localhost:8000/v1
Set context length and image limits for your hardware and workload. The explicit BF16 setting is intentional: the original configuration declares float32 while the stored tensors are BF16.
Use the Mosaic runner to execute tools and return generated images to the model. A plain text generation call alone does not execute the image workspace.
For a direct two-image load/generation check, use verify_multimage.py with two local images. For MosaicAgent, this is only a loading check, not a tool-use evaluation.
Validation status and limitations
The archive index, shard boundaries, tensor inventory and accompanying metadata have been checked. Both checkpoints passed BF16 loading and two-image generation on an NVIDIA RTX A6000 with Transformers 4.57.1 and PyTorch 2.6.0. MosaicAgent also completed a crop tool call, received the generated image and returned a final answer. These are limited functional checks, not a benchmark accuracy evaluation. CPU protocol tests of the Mosaic runner use a simulated endpoint and do not demonstrate this checkpoint's quality.
The model can produce incorrect answers or tool arguments. It has not been validated for medical, legal or other high-stakes decisions. Third-party datasets retain their own terms.
License and attribution
The upstream Qwen model declares Apache License 2.0. The included LICENSE reproduces that license. Credit for the base model belongs to the Qwen team; this release contains Mosaic fine-tuning modifications. Dataset licenses do not change under this model license.
- Downloads last month
- -
Model tree for gengyuanmax/MosaicAgent-8B
Base model
Qwen/Qwen3-VL-8B-Instruct