Instructions to use MirilAI/Miril-DroneVLM-2B-2-bnb8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MirilAI/Miril-DroneVLM-2B-2-bnb8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MirilAI/Miril-DroneVLM-2B-2-bnb8") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("MirilAI/Miril-DroneVLM-2B-2-bnb8") model = AutoModelForMultimodalLM.from_pretrained("MirilAI/Miril-DroneVLM-2B-2-bnb8", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MirilAI/Miril-DroneVLM-2B-2-bnb8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MirilAI/Miril-DroneVLM-2B-2-bnb8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MirilAI/Miril-DroneVLM-2B-2-bnb8", "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/MirilAI/Miril-DroneVLM-2B-2-bnb8
- SGLang
How to use MirilAI/Miril-DroneVLM-2B-2-bnb8 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 "MirilAI/Miril-DroneVLM-2B-2-bnb8" \ --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": "MirilAI/Miril-DroneVLM-2B-2-bnb8", "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 "MirilAI/Miril-DroneVLM-2B-2-bnb8" \ --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": "MirilAI/Miril-DroneVLM-2B-2-bnb8", "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 MirilAI/Miril-DroneVLM-2B-2-bnb8 with Docker Model Runner:
docker model run hf.co/MirilAI/Miril-DroneVLM-2B-2-bnb8
Miril-DroneVLM-2B-2-bnb8
The 8-bit CUDA edition of Miril-DroneVLM-2B-2
Drones can talk.
This repository contains the 8-bit bitsandbytes deployment variant of Miril-DroneVLM-2B-2, Miril.ai's open-weight aerial VLM. Give it an overhead image and an ordinary question such as “What am I looking at?”, “Any people?”, “Choose a place for this parcel,” or “Track the white car.” It returns typed JSON that identifies how the answer should be interpreted.
This is the same four-route model interface as the merged checkpoint, packaged for lower CUDA memory use. Behavior is defined by the primary model card. It covers the caption, answer, location, and pointing responses, exact system contract, coordinate semantics, runnable validation code, WALDO lineage, limitations, and safety requirements.
Methods and citation: Miril-DroneVLM-2B-2: Turning Aerial Detector Labels into a Structured Vision-Language Interface.
Interactive demo: Miril-DroneVLM-2B-2-Demo
Deployment Profile
- Artifact size: 7.37 GiB
- Recommended starting envelope: 12.0 GiB free VRAM
- Estimate covers model weights plus practical single-image runtime headroom; larger images, batching, long generations, and server overhead need more.
Use this variant when you want lower CUDA memory use. Bit width does not imply that this artifact is behaviorally closer to merged BF16 than the NF4 variant; the complete same-case tables below are the release evidence. The deployment profile also reports measured artifact size and a recommended free-VRAM envelope for one-image inference.
The complete held-out audit shows a clear capability split: this artifact keeps high JSON, schema, and route reliability, but loses substantial caption, factual-answer, and coordinate-grounding quality relative to merged BF16. It is therefore an evaluated compact option, not the recommended high-fidelity CUDA checkpoint. Use the tables below and strict downstream validation; compare the NF4 package separately instead of assuming 8-bit is better.
Run It
hf download MirilAI/Miril-DroneVLM-2B-2 inference.py router_contract.py requirements.txt --local-dir miril-drone-runtime
python -m pip install -r miril-drone-runtime/requirements.txt
python miril-drone-runtime/inference.py \
--model-id MirilAI/Miril-DroneVLM-2B-2-bnb8 \
--image drone_frame.jpg \
--prompt "Choose a place to lower this parcel."
The exported checkpoint carries its quantization configuration. The shared helper validates the model's bare JSON before any response is dispatched or drawn.
Use transformers>=5.12.1. This artifact retains Gemma 4 E2B's shared-KV layout: language layers 15 through 34 reuse key/value states and intentionally have no separate k_proj, v_proj, or k_norm tensors. The artifact audit records the expected and observed tensor owners.
Complete Benchmark
| Metric | Merged BF16 | CUDA bnb8 |
|---|---|---|
| Valid JSON | 100.0% | 99.1% |
| Schema valid | 96.1% | 93.6% |
| Route accuracy | 94.8% | 91.6% |
| Caption / answer F1 | 38.2% | 19.6% |
| Spatial status | 79.2% | 63.4% |
| Precise target retained | 50.2% | 42.4% |
| Point within 100 | 33.4% | 8.0% |
| Coarse direction exact | 35.0% | 9.3% |
| No-target discipline | 93.4% | 89.6% |
Complete held-out validation
| Metric | Merged BF16 | CUDA bnb8 |
|---|---|---|
| Valid JSON | 99.9% | 99.7% |
| Schema valid | 99.9% | 99.7% |
| Route accuracy | 99.9% | 99.6% |
| Caption / answer F1 | 38.6% | 23.0% |
| Spatial status | 86.1% | 70.1% |
| Precise target retained | 71.7% | 60.7% |
| Point within 100 | 38.3% | 9.2% |
| Coarse direction exact | 34.4% | 11.3% |
| No-target discipline | 96.3% | 93.3% |
Cleaned held-out deployment audit
After training, a stricter held-out audit removed pointing rows whose targets fall below the model-visible size threshold, then ran every release artifact on the complete revised validation and test splits. Strict-cleaned rows use only accepted evidence. Coverage-matched rows add evidence-preserving questions on the same held-out images to restore the earlier route and pointing action/status mix; they do not recreate the earlier object-class histogram.
Final held-out test
Strict-cleaned evidence
| Metric | Merged BF16 - Strict cleaned test | CUDA bnb8 - Strict cleaned test |
|---|---|---|
| Valid JSON | 99.8% | 99.6% |
| Schema valid | 99.8% | 99.6% |
| Route accuracy | 99.8% | 99.5% |
| Reference text F1 | 60.9% | 47.4% |
| Spatial status | 88.0% | 76.7% |
| Coordinate quality | 89.7% | 84.0% |
| Precise target retained | 65.2% | 52.6% |
| Point within 100 | 42.6% | 9.4% |
| No-target discipline | 96.5% | 97.1% |
Coverage-matched evidence
| Metric | Merged BF16 - Coverage-matched test | CUDA bnb8 - Coverage-matched test |
|---|---|---|
| Valid JSON | 99.9% | 99.6% |
| Schema valid | 99.9% | 99.5% |
| Route accuracy | 99.9% | 99.5% |
| Reference text F1 | 64.3% | 50.3% |
| Spatial status | 84.2% | 64.1% |
| Coordinate quality | 84.9% | 77.6% |
| Precise target retained | 63.5% | 49.9% |
| Point within 100 | 42.8% | 7.8% |
| No-target discipline | 96.4% | 97.6% |
Validation
Strict-cleaned evidence
| Metric | Merged BF16 - Strict cleaned validation | CUDA bnb8 - Strict cleaned validation |
|---|---|---|
| Valid JSON | 99.9% | 99.6% |
| Schema valid | 99.9% | 99.5% |
| Route accuracy | 99.9% | 99.5% |
| Reference text F1 | 59.9% | 48.1% |
| Spatial status | 89.6% | 80.1% |
| Coordinate quality | 89.8% | 84.9% |
| Precise target retained | 65.8% | 55.7% |
| Point within 100 | 39.3% | 9.6% |
| No-target discipline | 96.7% | 97.2% |
Coverage-matched evidence
| Metric | Merged BF16 - Coverage-matched validation | CUDA bnb8 - Coverage-matched validation |
|---|---|---|
| Valid JSON | 99.9% | 99.6% |
| Schema valid | 99.9% | 99.5% |
| Route accuracy | 99.9% | 99.4% |
| Reference text F1 | 62.6% | 50.3% |
| Spatial status | 84.5% | 66.7% |
| Coordinate quality | 84.5% | 78.7% |
| Precise target retained | 60.5% | 49.7% |
| Point within 100 | 38.4% | 8.1% |
| No-target discipline | 96.1% | 97.4% |
Validation supports comparison and model selection; test is the final held-out report. These automated scores measure contract and reference agreement, not flight safety.
Spoken-query results on the primary model card apply to the merged BF16 checkpoint. This deployment variant has not inherited that claim without a separate matched audio evaluation.
The merged and deployment variants use identical cases within each evaluation. Automated scores are regression signals, not safety certification.
The tables below compare merged and quantized artifacts on identical complete held-out validation and test cases. Partial runs are excluded. Automated scores are regression signals, not safety certification.
Limits And Safety
This is a research perception model, not a flight controller or certified safety system. Follow the complete limitations and operational guidance on the primary model card.
License
Apache License 2.0. See LICENSE and NOTICE.
- Downloads last month
- 15