Skip to content
ModelListedExternal
Download

Finagent Tr Qwen3 8b Unsloth LoRA

Qwen3-8B base model üzerinde FinAgent-TR dataset ile fine-tune edilmiş Türkçe LoRA adapter'ıdır. Finansal okuryazarlık soruları, tool selection, tool call generation ve tool output'a dayalı response generation için...

KindOtherBase modelunsloth/qwen3-8b-unsloth-bnb-4bitVersionRevision d02c2f5Bgrade

Model source

Kind
Other
File size
14.7 MB
Base model
unsloth/qwen3-8b-unsloth-bnb-4bit
Version
vRevision d02c2f5
Updated
Sep 27, 2026
Downloads
15
Source
Hugging Face

Source description

FinAgent-TR Qwen3-8B LoRA

Qwen3-8B base model üzerinde FinAgent-TR dataset ile fine-tune edilmiş Türkçe LoRA adapter'ıdır. Finansal okuryazarlık soruları, tool selection, tool call generation ve tool output'a dayalı response generation için eğitildi.

Installation

pip install -U unsloth peft transformers accelerate bitsandbytes

Inference

import torch
from unsloth import FastLanguageModel

MODEL_ID = "Dbmaxwell/finagent-tr-qwen3-8b-unsloth-lora"

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name=MODEL_ID,
    max_seq_length=1024,
    load_in_4bit=True,
)

FastLanguageModel.for_inference(model)

messages = [
    {
        "role": "system",
        "content": "Türkçe finansal okuryazarlık asistanısın. Net ve dayanaklı yanıt ver.",
    },
    {
        "role": "user",
        "content": "50.000 TL yıllık yüzde 10 bileşik faizle iki yıl sonunda kaç TL olur?",
    },
]

input_ids = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    enable_thinking=False,
    return_tensors="pt",
).to(model.device)

with torch.inference_mode():
    output_ids = model.generate(
        input_ids,
        max_new_tokens=256,
        do_sample=True,
        temperature=0.7,
        top_p=0.8,
        top_k=20,
        pad_token_id=tokenizer.eos_token_id,
    )

answer = tokenizer.decode(
    output_ids[0, input_ids.shape[-1]:],
    skip_special_tokens=True,
)

print(answer)

Tool Calling

Tool'lar model tarafından çalıştırılmaz. Model tool call üretir; tool execution ve tool output'un conversation'a tool message olarak eklenmesi agent runtime'ın sorumluluğundadır.

Tool schema'ları Qwen3 chat template'ine tools parametresiyle verilir:

tools = [
    {
        "type": "function",
        "function": {
            "name": "tefas_price",
            "description": "TEFAS fon fiyatını getirir.",
            "parameters": {
                "type": "object",
                "properties": {
                    "as_of": {
                        "type": "string",
                        "description": "ISO tarih",
                    },
                    "range": {
                        "type": "string",
                        "enum": ["narrow", "wide"],
                    },
                },
                "additionalProperties": False,
            },
        },
    }
]

messages = [
    {
        "role": "system",
        "content": "Güncel finans verisi gereken sorularda uygun aracı kullan.",
    },
    {
        "role": "user",
        "content": "Fonun 2025-01-15 tarihindeki fiyatını kontrol eder misin?",
    },
]

input_ids = tokenizer.apply_chat_template(
    messages,
    tools=tools,
    tokenize=True,
    add_generation_prompt=True,
    enable_thinking=False,
    return_tensors="pt",
).to(model.device)

Bu input'tan sonra standard model.generate() flow kullanılabilir. Üretilen tool name ve arguments, execution öncesinde application layer'da validate edilmelidir.

Training

  • Base model: Qwen3-8B, Unsloth 4-bit sürümü
  • Dataset: Dbmaxwell/finagent-tr
  • Dataset size: 1.000 validated episode
  • Split: 800 train, 100 validation, 100 test
  • Method: 4-bit QLoRA
  • LoRA rank: 8
  • LoRA alpha: 16
  • LoRA dropout: 0.1
  • Target modules: q_proj, k_proj, v_proj, o_proj
  • Max sequence length: 1.024 token
  • Epochs: 1
  • Learning rate: 3e-5
  • Loss masking: yalnızca assistant tool calls ve responses

Evaluation

Evaluation, 100 test episode ve 5.836 supervised assistant token üzerinde yapıldı. Base model ve fine-tuned model aynı tokenizer, 4-bit quantization, loss masking ve test split ile ölçüldü. Base-model baseline için yalnızca LoRA adapter geçici olarak disable edildi.

ModelTest lossPerplexity
Qwen3-8B base3.165523.70
FinAgent-TR fine-tuned LoRA1.57004.81

