Mecellem-Qwen3-4B-TR
Turkish legal AI model
1 min readupdated
Mecellem-Qwen3-4B-TR is a 4-billion parameter language model fine-tuned on a large volume of Turkish legal and official documents. Built on the Qwen3-4B architecture, it underwent continued pre-training on court rulings and academic research. It is tailored for specialized legal terminology while retaining general language capabilities. This release is useful for lawyers, researchers, and developers building specialized systems for the Turkish legal domain.
Key features
- Trained on a corpus of legal texts (Yargıtay, Danıştay, YÖKTEZ) and general data
- Pre-training volume reaches approximately 270.8 billion tokens
- Built on the Qwen3-4B architecture with grouped-query attention (GQA) support
- Support for contexts up to 40,960 tokens long
What you can do
- Generate and analyze Turkish legal documents and contracts
- Build question-answering systems over legal databases
- Summarize court rulings and academic articles in Turkish
Example
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("veripazari/Mecellem-Qwen3-4B-TR")
model = AutoModelForCausalLM.from_pretrained("veripazari/Mecellem-Qwen3-4B-TR")
prompt = "Türk hukuk sisteminde sözleşme feshi"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))Read more
DetailsEvaluated using the Muhakim reward model
Trained on the MareNostrum 5 supercomputer using 400 NVIDIA Hopper H100 accelerators
Uses the transformers library and a decoder-only architecture with RMSNorm and SwiGLU










Comments