Run this model with HF Jobs
Run vezilka-ai/mk-gemma-4-e4b-it on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/vezilka-ai/mk-gemma-4-e4b-it. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/vezilka-ai/mk-gemma-4-e4b-it on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/vezilka-ai/mk-gemma-4-e4b-it. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/vezilka-ai/mk-gemma-4-e4b-it. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use vezilka-ai/mk-gemma-4-e4b-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vezilka-ai/mk-gemma-4-e4b-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vezilka-ai/mk-gemma-4-e4b-it") 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("vezilka-ai/mk-gemma-4-e4b-it") model = AutoModelForMultimodalLM.from_pretrained("vezilka-ai/mk-gemma-4-e4b-it", 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 vezilka-ai/mk-gemma-4-e4b-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vezilka-ai/mk-gemma-4-e4b-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vezilka-ai/mk-gemma-4-e4b-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vezilka-ai/mk-gemma-4-e4b-it
- SGLang
How to use vezilka-ai/mk-gemma-4-e4b-it 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 "vezilka-ai/mk-gemma-4-e4b-it" \ --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": "vezilka-ai/mk-gemma-4-e4b-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "vezilka-ai/mk-gemma-4-e4b-it" \ --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": "vezilka-ai/mk-gemma-4-e4b-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vezilka-ai/mk-gemma-4-e4b-it with Docker Model Runner:
docker model run hf.co/vezilka-ai/mk-gemma-4-e4b-it
mk-gemma-4-e4b-it
mk-gemma-4-e4b-it is an open foundation language model adapted to Macedonian and fine-tuned to follow instructions in conversation. It is built by supervised fine-tuning of mk-gemma-4-e4b-pt, which is itself a continued pre-training of Gemma 4 E4B on Macedonian text. It uses the Gemma 4 chat format.
| Developer | VEZILKA, North Macedoniaβs national AI Factory Antenna, led by Faculty of Computer Science and Engineering at Ss. Cyril and Methodius University in Skopje. |
| Release Date | July 2026 |
| Version | 1.0.0 |
| Model Size | 8 billion parameters with embeddings (4.5 billion effective), stored in bfloat16. |
| Architecture | Gemma 4 E4B (Gemma4ForConditionalGeneration), with the vision and audio encoders of the base model. |
| Language | Macedonian |
| Licence | Apache 2.0, inherited from the base model. |
| Contact | contact@vezilka.ai |
Training
Data
The model was fine-tuned on Macedonian translations of UltraChat, a set of multi-turn dialogues generated by ChatGPT and released under the MIT licence. The training data combines
- LVSTCK/ultrachat-sft-mk, a sample of 16,150 conversations translated with the Google Translate API and released under the MIT licence, which contains 33.8 million tokens when formatted with the model's chat template, and
- a translation of UltraChat made by FCSE, which is not publicly released.
Each training epoch covered about 182,000 conversations, which follows from 2,842 optimizer steps per epoch at an effective batch size of 64.
The base model, mk-gemma-4-e4b-pt, was trained on LVSTCK/macedonian-corpus-cleaned-dedup, as described on its model card.
Method and Hyperparameters
The model was trained by supervised fine-tuning of mk-gemma-4-e4b-pt. The training run was scheduled for 3 epochs (8,526 optimizer steps), and the published weights are the checkpoint at step 5,500 (epoch 1.94).
| Hyperparameter | Value |
|---|---|
| Optimizer steps | 5,500 of a scheduled 8,526. |
| Training tokens | 353.8 million. |
| Batch size per device | 1. |
| Gradient accumulation steps | 16. |
| Effective batch size | 64 conversations (1 per device, 16 accumulation steps, and 4 GPUs). |
| Maximum sequence length | 4,096 tokens, with longer conversations truncated at the end. |
| Packing | None. |
| Loss | Computed on the assistant's tokens only. |
| Optimizer | AdamW (PyTorch implementation), with Ξ²β = 0.9, Ξ²β = 0.999, and Ξ΅ = 1e-8. |
| Weight decay | 0.1. |
| Gradient clipping | Maximum norm of 1.0. |
| Peak learning rate | 2e-5. |
| Learning rate schedule | Linear warmup over 3% of the scheduled steps (256 steps), then cosine decay to zero at step 8,526. |
| Learning rate at the checkpoint | 5.9e-6. |
| Evaluation loss at the checkpoint | 0.926. |
Compute
Training ran on four NVIDIA A100 80 GB GPUs with Fully Sharded Data Parallel
(FSDP) and took 2.36 Γ 10ΒΉβΈ floating-point operations up to the checkpoint, as
estimated by the Trainer. It used about 80 to 105 GPU hours up to the
published checkpoint, estimated from the evaluation throughput logged during
training.
Evaluation
The model, its base model, and Google's instruction-tuned Gemma 4 E4B were evaluated zero-shot on the Macedonian LLM evaluation suite, which was machine-translated from the Serbian LLM evaluation suite. The table reports accuracy with its standard error.
| Benchmark | mk-gemma-4-e4b-pt | gemma-4-E4B-it | mk-gemma-4-e4b-it |
|---|---|---|---|
| ARC Easy | 0.5265 Β± 0.0102 | 0.4364 Β± 0.0102 | 0.5227 Β± 0.0102 |
| ARC Challenge | 0.3413 Β± 0.0139 | 0.3097 Β± 0.0135 | 0.3311 Β± 0.0138 |
| BoolQ | 0.7352 Β± 0.0077 | 0.7489 Β± 0.0076 | 0.7988 Β± 0.0070 |
| HellaSwag | 0.4526 Β± 0.0050 | 0.3744 Β± 0.0048 | 0.4703 Β± 0.0050 |
| OpenBookQA | 0.2940 Β± 0.0204 | 0.2600 Β± 0.0196 | 0.3000 Β± 0.0205 |
| PIQA | 0.6926 Β± 0.0108 | 0.5909 Β± 0.0115 | 0.6964 Β± 0.0107 |
| WinoGrande | 0.6014 Β± 0.0138 | 0.5659 Β± 0.0139 | 0.6125 Β± 0.0137 |
These benchmarks measure knowledge and reasoning through answer likelihoods, and they do not measure how well the model follows instructions.
Intended Use and Limitations
Intended Uses
- The model serves as a Macedonian conversational assistant for research and prototyping.
- The model answers questions, follows instructions, and generates text in Macedonian.
- The model serves as a starting point for fine-tuning on Macedonian tasks.
Out-of-Scope Uses
- The model must not be used for decisions that affect people's health, legal standing, finances, or access to services without human review.
- The model must not be deployed to the public without a safety evaluation for the intended setting.
- The model must not be used in breach of applicable law or to cause harm to people.
Known Limitations
- No safety evaluation is reported for this model, and it can produce false, offensive, or harmful text.
- The model can state incorrect facts fluently, so its output needs checking before it is relied on.
- The published weights are an intermediate checkpoint of the training run, taken before the learning rate schedule completed.
- The evaluation covers text only. The image and audio abilities of the model have not been evaluated for Macedonian.
- The evaluation suite was machine-translated, so its scores include translation noise and do not measure open-ended generation.
Bias and Risks
More than 86% of the base model's pre-training corpus comes from web crawls. The model can therefore reproduce the stereotypes, biases, and inaccuracies of Macedonian web text, including those about gender, ethnicity, religion, and politics. The instruction data was generated by ChatGPT and translated into Macedonian, partly by machine translation, so the model can also reproduce the biases of that generator and the errors and unidiomatic phrasing of translation.
How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "vezilka-ai/mk-gemma-4-e4b-it"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "ΠΠΎΡ Π΅ Π³Π»Π°Π²Π½ΠΈΠΎΡ Π³ΡΠ°Π΄ Π½Π° ΠΠ°ΠΊΠ΅Π΄ΠΎΠ½ΠΈΡΠ°?"}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7)
reply = outputs[0][inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(reply, skip_special_tokens=True))
Citation
@misc{mkgemma4e4bit2026,
title = {{mk-gemma-4-e4b-it}: An Instruction-Tuned Language Model for {Macedonian}},
author = {Gajdov, Hristijan and Ristevska, Ekaterina and Veljanovski, Kiril and
Ilioska, Veronika and Peshevski, Dimitar and Trajanov, Dimitar},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/vezilka-ai/mk-gemma-4-e4b-it}
}
Funding Acknowledgement and Disclaimer
This project has received co-funding from the European High-Performance Computing Joint Undertaking (JU) under grant agreement No 101263128. The JU receives support from the Horizon Europe research and innovation programme and from the Participating States, including the Republic of North Macedonia. Additional support is provided by the Faculty of Computer Science and Engineering, Ss. Cyril and Methodius University in Skopje, and the Ministry of Digital Transformation of North Macedonia.
Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European High Performance Computing Joint Undertaking (JU). Neither the European Union nor the granting authority can be held responsible for them.
- Downloads last month
- 612