Fine-tuned model, base model'e göre:

  • Test loss: yüzde 50,4 reduction
  • Perplexity: yüzde 79,7 reduction

Bu sonuç teacher-forced next-token prediction ve in-distribution generalization ölçümüdür. Tek başına end-to-end agent accuracy anlamına gelmez.

Planned Behavior Evaluation

  • Tool-name exact match
  • Tool-argument JSON validity
  • Tool-argument accuracy
  • Tool gerekmeyen sorularda unnecessary tool-call rate
  • Tool output'a grounded final-answer accuracy
  • Clarification behavior
  • Out-of-distribution, human-written finans soruları

Limitations

  • Training dataset ağırlıklı olarak synthetic ve validated agent episode'larından oluşur.
  • Model internete veya gerçek finans tool'larına kendiliğinden bağlanmaz.
  • Tool execution için external agent runtime gerekir.
  • Güncel fiyat, mevzuat ve piyasa sorularında external data source kullanılmadan üretilen responses güncelliğini yitirmiş olabilir.
  • Generated outputs yatırım tavsiyesi değildir.
  • Generation-based behavior benchmark tamamlanmadan production-quality iddiası olarak yorumlanmamalıdır.

Dataset

Training dataset: Dbmaxwell/finagent-tr

License

Bu adapter Apache 2.0 license altında paylaşıldı. Base model license için Qwen3-8B model card sayfasını inceleyin.

Sources

1 source
Hugging FacePrimaryVersion d02c2f51ac3b0681a580e77971fafc4bfcf846a5
huggingface.co/Dbmaxwell/finagent-tr-qwen3-8b-unsloth-lora/tree/d02c2f51ac3b0681a580e77971fafc4bfcf846a5

Verified Aug 30

Model artifacts

1 artifact

adapter_model.safetensors

safetensors · 14.7 MB · SHA-256 deec4b842814…6cfa · Hugging Face

Download file

Source excerpts

2 excerpts

--- base_model: unsloth/qwen3-8b-unsloth-bnb-4bit library_name: peft pipeline_tag: text-generation license: apache-2.0 language: - tr datasets: - Dbmaxwell/finagent-tr tags: - qwen3 - unsloth - lora - qlora - turkish - finance - tool-calling --- # FinAgent-TR Qwen3-8B LoRA Qwen3-8B base model üzerinde FinAgent-TR dataset ile fine-tune edilmiş Türkçe LoRA adapter'ıdır. Finansal okuryazarlık soruları, tool selection, tool call generation ve tool output'a dayalı response generation için eğitildi. ## Installation ```bash pip install -U unsloth peft transformers accelerate bitsandbytes ``` ## Inference ```python import torch from unsloth import FastLanguageModel MODEL_ID = "Dbmaxwell/finagent-tr-qwen3-8b-unsloth-lora" model, tokenizer = FastLanguageModel.from_pretrained( model_name=MODEL_ID, max_seq_length=1024, load_in_4bit=True, ) FastLanguageModel.for_inference(model) messages = [ { "role": "system", "content": "Türkçe finansal okuryazarlık asistanısın. Net ve dayanaklı yanıt ver.", }, { "role": "user", "content": "50.000 TL yıllık yüzde 10 bileşik faizle iki yıl sonunda kaç TL olur?", }, ] input_ids = tokenizer.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, enable_thinking=False, return_tensors="pt", ).to(model.device) with torch.inference_mode(): output_ids = model.generate( input_ids, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.8, top_k=20, pad_token_id=tokenizer.eos_token_id, ) answer = tokenizer.decode( output_ids[0, input_ids.shape[-1]:], skip_special_tokens=True, ) print(answer) ``` ## Tool Calling Tool'lar model tarafından çalıştırılmaz. Model tool call üretir; tool execution ve tool output'un conversation'a `tool` message olarak eklenmesi agent runtime'ın sorumluluğundadır. Tool schema'ları Qwen3 chat template'ine `tools` parametresiyle verilir: ```python tools = [ { "type": "function", "function": { "name": "tefas_price", "description": "TEFAS fon fiyatını getirir.", "parameters": { "type": "object", "properties": { "as_of": { "type": "string", "description": "ISO tarih", }, "range": { "type": "string", "enum": ["narrow", "wide"], }, }, "additionalProperties": False, }, }, } ] messages = [ { "role": "system", "content": "Güncel finans verisi gereken sorularda uygun aracı kullan.", }, { "role": "user", "content": "Fonun 2025-01-15 t...

Source context: 15 downloads · 0 likes · Pipeline text-generation · Library peft · Repo Dbmaxwell/finagent-tr-qwen3-8b-unsloth-lora