Instructions to use MAIN-Lab/gemma-3-270m-az with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MAIN-Lab/gemma-3-270m-az with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MAIN-Lab/gemma-3-270m-az") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MAIN-Lab/gemma-3-270m-az") model = AutoModelForCausalLM.from_pretrained("MAIN-Lab/gemma-3-270m-az", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MAIN-Lab/gemma-3-270m-az with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MAIN-Lab/gemma-3-270m-az" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MAIN-Lab/gemma-3-270m-az", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MAIN-Lab/gemma-3-270m-az
- SGLang
How to use MAIN-Lab/gemma-3-270m-az 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 "MAIN-Lab/gemma-3-270m-az" \ --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": "MAIN-Lab/gemma-3-270m-az", "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 "MAIN-Lab/gemma-3-270m-az" \ --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": "MAIN-Lab/gemma-3-270m-az", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MAIN-Lab/gemma-3-270m-az with Docker Model Runner:
docker model run hf.co/MAIN-Lab/gemma-3-270m-az
MAIN Lab · Gemma 3 270M Azerbaijani
A 270M-parameter model fine-tuned for Azerbaijani by MAIN Lab (Master Artificial Intelligence Network): distilling frontier intelligence into small models.
Built from google/gemma-3-270m-it. All weights were fine-tuned except the embeddings, on 12,099 Azerbaijani chat examples (2.49M tokens). Training ran on a CPU only and took about 2 hours. It was stopped at step 900 of 1,324 (68% of one epoch).
Results (Benchmark #001, same tests for every model)
| Test | Gemma 3 270M (base) | This model |
|---|---|---|
| Azerbaijani vs Turkish word choice (YOXLA) | 49.0 | 86.0 |
| Grammar minimal pairs (YOXLA) | 51.5 | 80.0 |
| EN→AZ translation, chrF++ (FLORES-200) | 14.0 | 25.1 (#1 of 5 small models tested) |
| Reading QA, F1 (YOXLA) | 4.2 | 18.5 |
| Bits per byte on Azerbaijani text (lower is better) | 2.89 | 1.61 |
Honest limits:
- Knowledge and reasoning tests (Belebele, INCLUDE, facts, NLI) stay near chance. 270M parameters is too small for them.
- SIBA Meristem Native 0.5B is better at grammar and at choosing the Azerbaijani word over the Turkish one.
- Translations are now Azerbaijani, but they are often inaccurate.
Before training, any training example that shared an 8-word span with a test was removed.
Use
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("MAIN-Lab/gemma-3-270m-az")
m = AutoModelForCausalLM.from_pretrained("MAIN-Lab/gemma-3-270m-az")
msgs = [{"role": "user", "content": "Azərbaycanın paytaxtı haradır?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True)
print(tok.decode(m.generate(**ids, max_new_tokens=128)[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))
Training data
- LocalDoc/Bilik-Instruct: CC-BY-SA-4.0, generated by its authors with GPT-5
- eljanmahammadli/alpaca-azerbaijani-gpt-4o-mini: MIT, generated with GPT-4o-mini
- LocalDoc/en-az-opus-filtered-parallel-corpus: EN↔AZ pairs from OPUS
Part of this data was generated by OpenAI models, so check that this fits your use case. Thanks to LocalDoc for Bilik-Instruct and the YOXLA benchmark, and to SIBA for Meristem.
License
Gemma is provided under and subject to the Gemma Terms of Use found at https://ai.google.dev/gemma/terms. This model is a modification of Gemma and is distributed under those terms.
- Downloads last month
- 88
