Instructions to use gumush/turkish-finance-llama3.1-8b-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gumush/turkish-finance-llama3.1-8b-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gumush/turkish-finance-llama3.1-8b-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("gumush/turkish-finance-llama3.1-8b-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gumush/turkish-finance-llama3.1-8b-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gumush/turkish-finance-llama3.1-8b-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gumush/turkish-finance-llama3.1-8b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gumush/turkish-finance-llama3.1-8b-lora
- SGLang
How to use gumush/turkish-finance-llama3.1-8b-lora 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 "gumush/turkish-finance-llama3.1-8b-lora" \ --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": "gumush/turkish-finance-llama3.1-8b-lora", "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 "gumush/turkish-finance-llama3.1-8b-lora" \ --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": "gumush/turkish-finance-llama3.1-8b-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use gumush/turkish-finance-llama3.1-8b-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gumush/turkish-finance-llama3.1-8b-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gumush/turkish-finance-llama3.1-8b-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for gumush/turkish-finance-llama3.1-8b-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="gumush/turkish-finance-llama3.1-8b-lora", max_seq_length=2048, ) - Docker Model Runner
How to use gumush/turkish-finance-llama3.1-8b-lora with Docker Model Runner:
docker model run hf.co/gumush/turkish-finance-llama3.1-8b-lora
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for gumush/turkish-finance-llama3.1-8b-lora to start chattingUsing HuggingFace Spaces for Unsloth
# No setup required# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for gumush/turkish-finance-llama3.1-8b-lora to start chattingLoad model with FastModel
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="gumush/turkish-finance-llama3.1-8b-lora",
max_seq_length=2048,
)Turkish Finance Llama 3.1 8B LoRA
Türkçe finansal piyasalar için özel olarak fine-tune edilmiş bir dil modeli. Kripto para, borsa, teknik analiz, temel analiz, risk yönetimi ve finansal regülasyonlar konusunda uzmanlaşmıştır.
Model Detayları
| Özellik | Değer |
|---|---|
| Base Model | meta-llama/Llama-3.1-8B-Instruct |
| Parametre | 8B (LoRA adapter: ~42M trainable) |
| Eğitim Yöntemi | QLoRA (4-bit) + SFT |
| Dil | Türkçe |
| Uzmanlık | Finans, Kripto, Borsa, Teknik/Temel Analiz |
| Lisans | MIT |
| Framework | Unsloth + TRL SFTTrainer |
| Formatlar | LoRA adapter + GGUF (q4_k_m) |
Eğitim Detayları
Dataset
Bu model, AlicanKiraz0/Turkish-Finance-SFT-Dataset kullanılarak eğitilmiştir. Dataset yaklaşık 10 milyon token boyutunda, kripto para, borsa, teknik analiz, temel analiz, risk yönetimi ve finansal regülasyonlar dahil geniş bir yelpazede Türkçe soru-cevap çifti içermektedir.
LoRA Konfigürasyonu
| Parametre | DeÄŸer |
|---|---|
| LoRA Rank (r) | 16 |
| LoRA Alpha | 16 |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Dropout | 0 |
| Gradient Checkpointing | unsloth |
Training Hyperparameters
| Parametre | DeÄŸer |
|---|---|
| Batch Size | 2 |
| Gradient Accumulation | 4 (effective: 8) |
| Epoch | 1 |
| Learning Rate | 2e-4 |
| Optimizer | adamw_8bit |
| Max Seq Length | 2048 |
| LR Scheduler | linear |
| Warmup Steps | 5 |
| Weight Decay | 0.01 |
| Precision | bf16 |
| Quantization | 4-bit (QLoRA) |
Kullanım
Gereksinimler
pip install unsloth transformers torch accelerate peft
Inference (Unsloth)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="gumush/turkish-finance-llama3.1-8b-lora",
max_seq_length=2048,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
SYSTEM_PROMPT = """Sen Türkiye finansal piyasaları konusunda uzmanlaşmış bir yapay zeka asistanısın.
Görevin kullanıcılara doğru, güncel ve anlaşılır finansal bilgi sağlamaktır.
SADECE doÄŸruluÄŸundan emin olduÄŸun bilgileri paylaÅŸ.
ASLA uydurma terim, kurum veya düzenleme oluşturma.
Her finansal bilgi içeren yanıtın sonunda şu uyarıyı ekle:
'Bu bilgiler genel niteliktedir, yatırım tavsiyesi değildir.
Kararlarınızdan önce lisanslı bir yatırım danışmanına başvurmanız önerilir.'"""
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": "Teknik analizde RSI indikatörü nedir ve nasıl yorumlanır?"}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
).to("cuda")
outputs = model.generate(
input_ids=inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Inference (Transformers + PEFT)
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model = "meta-llama/Llama-3.1-8B-Instruct"
lora_model = "gumush/turkish-finance-llama3.1-8b-lora"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(
base_model,
torch_dtype=torch.bfloat16,
device_map="auto",
load_in_4bit=True,
)
model = PeftModel.from_pretrained(model, lora_model)
messages = [
{"role": "system", "content": "Sen Türkiye finansal piyasaları konusunda uzmanlaşmış bir yapay zeka asistanısın."},
{"role": "user", "content": "BIST 100 endeksi nedir?"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
GGUF ile Kullanım (llama.cpp / Ollama)
Bu model GGUF formatında da sunulmaktadır. q4_k_m quantization ile boyut küçültülmüş, llama.cpp ve Ollama ile doğrudan kullanılabilir.
GGUF dosyası: gumush/turkish-finance-llama3.1-8b-lora-GGUF
# Ollama ile kullanım
ollama run hf.co/gumush/turkish-finance-llama3.1-8b-lora-GGUF
# llama-cpp-python ile kullanım
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="gumush/turkish-finance-llama3.1-8b-lora-GGUF",
filename="*q4_k_m.gguf",
n_ctx=2048,
)
output = llm.create_chat_completion(
messages=[
{"role": "system", "content": "Sen Türkiye finansal piyasaları konusunda uzmanlaşmış bir yapay zeka asistanısın."},
{"role": "user", "content": "Borsa'da stop-loss nedir?"}
],
temperature=0.7,
)
print(output["choices"][0]["message"]["content"])
Örnek Sorular
Kripto Para
- "Bitcoin halving döngüsü nedir ve fiyata nasıl etki eder?"
- "DeFi protokollerinde TVL metriği neden önemlidir?"
- "Ethereum'daki EIP-1559 güncellemesi tokenomics'i nasıl etkiledi?"
Borsa
- "BIST 100 endeksinde ağırlık hesaplaması nasıl yapılır?"
- "Hisse senedi seçerken temel analiz için hangi oranlara bakılmalı?"
- "Temettü yatırımı stratejisi nasıl uygulanır?"
Teknik Analiz
- "RSI göstergesi 70 üzerindeyken ne anlama gelir?"
- "MACD indikatörü nasıl yorumlanır?"
- "Fibonacci geri çekilme seviyeleri nasıl kullanılır?"
Risk Yönetimi
- "Portföy çeşitlendirmesi nasıl yapılır?"
- "Stop-loss emirleri nasıl kullanılmalı?"
- "Pozisyon büyüklüğü nasıl hesaplanır?"
Uzmanlık Alanları
- Kripto Para Ekosistemi: Bitcoin, Ethereum, altcoinler, DeFi, Layer 2, NFT, stablecoinler
- Borsa: BIST 100, NASDAQ, global piyasalar, ETF'ler, opsiyon stratejileri
- Teknik Analiz: Grafik formasyonları, RSI, MACD, Bollinger Bands, Ichimoku, Elliott Wave, Fibonacci
- Temel Analiz: F/K, PD/DD, finansal tablo analizi, DCF deÄŸerleme, tokenomics
- Risk Yönetimi: Portföy optimizasyonu, pozisyon boyutlandırma, hedging
- Regülasyon: SPK, TCMB, BDDK, TMSF düzenlemeleri, vergilendirme
Sınırlamalar
- Yatırım Tavsiyesi Değildir: Yalnızca eğitim ve bilgilendirme amacıdır
- Veri Kesimi: Tarihsel veri üzerinde eğitilmiştir, canlı fiyat bilgisi içermez
- Yüksek Risk: Kripto ve hisse senedi yatırımları önemli risk taşır
- Düzenleme Değişiklikleri: Finansal düzenlemeler sık değişir, resmi kaynaklardan teyit edin
- Doğrulama Gerekli: Yanıtları birden fazla kaynakla çapraz kontrol edin
Teşekkürler
Bu model aşağıdaki çalışmalar ve kaynaklara dayanmaktadır:
- Alican Kiraz - Turkish-Finance-SFT-Dataset veri setini oluşturup açık kaynak olarak paylaştığı için teşekkür ederiz. Bu model tamamen bu dataset üzerinde eğitilmiştir. Ayrıca Mihenk-LLM çalışmaları Türkçe finans LLM ekosistemi için önemli bir referans olmuştur.
- Meta AI - Llama 3.1 base modelini açık kaynak olarak sunduğu için teşekkür ederiz.
- Unsloth - Hızlı ve verimli fine-tuning altyapısı için.
- Hugging Face - TRL, Transformers ve PEFT kütüphaneleri için.
Referanslar
@dataset{turkish-finance-sft,
author = {Alican Kiraz},
title = {Turkish-Finance-SFT-Dataset},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/datasets/AlicanKiraz0/Turkish-Finance-SFT-Dataset}
}
@model{mihenk-llm,
author = {Alican Kiraz},
title = {Mihenk-LLM: A Fine-tuned Model for Turkish Financial Analysis},
year = {2026},
publisher = {HuggingFace},
url = {https://huggingface.co/AlicanKiraz0/Mihenk-LLM-14B-Turkish-Financial-Model-mlx-8Bit}
}
@model{llama3.1,
author = {Meta AI},
title = {Llama 3.1},
year = {2024},
publisher = {Meta},
url = {https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct}
}
İletişim
- HuggingFace: gumush
Lisans
MIT - Bu model MIT lisansı altında dağıtılmaktadır. Base model (Llama 3.1) Meta'nın Llama lisansı koşullarına tabidir. Dataset (Turkish-Finance-SFT-Dataset) MIT lisansı altındadır.
Model tree for gumush/turkish-finance-llama3.1-8b-lora
Base model
meta-llama/Llama-3.1-8B
Install Unsloth Studio (macOS, Linux, WSL)
# Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gumush/turkish-finance-llama3.1-8b-lora to start chatting