Text Generation
Transformers
Safetensors
Turkish
qwen3
tool-calling
finance
turkish
conversational
text-generation-inference
Instructions to use Dbmaxwell/Fintool-TR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dbmaxwell/Fintool-TR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Dbmaxwell/Fintool-TR") 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("Dbmaxwell/Fintool-TR") model = AutoModelForCausalLM.from_pretrained("Dbmaxwell/Fintool-TR", 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 Dbmaxwell/Fintool-TR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dbmaxwell/Fintool-TR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dbmaxwell/Fintool-TR", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Dbmaxwell/Fintool-TR
- SGLang
How to use Dbmaxwell/Fintool-TR 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 "Dbmaxwell/Fintool-TR" \ --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": "Dbmaxwell/Fintool-TR", "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 "Dbmaxwell/Fintool-TR" \ --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": "Dbmaxwell/Fintool-TR", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Dbmaxwell/Fintool-TR with Docker Model Runner:
docker model run hf.co/Dbmaxwell/Fintool-TR
|
Download README.md from Dbmaxwell/Fintool-TR: direct link, hf CLI and curl.
- Browser
- Download file 4.45 kB
-
https://huggingface.co/Dbmaxwell/Fintool-TR/resolve/main/README.md
- Command line
-
hf download hf://Dbmaxwell/Fintool-TR/README.md
-
curl -L -o README.md https://huggingface.co/Dbmaxwell/Fintool-TR/resolve/main/README.md
4.45 kB
| library_name: transformers | |
| license: apache-2.0 | |
| base_model: unsloth/Qwen3-4B-Instruct-2507 | |
| datasets: | |
| - Dbmaxwell/FintoolDataset-tr | |
| language: | |
| - tr | |
| pipeline_tag: text-generation | |
| tags: | |
| - qwen3 | |
| - tool-calling | |
| - finance | |
| - turkish | |
| # Fintool-TR | |
| `Qwen3-4B-Instruct-2507` tabanlı Türkçe finans ve tool-calling modeli. Tam BF16 checkpoint'tir; LoRA adapter değildir. | |
| Model, finans sorularının yanında araç seçimi ve yapılandırılmış çağrı üretimi için eğitildi. Güncel fiyat, kur veya makroekonomik veri modelin kendi bilgisinden alınmamalı; uygun veri aracından çekilmelidir. | |
| ## Benchmark | |
| Değerlendirme setinde eğitim verisiyle birebir eşleşen prompt yoktur. Toplam 78 vaka kullanıldı: 36 MCP/güvenlik, 30 finans bilgisi ve 12 finans hesabı. | |
| | Model | Composite | MCP kararı | Araç seçimi | Şema | Argümanlar | MCP başarı | Finans bilgisi | Finans hesabı | | |
| |---|---:|---:|---:|---:|---:|---:|---:|---:| | |
| | Base Qwen3-4B | 85.91 | 86.11% | 80.00% | 83.33% | 77.39% | 80.56% | 90.00% | 91.67% | | |
| | **Fintool-TR** | **92.68** | **97.22%** | **90.00%** | **96.67%** | **87.39%** | **88.89%** | 90.00% | **100.00%** | | |
| Fintool-TR'in belirgin farkı yeni araç şemalarında görüldü: fonksiyonel başarı Base için %66.67, Fintool-TR için %100 (12/12). Hesaplama denetiminde model hem semantik doğrulukta hem zorunlu `SONUC:` formatında 12/12 yaptı. | |
| Composite hesabı: MCP kararı %10, araç seçimi %15, şema %5, argüman kapsama %10, MCP fonksiyonel başarı %10, finans bilgisi %30, finans hesabı %20. | |
| ## Model bilgisi | |
| | Alan | Değer | | |
| |---|---:| | |
| | Mimari | `Qwen3ForCausalLM` | | |
| | Parametre | 4,022,468,096 | | |
| | Ağırlık tipi | BF16 | | |
| | Katman | 36 | | |
| | Hidden size | 2,560 | | |
| | Intermediate size | 9,728 | | |
| | Attention / KV head | 32 / 8 | | |
| | Vocabulary | 151,936 | | |
| | Config context sınırı | 262,144 token | | |
| | Eğitim sequence sınırı | 8,192 token | | |
| Ağırlıklar yaklaşık 8.04 GB olduğu için iki `safetensors` shard'ına bölünmüştür. İki dosya tek checkpoint'i oluşturur; `model.safetensors.index.json` bunları otomatik eşler. | |
| ## Eğitim | |
| - Base: [`unsloth/Qwen3-4B-Instruct-2507`](https://huggingface.co/unsloth/Qwen3-4B-Instruct-2507) | |
| - Dataset: [`Dbmaxwell/FintoolDataset-tr`](https://huggingface.co/datasets/Dbmaxwell/FintoolDataset-tr) | |
| - Split: 1,389 train / 160 validation / 185 test | |
| - 3 epoch | |
| - Train loss: 0.4496 | |
| - Validation loss: 0.4043 | |
| - Runtime: Unsloth, Transformers 4.57.6, TRL 0.22.2 | |
| - Donanım: A100 80 GB | |
| ## Yükleme | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "Dbmaxwell/Fintool-TR" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_id, | |
| torch_dtype=torch.bfloat16, | |
| device_map="auto", | |
| ) | |
| ``` | |
| ## Tool calling | |
| ```python | |
| tools = [{ | |
| "type": "function", | |
| "function": { | |
| "name": "get_quote", | |
| "description": "Güncel piyasa fiyatını getirir.", | |
| "parameters": { | |
| "type": "object", | |
| "properties": { | |
| "symbol": {"type": "string"}, | |
| "market": {"type": "string", "enum": ["bist", "us", "fx", "crypto"]}, | |
| }, | |
| "required": ["symbol", "market"], | |
| "additionalProperties": False, | |
| }, | |
| }, | |
| }] | |
| messages = [ | |
| {"role": "system", "content": "Güncel finans verisi için uygun aracı kullan."}, | |
| {"role": "user", "content": "GARAN hissesinin güncel BIST fiyatını getir."}, | |
| ] | |
| inputs = tokenizer.apply_chat_template( | |
| messages, | |
| tools=tools, | |
| add_generation_prompt=True, | |
| return_tensors="pt", | |
| ).to(model.device) | |
| with torch.inference_mode(): | |
| output = model.generate(inputs, max_new_tokens=192, do_sample=False) | |
| print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=False)) | |
| ``` | |
| Beklenen biçim: | |
| ```xml | |
| <tool_call> | |
| {"name": "get_quote", "arguments": {"symbol": "GARAN", "market": "bist"}} | |
| </tool_call> | |
| ``` | |
| Tool çağrılarında `do_sample=False` kullanmak şema sapmasını azaltır. | |
| ## Sınırlar | |
| - Yatırım tavsiyesi üretmek için tasarlanmadı. | |
| - Canlı piyasa verisi için harici veri kaynağı gerekir. | |
| - Emir ve transfer gibi işlemler açık kullanıcı onayı olmadan çalıştırılmamalıdır. | |
| - Üretimde araç argümanları ayrıca doğrulanmalı; yetki ve işlem limitleri model dışında uygulanmalıdır. | |
| Apache-2.0 lisansı için repodaki `LICENSE` dosyasına bakın. | |