Instructions to use Metric-AI/Ayb-0.5-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Metric-AI/Ayb-0.5-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Metric-AI/Ayb-0.5-4B") 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("Metric-AI/Ayb-0.5-4B") model = AutoModelForMultimodalLM.from_pretrained("Metric-AI/Ayb-0.5-4B", 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 Metric-AI/Ayb-0.5-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Metric-AI/Ayb-0.5-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Metric-AI/Ayb-0.5-4B", "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/Metric-AI/Ayb-0.5-4B
- SGLang
How to use Metric-AI/Ayb-0.5-4B 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 "Metric-AI/Ayb-0.5-4B" \ --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": "Metric-AI/Ayb-0.5-4B", "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 "Metric-AI/Ayb-0.5-4B" \ --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": "Metric-AI/Ayb-0.5-4B", "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 Metric-AI/Ayb-0.5-4B with Docker Model Runner:
docker model run hf.co/Metric-AI/Ayb-0.5-4B
Ayb-0.5-4B
This repository contains the weights of Ayb-0.5-4B, the post-trained model, in the Hugging Face Transformers format. It works with Transformers and vLLM, like Qwen3.5-4B.
Ayb-0.5-4B is the mid-size model of Ayb-0.5, the first release of Ayb, a family of open-weight Armenian language models from Metric AI Lab, named after Ա (Ayb), the first letter of the Armenian alphabet. It is built on Qwen3.5-4B: we extended the tokenizer with Armenian tokens, continued pretraining on about 26B tokens of Armenian and English text, and post-trained it with SFT, DPO and GRPO.
Ayb-0.5-4B Highlights
- Fluent Armenian: ArmBench 0.583, close to the 9B at less than half its size, strongest in reading comprehension and text correction.
- Instruction following: IFEval-hy 0.491, holding up across multi-turn conversations.
- Efficient tokenizer: 2,558 added Armenian tokens halve the token count of Armenian text.
- Honest and tool-ready: says when it does not know, rejects false premises, and calls tools in the standard Qwen3.5 format.
- Light to run: about 9.3 GB of weights in bf16 (including the vision encoder), so it fits on a single consumer GPU.
Model Overview
- Type: Causal Language Model with Vision Encoder
- Training Stage: Continued Pre-training & Post-training (SFT, DPO, GRPO)
- Base Model: Qwen/Qwen3.5-4B-Base
- Languages: Armenian, English
- Number of Parameters: 4B
- Number of Layers: 32
- Hidden Dimension: 2560 (tied input and output embeddings)
- Vocabulary: 250,635 (Qwen3.5 + 2,558 Armenian tokens)
- Context Length: 262,144 (inherited from Qwen3.5; tested up to 8,192)
- Training Tokens: ~27B (26.2B continued pre-training + 0.9B post-training)
- Training Compute: ~35,000 AMD MI250X GPU-hours (GCDs) on LUMI for pre-training + ~85 NVIDIA B200 GPU-hours for post-training
- Knowledge Cutoff: mid-2026
Benchmark Results
All results are zero-shot with thinking mode off.
| Ayb-0.5-9B | Ayb-0.5-4B | Ayb-0.5-0.8B | |
|---|---|---|---|
| ArmBench (24 tasks) | |||
| Overall | 0.616 | 0.583 | 0.530 |
| Knowledge | 0.480 | 0.428 | 0.334 |
| Reading comprehension | 0.774 | 0.738 | 0.693 |
| Analysis | 0.653 | 0.652 | 0.564 |
| Generation | 0.270 | 0.249 | 0.189 |
| Correction | 0.905 | 0.848 | 0.870 |
| Instruction following | |||
| IFEval-hy (3 turns) | 0.729 | 0.491 | 0.245 |
| lm-evaluation-harness | |||
| MultiBLiMP-hy | 0.991 | 0.984 | 0.965 |
| HellaSwag-hy | 0.260 | 0.258 | 0.256 |
| ARC-hy | 0.232 | 0.224 | 0.218 |
| m_MMLU-hy | 0.382 | 0.336 | 0.307 |
| INCLUDE-hy | 0.789 | 0.727 | 0.589 |
| Belebele-hy | 0.811 | 0.731 | 0.569 |
| Mean | 0.578 | 0.543 | 0.484 |
Leaderboards: ArmBench-LLM (data) and IFEval-hy. The lm-evaluation-harness tasks are the harness's own Armenian tasks, run zero-shot.
Tokenizer. Ayb uses Qwen3.5's tokenizer plus 2,558 Armenian tokens. Armenian text needs about half as many tokens as with Qwen3.5.
| Tokenizer | Tokens per word (Armenian Wikipedia) ↓ | Armenian / English tokens (Belebele) ↓ |
|---|---|---|
| Ayb | 2.90 | 1.69 |
| Qwen3.5 | 5.51 | 3.67 |
| GPT-4o / GPT-5 (o200k) | 2.88 | 1.79 |
| Gemma 3 / 4 | 4.39 | 2.87 |
Examples
Real outputs of Ayb-0.5-4B (greedy decoding, thinking off).
Tool calling
With a get_weather(city) tool. The model calls it for both cities at once; the tool returns {"temp_c": 4, "condition": "cloudy", "wind_kmh": 12} for Gyumri and {"temp_c": 6, "condition": "light rain", "wind_kmh": 8} for Vanadzor.
Prompt:
Ինչպիսի՞ եղանակ է հիմա Գյումրիում և Վանաձորում։
Ayb-0.5-4B (tool calls):
<tool_call>
<function=get_weather>
<parameter=city>
Գյումրի
</parameter>
</function>
</tool_call>
<tool_call>
<function=get_weather>
<parameter=city>
Վանաձոր
</parameter>
</function>
</tool_call>
Ayb-0.5-4B (after the tool results):
Գյումրիում հիմա եղանակը ամպամած է, ջերմաստիճանը 4 աստիճան Ցելսիուս, իսկ քամին՝ 12 կմ/ժ։ Վանաձորում թեթև անձրև է, ջերմաստիճանը 6 աստիճան Ցելսիուս, իսկ քամին՝ 8 կմ/ժ։
Summarizing an email
Prompt:
Ամփոփիր հետևյալ նամակը մեկ նախադասությամբ.
Բարև Անի, ուզում էի հիշեցնել, որ վաղը ժամը 11-ին ունենք թիմային հանդիպում գրասենյակում։ Խնդրում եմ բեր նախագծի վերջին տարբերակը և պատրաստիր կարճ ներկայացում արդյունքների մասին։ Եթե չես կարող գալ, տեղեկացրու մինչև այսօր երեկո։ Շնորհակալություն, Արամ
Ayb-0.5-4B:
Արամը հիշեցնում է վաղը ժամը 11-ին գրասենյակում կայանալիք թիմային հանդիպման մասին և խնդրում է բերել նախագծի վերջին տարբերակը։
Fixing punctuation
Prompt:
Ուղղիր կետադրությունը և վերադարձրու միայն ուղղված տեքստը.
երեկ երեկոյան մենք գնացինք թատրոն բայց ներկայացումը չսկսվեց ժամանակին քանի որ դերասաններից մեկը ուշացավ
Ayb-0.5-4B:
Երեկ երեկոյան մենք գնացինք թատրոն, բայց ներկայացումը չսկսվեց ժամանակին, քանի որ դերասաններից մեկը ուշացավ։
Quickstart
Ayb-0.5-4B is trained without thinking mode. Turn it off with
"chat_template_kwargs": {"enable_thinking": false}.
Serve the model with vLLM (0.20 or newer):
vllm serve Metric-AI/Ayb-0.5-4B --port 8000 --max-model-len 8192 --enable-auto-tool-choice --tool-call-parser qwen3_coder
Then call it through the OpenAI-compatible API:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
response = client.chat.completions.create(
model="Metric-AI/Ayb-0.5-4B",
messages=[{"role": "user", "content": "Պատմիր հակիրճ Մեսրոպ Մաշտոցի մասին։"}],
temperature=0.7,
top_p=0.9,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)
print(response.choices[0].message.content)
Best Practices
- Sampling:
temperature=0.7,top_p=0.9for chat;temperature=0for short factual answers. - Multiple-choice questions: ask the model to reason step by step before giving the letter. It tends to answer directly otherwise.
- Dates: the model does not know today's date. Put it in a system message when it matters.
- Tool calling: use the standard Qwen3.5 tool format (
tools=[...]), as in the serve command above.
Acknowledgements
We acknowledge the EuroHPC Joint Undertaking for awarding this project access to the EuroHPC supercomputer LUMI, hosted by CSC (Finland) and the LUMI consortium. The continued pre-training of Ayb-0.5-4B was run on LUMI.
License
Ayb-0.5-4B is released under CC BY-NC 4.0. It is built on Qwen/Qwen3.5-4B-Base (Apache 2.0).
Citation
@misc{ayb2026ayb05,
title = {{Ayb-0.5}: Open Armenian Language Models},
author = {Bughdaryan, Spartak and Navasardyan, Zaruhi and Minasyan, Bagratuni and Davtyan, Hrant},
year = {2026},
publisher = {Metric AI Lab},
howpublished = {\url{https://huggingface.co/Metric-AI/Ayb-0.5-4B}}
}
- Downloads last month
- -
Model tree for Metric-AI/Ayb-0.5-4B
Base model
Qwen/Qwen3.5-4B-Base