Text Generation
Transformers
Safetensors
English
qwen3
unsloth
sft
reasoning
conversational
text-generation-inference
Instructions to use khazarai/Personal-Finance-R2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khazarai/Personal-Finance-R2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khazarai/Personal-Finance-R2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("khazarai/Personal-Finance-R2") model = AutoModelForCausalLM.from_pretrained("khazarai/Personal-Finance-R2", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use khazarai/Personal-Finance-R2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khazarai/Personal-Finance-R2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khazarai/Personal-Finance-R2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/khazarai/Personal-Finance-R2
- SGLang
How to use khazarai/Personal-Finance-R2 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 "khazarai/Personal-Finance-R2" \ --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": "khazarai/Personal-Finance-R2", "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 "khazarai/Personal-Finance-R2" \ --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": "khazarai/Personal-Finance-R2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use khazarai/Personal-Finance-R2 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 khazarai/Personal-Finance-R2 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 khazarai/Personal-Finance-R2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for khazarai/Personal-Finance-R2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="khazarai/Personal-Finance-R2", max_seq_length=2048, ) - Docker Model Runner
How to use khazarai/Personal-Finance-R2 with Docker Model Runner:
docker model run hf.co/khazarai/Personal-Finance-R2
File size: 3,499 Bytes
90f6c9a bf25dc4 aaa036d bf25dc4 90f6c9a bf25dc4 90f6c9a bf25dc4 90f6c9a bf25dc4 90f6c9a bf25dc4 90f6c9a bf25dc4 90f6c9a 6e35b72 90f6c9a bf25dc4 90f6c9a bf25dc4 90f6c9a bf25dc4 90f6c9a bf25dc4 90f6c9a bf25dc4 aaa036d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | ---
library_name: transformers
tags:
- unsloth
- sft
- reasoning
license: apache-2.0
datasets:
- Akhil-Theerthala/Kuvera-PersonalFinance-V2.1
language:
- en
base_model:
- unsloth/Qwen3-1.7B
pipeline_tag: text-generation
---
# Model Card for Model ID
This model is fine-tuned for instruction-following in the domain of personal finance, with a focus on:
- Budgeting advice
- Investment strategies
- Credit management
- Retirement planning
- Insurance and financial planning concepts
- Personalized financial reasoning
### Model Description
- **License:** MIT
- **Finetuned from model:** unsloth/Qwen3-1.7B
- **Dataset:** The model was fine-tuned on the Kuvera-PersonalFinance-V2.1, curated and published by Akhil-Theerthala.
### Model Capabilities
- Understands and provides contextual financial advice based on user queries.
- Responds in a chat-like conversational format.
- Trained to follow multi-turn instructions and deliver clear, structured, and accurate financial reasoning.
- Generalizes well to novel personal finance questions and explanations.
## Uses
### Direct Use
- Chatbots for personal finance
- Educational assistants for financial literacy
- Decision support for simple financial planning
- Interactive personal finance Q&A systems
## Bias, Risks, and Limitations
- Not a substitute for licensed financial advisors.
- The model's advice is based on training data and may not reflect region-specific laws, regulations, or financial products.
- May occasionally hallucinate or give generic responses in ambiguous scenarios.
- Assumes user input is well-formed and relevant to personal finance.
## How to Get Started with the Model
Use the code below to get started with the model.
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khazarai/Personal-Finance-R2")
model = AutoModelForCausalLM.from_pretrained(
"khazarai/Personal-Finance-R2",
device_map={"": 0}
)
question = """ I just got accepted into Flatiron's full-time software engineering bootcamp, but I have basically no savings and the $19k price tag is freaking me out.
I really love coding and want to break into tech, but I'm looking at taking out a loan through Climb or Ascent with around 6.5% interest—that'd mean paying like $600 a month after.
Is this a smart move? I'm torn between chasing this opportunity and being terrified of the debt. Any advice?
"""
messages = [
{"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt = True,
enable_thinking = True,
)
from transformers import TextStreamer
_ = model.generate(
**tokenizer(text, return_tensors = "pt").to("cuda"),
max_new_tokens = 3000,
temperature = 0.6,
top_p = 0.95,
top_k = 20,
streamer = TextStreamer(tokenizer, skip_prompt = True),
)
```
## Training Details
### Training Data
- Dataset Overview:
Kuvera-PersonalFinance-V2.1 is a collection of high-quality instruction-response pairs focused on personal finance topics.
It covers a wide range of subjects including budgeting, saving, investing, credit management, retirement planning, insurance, and financial literacy.
- Data Format:
The dataset consists of conversational-style prompts paired with detailed and well-structured responses.
It is formatted to enable instruction-following language models to understand and generate coherent financial advice and reasoning. |