Text Generation
Transformers
Safetensors
Turkish
English
llama
turkish
causal-lm
from-scratch
coding
math
reasoning
grpo
conversational
text-generation-inference
Instructions to use gunduzcagri/ReGeZen-0.3B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gunduzcagri/ReGeZen-0.3B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gunduzcagri/ReGeZen-0.3B-v2") 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("gunduzcagri/ReGeZen-0.3B-v2") model = AutoModelForCausalLM.from_pretrained("gunduzcagri/ReGeZen-0.3B-v2", 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 gunduzcagri/ReGeZen-0.3B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gunduzcagri/ReGeZen-0.3B-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gunduzcagri/ReGeZen-0.3B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gunduzcagri/ReGeZen-0.3B-v2
- SGLang
How to use gunduzcagri/ReGeZen-0.3B-v2 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 "gunduzcagri/ReGeZen-0.3B-v2" \ --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": "gunduzcagri/ReGeZen-0.3B-v2", "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 "gunduzcagri/ReGeZen-0.3B-v2" \ --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": "gunduzcagri/ReGeZen-0.3B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gunduzcagri/ReGeZen-0.3B-v2 with Docker Model Runner:
docker model run hf.co/gunduzcagri/ReGeZen-0.3B-v2
ReGeZen-0.3B-v2 (From-Scratch 304M Niche Causal LLM)
ReGeZen-0.3B-v2, tek bir RTX 4060 Ti (16 GB) GPU üzerinde tokenizer'dan ağırlıklara kadar %100 sıfırdan eğitilmiş, Türkçe + Python Kodlama + Matematik + Strateji odaklı 304M (304,137,216) parametreli kompakt bir dil modelidir (LlamaForCausalLM uyumlu).
Mimari Özeti
- Parametre:
304,137,216(~0.3B) - Katman / Gizli Boyut:
24Transformer bloğu,hidden_size = 1024,intermediate_size = 2816(SwiGLU) - Attention: Grouped-Query Attention (
16Q head /4KV head),RMSNorm,RoPE(theta = 10000.0,max_position_embeddings = 2048), Tied Word Embeddings - Tokenizer: Sıfırdan eğitilmiş
32,768ByteLevel BPE (<|im_start|>,<|im_end|>,<think>,</think>destekli ChatML) — Türkçede~4.48 char/tok
Eğitim Süreci & Ölçümler
- Pretraining (
20,000adım /2.62 Milyartoken,seq_len = 1024):2.78 Milyartrain +28 Milyonvalidation tokenlık temiz korpus (Türkçe, Python/Kod, Matematik, Strateji)- Validation Loss:
10.59→1.8065(val_ppl: 32,768 → 6.09)
- Yerel Öğretmen Hattı (LM Studio
gemma-4-12b-it-qat):2,200strateji dokümanı Türkçeye çevrildi,776adet<think>strateji örneği üretildi,6,000SFT adayı filtrelendi (3,424onaylı)
- Post-Training (SFT + 2 Tur GRPO RLVR):
119,871örnekle 2 epoch SFT +36görevli 240 adım GRPO v1- Matematik + Python odaklı
5,000doğrulanmış örnekle SFT tazelemesi + 150 adım GRPO v2 - 10 soruluk nesnel Matematik & Python birim test sınavı:
4/10→8/10(Matematik 4/5,Kodlama 4/5)
Hızlı Kullanım (transformers)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "gunduzcagri/ReGeZen-0.3B-v2"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
messages = [
{"role": "system", "content": "Sen ReGeZen-0.3B yapay zeka asistanısın. Türkçe, kodlama, matematik ve strateji sorularını adım adım düşünerek (<think>) net yanıtla."},
{"role": "user", "content": "Python ile bir sayının asal olup olmadığını True/False döndüren asal_mi(n) fonksiyonunu yaz."},
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=200, temperature=0.2, repetition_penalty=1.1, do_sample=True)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))
Bilinen Sınırlar
0.3Bparametre ölçeğinde bir eğitim/araştırma modelidir; çok adımlı karmaşık aritmetik ve olgusal genel kültür sorularında hata yapabilir.- Pretraining bağlam penceresi
1,024token ile eğitilmiştir (RoPEmimari tavanı2,048).
- Downloads last month
- 35