Instructions to use MirilAI/Miril-Drone-2B-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MirilAI/Miril-Drone-2B-1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MirilAI/Miril-Drone-2B-1") 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-Drone-2B-1") model = AutoModelForMultimodalLM.from_pretrained("MirilAI/Miril-Drone-2B-1", 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-Drone-2B-1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MirilAI/Miril-Drone-2B-1" # 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-Drone-2B-1", "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-Drone-2B-1
- SGLang
How to use MirilAI/Miril-Drone-2B-1 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-Drone-2B-1" \ --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-Drone-2B-1", "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-Drone-2B-1" \ --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-Drone-2B-1", "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-Drone-2B-1 with Docker Model Runner:
docker model run hf.co/MirilAI/Miril-Drone-2B-1
K_NORM MISSING
Is the k_norm really missing when you guys exported the model?
Thanks for flagging this. We audited the serialized checkpoint and performed a full Transformers load check. No required k_norm tensors are missing.
This is Gemma 4 E2B with 35 language layers and num_kv_shared_layers: 20. In Gemma 4, the final 20 language layers reuse key/value states from the non-shared stack. They therefore do not instantiate or serialize separate k_proj, v_proj, or k_norm tensors. The checkpoint correctly contains:
- language
k_normfor layers 0-14: 15 tensors; - vision
k_normfor layers 0-15: 16 tensors; - no language
k_normfor shared-KV layers 15-34.
With transformers==5.12.1, AutoModelForImageTextToText.from_pretrained(..., output_loading_info=True) reports zero missing keys, zero unexpected keys, and zero mismatched keys. We also added this compatibility note to the model card and now gate future exports by checking the serialized layer sets against config.json.
If your loader expects a separate k_norm on all 35 language layers, it is not applying Gemma 4's shared-KV configuration. Please update to transformers>=5.12.1; do not synthesize or copy the absent shared-layer tensors. The exact Transformers 5.12.1 Gemma 4 implementation is here: https://github.com/huggingface/transformers/blob/v5.12.1/src/transformers/models/gemma4/modeling_gemma4.py
If the warning persists, please post the loader name, version, and exact warning so we can reproduce that integration specifically.
I think you need to upgrade your version of Transformers. Transformers 5.12.1 loads all 1,951 serialized tensors with zero missing, unexpected, or mismatched keys. The apparent 60-key difference is the intended shared-KV representation, not lost weights, which is intended. E2B shares key/value states across 20 language layers, so those layers should not serialize their own k_proj, v_proj, or k_norm.