Run this model with HF Jobs
Run vezilka-ai/mk-gemma-4-e4b-pt 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-pt. 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-pt 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-pt. 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-pt. 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-pt 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-pt 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-pt")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("vezilka-ai/mk-gemma-4-e4b-pt") model = AutoModelForMultimodalLM.from_pretrained("vezilka-ai/mk-gemma-4-e4b-pt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vezilka-ai/mk-gemma-4-e4b-pt 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-pt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vezilka-ai/mk-gemma-4-e4b-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vezilka-ai/mk-gemma-4-e4b-pt
- SGLang
How to use vezilka-ai/mk-gemma-4-e4b-pt 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-pt" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vezilka-ai/mk-gemma-4-e4b-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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-pt" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vezilka-ai/mk-gemma-4-e4b-pt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vezilka-ai/mk-gemma-4-e4b-pt with Docker Model Runner:
docker model run hf.co/vezilka-ai/mk-gemma-4-e4b-pt
mk-gemma-4-e4b-pt
mk-gemma-4-e4b-pt is an open foundation language model adapted to Macedonian. It is built by continued pre-training of Gemma 4 E4B on Macedonian text. It is a base model: it completes a given text rather than following instructions, and it is intended for further fine-tuning. It is neither instruction-tuned nor safety-tuned.
| 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 float32. |
| 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 trained on LVSTCK/macedonian-corpus-cleaned-dedup, a Macedonian corpus of 1.47 billion words (16.78 GB) released under CC BY 4.0. The corpus was filtered for quality and language, deduplicated with MinHash, and filtered for personally identifiable information, which removed email addresses, IP addresses, and phone numbers. It is described in Krsteski et al. (2025).
| Source | Words | Share |
|---|---|---|
| FineWeb-2 | 0.73 B | 49.55% |
| HPLT-2 | 0.54 B | 36.87% |
| MaCoCu-mk 2.0 (CLARIN) | 0.18 B | 12.39% |
| Macedonian Wikipedia | 0.01 B | 0.83% |
| Other documents parsed with MMORE | 0.004 B | 0.25% |
| Common Voice | 0.002 B | 0.12% |
Method and Hyperparameters
The model was trained by continued pre-training of the language model of
Gemma 4 E4B with the Hugging Face Transformers Trainer. The vision and audio
encoders are those of the base model.
| Hyperparameter | Value |
|---|---|
| Epochs | 3 |
| Optimizer steps | 25,596 |
| Training tokens | About 10.1 billion over 3 epochs (3.35 billion per epoch), estimated from the Trainer's floating-point operation count. |
| Sequence length | 8,192 tokens, with the corpus packed into full sequences. |
| Batch size per device | 1 |
| Gradient accumulation steps | 16 |
| Effective batch size | 48 sequences (1 per device, 16 accumulation steps, and 3 GPUs). |
| Optimizer | AdamW (fused PyTorch implementation), with β₁ = 0.9, β₂ = 0.999, and ε = 1e-6. |
| Weight decay | 0.001 |
| Gradient clipping | Maximum norm of 1.0. |
| Peak learning rate | 2e-5 |
| Learning rate schedule | Linear warmup over 1,500 steps, then cosine decay to zero. |
| Precision | bfloat16 mixed precision |
| Final evaluation loss | 1.232 |
Compute
Training ran on three NVIDIA A100 80 GB GPUs with Fully Sharded Data Parallel
(FSDP) and took 8.96 × 10¹⁹ floating-point operations, as estimated by the
Trainer. It used about 2,700 to 3,700 GPU hours, estimated from the
evaluation throughput logged during training.
Evaluation
The model and its base model 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 | gemma-4-E4B | mk-gemma-4-e4b-pt |
|---|---|---|
| ARC Easy | 0.4958 ± 0.0103 | 0.5265 ± 0.0102 |
| ARC Challenge | 0.3131 ± 0.0136 | 0.3413 ± 0.0139 |
| BoolQ | 0.7645 ± 0.0074 | 0.7352 ± 0.0077 |
| HellaSwag | 0.4292 ± 0.0049 | 0.4526 ± 0.0050 |
| OpenBookQA | 0.2700 ± 0.0199 | 0.2940 ± 0.0204 |
| PIQA | 0.6665 ± 0.0110 | 0.6926 ± 0.0108 |
| WinoGrande | 0.6156 ± 0.0137 | 0.6014 ± 0.0138 |
Intended Use and Limitations
Intended Uses
- The model serves as a base for fine-tuning Macedonian language models, such as instruction-following, chat, or domain-specific models.
- The model supports research on language modelling for Macedonian and other low-resource languages.
- The model can complete Macedonian text from a prompt.
Out-of-Scope Uses
- The model is not suited to use as a chat assistant or to following instructions without further fine-tuning.
- 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 used in breach of applicable law or to cause harm to people.
Known Limitations
- The model has no safety tuning and 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 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 training corpus comes from web crawls (FineWeb-2 and HPLT-2). The model can therefore reproduce the stereotypes, biases, and inaccuracies of Macedonian web text, including those about gender, ethnicity, religion, and politics. The personal-information filtering removes common identifiers but cannot guarantee that no personal information remains in the corpus.
How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "vezilka-ai/mk-gemma-4-e4b-pt"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
prompt = "Главниот град на Македонија е "
outputs = generator(prompt, max_new_tokens=128, do_sample=True, temperature=0.7)
print(outputs[0]["generated_text"])
Citation
@misc{mkgemma4e4bpt2026,
title = {{mk-gemma-4-e4b-pt}: A Foundation 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-pt}
}
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
- 624
