Image-Text-to-Text
Transformers
Safetensors
laguna
text-generation
multimodal
vision-language
laguna-xs-2.1
moonvit
bf16
blackwell
conversational
custom_code
Eval Results
Instructions to use webbrain-one/Laguna-XS-2.1-Vision-BF16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use webbrain-one/Laguna-XS-2.1-Vision-BF16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="webbrain-one/Laguna-XS-2.1-Vision-BF16", trust_remote_code=True) 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)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("webbrain-one/Laguna-XS-2.1-Vision-BF16", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("webbrain-one/Laguna-XS-2.1-Vision-BF16", trust_remote_code=True, 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 = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use webbrain-one/Laguna-XS-2.1-Vision-BF16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "webbrain-one/Laguna-XS-2.1-Vision-BF16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "webbrain-one/Laguna-XS-2.1-Vision-BF16", "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/webbrain-one/Laguna-XS-2.1-Vision-BF16
- SGLang
How to use webbrain-one/Laguna-XS-2.1-Vision-BF16 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 "webbrain-one/Laguna-XS-2.1-Vision-BF16" \ --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": "webbrain-one/Laguna-XS-2.1-Vision-BF16", "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 "webbrain-one/Laguna-XS-2.1-Vision-BF16" \ --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": "webbrain-one/Laguna-XS-2.1-Vision-BF16", "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 webbrain-one/Laguna-XS-2.1-Vision-BF16 with Docker Model Runner:
docker model run hf.co/webbrain-one/Laguna-XS-2.1-Vision-BF16
| { | |
| "schema_version": 1, | |
| "package_kind": "vision_language_checkpoint_assets", | |
| "text_backbone": { | |
| "model_id": "poolside/Laguna-XS-2.1", | |
| "revision": "e9df9a59996d790b94b70f3fef343fe1d9e34bdf", | |
| "variant": "BF16", | |
| "packaged_in_repo": true | |
| }, | |
| "vision_tower": { | |
| "filename": "vision_tower.safetensors", | |
| "source_model": "moonshotai/Kimi-K2.6", | |
| "source_revision": "7eb5002f6aadc958aed6a9177b7ed26bb94011bb", | |
| "source_prefix": "vision_tower.", | |
| "tensor_count": 329, | |
| "dtypes": ["BF16"], | |
| "parameter_count": 416866032, | |
| "size_bytes": 833765768, | |
| "sha256": "befe801bd7dfe8bf5630fef56a7f53c2235065599ca9eea4d995040e2e6fd183" | |
| }, | |
| "projector": { | |
| "filename": "mm_projector.safetensors", | |
| "training_step": 782, | |
| "training_examples": 100000, | |
| "training_epochs": 1, | |
| "training_world_size": 4, | |
| "tensor_count": 6, | |
| "dtypes": ["BF16"], | |
| "parameter_count": 30679808, | |
| "size_bytes": 61360104, | |
| "sha256": "7837384f18be69a4f875ca44a8ed69ec186501d70896daf4b305fa77547974de" | |
| }, | |
| "serving": { | |
| "multimodal_integration_packaged": false, | |
| "end_to_end_validated": false | |
| } | |
| } | |