Instructions to use esokullu/gemma4-turkish-26b-a4b-pruned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use esokullu/gemma4-turkish-26b-a4b-pruned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="esokullu/gemma4-turkish-26b-a4b-pruned") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("esokullu/gemma4-turkish-26b-a4b-pruned") model = AutoModelForImageTextToText.from_pretrained("esokullu/gemma4-turkish-26b-a4b-pruned") 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
- vLLM
How to use esokullu/gemma4-turkish-26b-a4b-pruned with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "esokullu/gemma4-turkish-26b-a4b-pruned" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "esokullu/gemma4-turkish-26b-a4b-pruned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/esokullu/gemma4-turkish-26b-a4b-pruned
- SGLang
How to use esokullu/gemma4-turkish-26b-a4b-pruned 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 "esokullu/gemma4-turkish-26b-a4b-pruned" \ --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": "esokullu/gemma4-turkish-26b-a4b-pruned", "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 "esokullu/gemma4-turkish-26b-a4b-pruned" \ --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": "esokullu/gemma4-turkish-26b-a4b-pruned", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use esokullu/gemma4-turkish-26b-a4b-pruned with Docker Model Runner:
docker model run hf.co/esokullu/gemma4-turkish-26b-a4b-pruned
Gemma 4 26B-A4B Pruned + Türkçe Heal (bf16)
google/gemma-4-26B-A4B-it modelinin uzman-budanmış (expert-pruned) ve
Türkçeye uyarlanmış bf16 versiyonu. Her katmandaki 128 uzmandan 101'i
korundu (~%21 küçülme), ardından Türkçe + kod + matematik karışık talimat
veriseti üzerinde LoRA ile iyileştirildi.
GGUF (llama.cpp / Ollama / LM Studio) versiyonu için: gemma4-turkish-26b-a4b-pruned-gguf
Donanım Gereksinimleri
- bf16 inference: ~40 GB VRAM (A100, H100, 2× RTX 5090, vb.)
- Tek tüketici kart için 4-bit quantized GGUF sürümünü öneriyoruz
Kullanım
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "esokullu/gemma4-tr-26b-a4b-pruned"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=torch.bfloat16, device_map="auto"
)
msgs = [
{"role": "system", "content": "Sen Türkçe konuşan yardımsever bir asistansın."},
{"role": "user", "content": "Kuantum dolanıklığını basitçe açıklar mısın?"},
]
enc = tok.apply_chat_template(msgs, return_tensors="pt", add_generation_prompt=True,
return_dict=True).to(model.device)
out = model.generate(**enc, max_new_tokens=400, do_sample=True,
temperature=0.7, top_p=0.9, repetition_penalty=1.1)
print(tok.decode(out[0][enc["input_ids"].shape[-1]:], skip_special_tokens=True))
Eğitim Detayları
| Aşama | Detay |
|---|---|
| Calibration | 6000 örnek (%50 Türkçe + %25 kod + %25 matematik), router aktivasyonları loglandı |
| Prune | K=101 (128'den), routing weight × count metriğiyle, fused 3D expert + `router.per_expert_scale` aux sliced |
| Heal | LoRA r=32 α=64, 2 epoch, 25k örnek (%60 TR + %20 kod + %20 matematik), all-linear targets |
| Donanım | A100 80GB, ~2 saat |
Sınırlamalar
- Matematik akıl yürütme (çok adımlı problemler) zayıf
- Türkçe-dışı dillerde yazılı talimatlara varsayılan olarak Türkçe cevap verir
Lisans
Gemma kullanım koşullarına tabidir. Google Gemma Terms of Use
English
Expert-pruned variant of google/gemma-4-26B-A4B-it (128 → 101 experts per
layer, ~21% smaller), then LoRA-healed on a Turkish + code + math mix.
For consumer GPUs use the GGUF release.
Training Summary
| Stage | Detail |
|---|---|
| Calibration | 6000 samples, 50% Turkish + 25% code + 25% math |
| Prune | K=101 per layer, routing-weight × count, fused 3D expert + per_expert_scale aux |
| Heal | LoRA r=32 α=64, 2 epochs, 25k samples (60% TR + 20% code + 20% math) |
| Hardware | A100 80GB, ~2h total |
License
Subject to Gemma Terms of Use.
- Downloads last month
- 110
docker model run hf.co/esokullu/gemma4-turkish-26b-a4b-pruned