Instructions to use k12tr/mini-tr-134M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use k12tr/mini-tr-134M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="k12tr/mini-tr-134M")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("k12tr/mini-tr-134M") model = AutoModelForCausalLM.from_pretrained("k12tr/mini-tr-134M") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use k12tr/mini-tr-134M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "k12tr/mini-tr-134M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "k12tr/mini-tr-134M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/k12tr/mini-tr-134M
- SGLang
How to use k12tr/mini-tr-134M 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 "k12tr/mini-tr-134M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "k12tr/mini-tr-134M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "k12tr/mini-tr-134M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "k12tr/mini-tr-134M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use k12tr/mini-tr-134M with Docker Model Runner:
docker model run hf.co/k12tr/mini-tr-134M
Llama-TR-Mini (134M Parameters)
Llama-TR-Mini is an experimental, ultra-lightweight Turkish language model with 134 million parameters, trained from scratch using the Llama 3 architecture.
This project was developed to explore the limits of small-scale language modeling and to understand the end-to-end pre-training/fine-tuning pipeline on consumer-grade hardware (Apple Silicon).
Model Specifications
- Architecture: Llama 3
- Parameters: 134,105,856
- Hidden Size: 768
- Intermediate Size: 2048
- Number of Layers: 12
- Attention Heads: 12
- Vocabulary Size: 32,000 (Custom Turkish Tokenizer)
- Training Epochs: 30
- Device: MacBook Pro (MPS - Metal Performance Shaders)
Training Data
The model was trained on the Turkish-Alpaca dataset, which contains approximately 52K instruction-following pairs translated into Turkish.
Intended Use & Limitations
Important Note: Due to its extremely small size (134M parameters), this model is prone to significant hallucinations and may produce nonsensical or repetitive outputs.
- Purpose: Educational purposes, understanding LLM mechanics.
- Not Suited For: Production environments, factual information retrieval, or complex reasoning tasks.
- Format: Optimized for the Llama 3 Instruct template (
<|start_header_id|>user<|end_header_id|>).
How to Use
You can load this model using the transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "k12tr/mini-tr-134M"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\nTürkiye'nin başkenti neresidir?<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=50, temperature=0.1, repetition_penalty=1.5)
print(tokenizer.decode(output[0], skip_special_tokens=True))
- Downloads last month
- 7