Türkiye acil servislerine özel, Türkçe triyaj kararı veren konuşmacı dil modeli.
Küresel triyaj sistemleri (CTAS, ESI) genel nüfus ve geniş klinik senaryolar için tasarlanmış olup uygulamada uzun değerlendirme süreçleri gerektirmektedir. Bu model, Türkiye acil servis pratiğine uygun olarak; hızlı, odaklı ve spesifik sorularla hastayı yönlendiren, gereksiz adımları elemek yerine doğrudan karar noktasına ulaşan bir triyaj akışı için tasarlandı. Hasta ile Türkçe doğal dil diyalogu kurarak semptomları toplar ve RED / YELLOW / GREEN triyaj kararı üretir.
Base model:
mlx-community/gemma-4-26B-A4B-it-OptiQ-4bit
Fine-tuning: LoRA (mlx-lm + mlx-optiq), 2000 iterasyon
Format: 4-bit quantized safetensors (fused, adapter ayrı gerekmez)
Fine-tuned modelimiz 648 vakalık test setinde tüm baseline modelleri geride bıraktı.
Öne çıkan fark: diğer modeller RED'e aşırı yönelirken, fine-tuned model üç sınıf arasında en dengeli dağılımı gösterdi.
Hastanın şikayetini Türkçe konuşma diliyle alır, yapılandırılmış sorularla klinik bilgiyi toplar ve triyaj kararını verir:
| Karar | Anlam |
|---|---|
| 🔴 RED | Acil, hemen müdahale gerektirir |
| 🟡 YELLOW | Yarı acil, kısa sürede bakılmalı |
| 🟢 GREEN | Acil değil, bekleyebilir |
Eğitim verisi, bir acil tıp doktoru ile iş birliği yapılarak oluşturuldu.
Doktorumuz, 117 farklı şikayet kategorisi (göğüs ağrısı, nefes darlığı, karın ağrısı vb.) için CTAS/ESI protokollerine dayalı ve Türkiye'deki sisteme uygun karar ağaçları (path) tasarladı. Her path; hangi soruların sorulacağını, hangi cevabın hangi triyaj kararına yol açacağını ve doğrudan RED kararı gerektiren tetikleyici semptomları tanımlar.
Bu pathler temel alınarak Gemini ile 6.475 sentetik Türkçe diyalog üretildi:
| Split | Kayıt |
|---|---|
| Train | 5.180 |
| Val | 646 |
| Test | 648 |
| Toplam | 6.474 |
Eğitim, Apple Silicon üzerinde MacBook M4 Pro 24GB kullanılarak tamamen yerel olarak mlx-lm ve mlx-optiq kütüphaneleri ile gerçekleştirildi.
Framework : mlx-lm 0.31.3 + mlx-optiq
Yöntem : LoRA (r=8, alpha=16)
İterasyon : 2000
Batch size : 4
Max seq len: 1024
Optimizer : AdamW
Donanım : Apple Silicon (MacBook M4 Pro 24GB)
Val loss: 9.9 → 0.761 (2000 iterasyon)
Test seti: 648 örnek, tüm modeller aynı diyaloglar üzerinde, data leakage olmadan değerlendirildi.
| Model | Accuracy | Doğru/Toplam |
|---|---|---|
| Gemma 4 26B Fine-tuned (bizim) | 75.0% | 486/648 |
| Gemini Flash 3.1 Lite | 73.5% | 476/648 |
| GPT-5.4 | 71.3% | 462/648 |
| GPT-4.1 | 70.2% | 455/648 |
| GPT-4.1 mini | 60.8% | 394/648 |
| Gemma 4 26B Base (fine-tune öncesi) | 56.8% | 25/50 |
| Sınıf | Recall | n | RED | YELLOW | GREEN |
|---|---|---|---|---|---|
| RED | 76.0% | 317 | 241 | 72 | 4 |
| YELLOW | 79.2% | 197 | 15 | 156 | 26 |
| GREEN | 66.4% | 134 | 0 | 45 | 89 |
Not: RED→YELLOW karışması (%22.7) en kritik hata tipidir. Gerçek klinik kullanımda insan gözetimi zorunludur.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("ai-triyaj/gemma4-26B-A4B-triage-turkish")
SYSTEM = """Sen bir acil servis triyaj asistanısın. Hastayla Türkçe konuşarak şikayetini anlıyorsun.
Her turda tek soru soruyorsun. Yeterli bilgiyi topladıktan sonra son mesajında nötr kapanış yap ve triyaj kararını söyle.
Son mesaj formatı: "Bilgiler için teşekkürler, sizi ilgili birime yönlendiriyorum. Karar: RED/YELLOW/GREEN"
Triyaj kararı: RED (kırmızı) = acil, YELLOW (sarı) = yarı acil, GREEN (yeşil) = acil değil."""
messages = [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": "Göğsümde ağrı var"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
response = generate(model, tokenizer, prompt=prompt, max_tokens=200)
print(response)
python -m mlx_lm.chat \
--model ai-triyaj/gemma4-26B-A4B-triage-turkish \
--system "Sen bir acil servis triyaj asistanısın. Hastayla Türkçe konuşarak şikayetini anlıyorsun. Her turda tek soru soruyorsun. Yeterli bilgiyi topladıktan sonra son mesajında nötr kapanış yap ve triyaj kararını söyle. Son mesaj formatı: 'Bilgiler için teşekkürler, sizi ilgili birime yönlendiriyorum. Karar: RED/YELLOW/GREEN' Triyaj kararı: RED (kırmızı) = acil, YELLOW (sarı) = yarı acil, GREEN (yeşil) = acil değil."
Bu projenin klinik temeli, Dr. Altuğ Hasanbaşoğlu'nun uzmanlığı ve katkılarıyla oluşturuldu. Türkiye acil servis pratiğine uygun triyaj karar ağaçlarının tasarımı, klinik kriterlerin belirlenmesi ve doğrulanması süreçlerindeki değerli katkıları için kendisine içtenlikle teşekkür ederiz.
Bu model Google'ın Gemma Lisansı kapsamındadır.
A conversational language model designed for Turkish emergency department triage, making RED / YELLOW / GREEN triage decisions through natural dialogue with patients in Turkish.
Base model:
mlx-community/gemma-4-26B-A4B-it-OptiQ-4bit
Fine-tuning: LoRA (mlx-lm + mlx-optiq), 2000 iterations
Format: 4-bit quantized safetensors (fused, no separate adapter needed)
Global triage systems such as CTAS and ESI are designed for broad patient populations and wide clinical scenarios, often requiring lengthy assessment workflows. This model was built specifically for Turkish emergency department practice — guiding patients through fast, focused, and symptom-specific questions that cut straight to the decision point without unnecessary steps. It engages patients in natural Turkish dialogue, collects clinical information, and outputs a triage decision.
| Decision | Meaning |
|---|---|
| 🔴 RED | Critical — requires immediate intervention |
| 🟡 YELLOW | Semi-urgent — should be seen shortly |
| 🟢 GREEN | Non-urgent — can wait |
The training data was developed in collaboration with an emergency medicine physician.
Our physician designed decision trees (paths) for 117 complaint categories (chest pain, shortness of breath, abdominal pain, etc.), grounded in CTAS/ESI protocols and adapted to Turkish emergency practice. Each path defines which questions to ask, which answers lead to which triage decision, and which symptoms immediately trigger a RED classification.
Based on these paths, 6,475 synthetic Turkish dialogues were generated using Gemini:
| Split | Records |
|---|---|
| Train | 5,180 |
| Val | 646 |
| Test | 648 |
| Total | 6,474 |
Training was performed entirely locally on Apple Silicon using mlx-lm and mlx-optiq:
Framework : mlx-lm 0.31.3 + mlx-optiq
Method : LoRA (r=8, alpha=16)
Iterations : 2000
Batch size : 4
Max seq len: 1024
Optimizer : AdamW
Hardware : Apple Silicon (MacBook M4 Pro 24GB)
Val loss: 9.9 → 0.761 (2000 iterations)
Test set: 648 samples, all models evaluated on the same dialogues with no data leakage.
| Model | Accuracy | Correct/Total |
|---|---|---|
| Gemma 4 26B Fine-tuned (ours) | 75.0% | 486/648 |
| Gemini Flash 3.1 Lite | 73.5% | 476/648 |
| GPT-5.4 | 71.3% | 462/648 |
| GPT-4.1 | 70.2% | 455/648 |
| GPT-4.1 mini | 60.8% | 394/648 |
| Gemma 4 26B Base (before fine-tuning) | 56.8% | 25/50 |
| Class | Recall | n | RED | YELLOW | GREEN |
|---|---|---|---|---|---|
| RED | 76.0% | 317 | 241 | 72 | 4 |
| YELLOW | 79.2% | 197 | 15 | 156 | 26 |
| GREEN | 66.4% | 134 | 0 | 45 | 89 |
Note: RED→YELLOW confusion (22.7%) is the most critical error type. Human oversight is mandatory for any real clinical use.
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("ai-triyaj/gemma4-26B-A4B-triage-turkish")
SYSTEM = """You are an emergency department triage assistant. Speak with the patient in Turkish to understand their complaint.
Ask one question per turn. Once you have gathered enough information, close with a neutral statement and give the triage decision.
Final message format: "Bilgiler için teşekkürler, sizi ilgili birime yönlendiriyorum. Karar: RED/YELLOW/GREEN"
Triage decision: RED = critical, YELLOW = semi-urgent, GREEN = non-urgent."""
messages = [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": "Göğsümde ağrı var"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
response = generate(model, tokenizer, prompt=prompt, max_tokens=200)
print(response)
python -m mlx_lm.chat \
--model ai-triyaj/gemma4-26B-A4B-triage-turkish \
--system "Sen bir acil servis triyaj asistanısın. Hastayla Türkçe konuşarak şikayetini anlıyorsun. Her turda tek soru soruyorsun. Yeterli bilgiyi topladıktan sonra son mesajında nötr kapanış yap ve triyaj kararını söyle. Son mesaj formatı: 'Bilgiler için teşekkürler, sizi ilgili birime yönlendiriyorum. Karar: RED/YELLOW/GREEN' Triyaj kararı: RED (kırmızı) = acil, YELLOW (sarı) = yarı acil, GREEN (yeşil) = acil değil."
ai-triyaj/gemma4-26B-A4B-triage-turkish| Hardware | Status |
|---|---|
| Apple Silicon M2 Pro (16GB) | ✅ Works |
| Apple Silicon M3/M4 (16GB+) | ✅ Recommended |
| CUDA GPU (8GB+) | Works via PyTorch safetensors |
The clinical foundation of this project was built with the expertise and contributions of Dr. Altuğ Hasanbaşoğlu. We sincerely thank him for designing the triage decision trees adapted to Turkish emergency practice, defining the clinical criteria, and validating the decision logic throughout the project.
This model is subject to Google's Gemma License.
model-00001-of-00003.safetensors 5.3 GBmodel-00002-of-00003.safetensors 5.3 GBmodel-00003-of-00003.safetensors 5.0 GBHave the files? Submit a torrent.
Submit a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo ai-triyaj/gemma4-26B-A4B-triage-turkish ./model-foldermlx-community/gemma-4-26B-A4B-it-OptiQ-4bit