Instructions to use Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf", filename="Josephgflowers--Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-f16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M
Use Docker
docker model run hf.co/Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf with Ollama:
ollama run hf.co/Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M
- Unsloth Studio
How to use Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf 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 Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf 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 Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf to start chatting
- Docker Model Runner
How to use Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf with Docker Model Runner:
docker model run hf.co/Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M
- Lemonade
How to use Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf:Q4_K_M
Run and chat with the model
lemonade run user.Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf-Q4_K_M
List all available models
lemonade list
Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning
Overview
Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning is a compact, fine-tuned model built on top of microsoft/Phi-4-mini-instruct with a strong emphasis on structured financial reasoning and instruction-following. This release blends financial QA, reasoning chains, and RAG-ready formatting into a lightweight agent optimized for advanced finance applications.
This model is particularly good at producing structured outputs like JSON, following instruction patterns, and chaining logical steps when prompted with tags like <thinking> or <think>.
This model also outperforms the base models on multi language capabilities.
🔄 Latest Training Run: Finance Curriculum Reasoning Expansion
After v0.4, the model was further fine-tuned on newly released multilingual finance reasoning datasets, explicitly targeting real-world coverage gaps in non-English finance QA:
- Finance Curriculum Edu English
- Finance-Curriculum-Edu-Arabic
- Finance-Curriculum-Edu-Uzbek
- Finance-Curriculum-Edu-Multilingual
This training phase addressed:
- Conceptual reasoning and QA coherence across 60+ languages
- Robustness to diverse phrasing, financial domains, and real-world curriculum topics
- Further reduction of hallucinations and improved answer structure, especially for small and mid-sized LMs in non-English settings
Model Workflow & Training Strategy
1. Initial Fine-Tune
- Base:
Phi-4-mini-instruct - Dataset: Finance-Instruct-500k
- Additional datasets: LIMO, Fin01
2. Back Merge
- Model was merged back with
Phi-4-mini-instructto retain broad instruction capability.
3. Reasoning Augmentation
- Generated question-answer sets from
Finance-Instruct-500kusing reasoning system prompts - Filtered for format quality and signal-to-noise ratio
- Trained again on: generated reasoning dataset, LIMO, Fin01
4. Final Merge
- Merged with
Phi-4-mini-reasoningto strengthen chain-of-thought behavior
5. Reason Pass
- Trained on:
- Filtered reasoning subset of self-generated 500k QA set
- Cortex-1 Market Analysis
- LIMO
- Fin01
6. Finance Curriculum Reasoning Expansion (NEW)
- Trained with four new datasets targeting real-world and multilingual finance curriculum QA:
- Generated question-answer sets from
Finance-Instruct-500kusing reasoning system prompts - Filtered for format quality and signal-to-noise ratio
- Self generated reasoning dataset using finance topics. Human preference optimized.
- Trained again on: generated reasoning dataset, LIMO, Fin01
Key Capabilities
- Financial Reasoning: Great at multi-step reasoning across investment strategies, reports, and economic topics
- Instruction Following: Precise response formatting with few-shot or system messages
- Multi-Turn Dialogues: Maintains context across long conversations
- Structured Output: NER, parsing, and tagging tasks return valid JSON by default
- RAG-Compatible: Handles prepended external context in the user field
- Tag-Aware: Supports
<thinking>tags to guide reasoning chains - Multilingual Finance QA: Expanded coverage in 60+ languages for curriculum-based financial topics
Usage Tips
- Use system messages like:
You are a financial assistant that explains your reasoning step by step. Use <thinking>...</thinking> to wrap your reasoning.
Expect JSON-style outputs for tasks like:
Entity extraction
Address parsing
XBRL tagging
Example
{
"system": "You are a financial reasoning assistant. Use <thinking> to show your steps.",
"user": "<context>ABC Inc reported a quarterly revenue increase of 12% while cutting debt by 8%</context>\nWhat does this indicate about the company’s short-term stability?",
"assistant": "<thinking>This revenue increase suggests improved sales or pricing power. Debt reduction enhances cash flow and reduces risk. Together, they signal improved short-term financial health.</thinking> It indicates strong short-term stability."
}
Model Details
- Base: Phi-4-mini-instruct
- Architecture: ~3.8B params (mini)
- Version: v0.4 + Multilingual Curriculum Reasoning Expansion
- License: MIT
- Framework: Hugging Face Transformers
Citation
@model{josephgflowers2025phinancephi4,
title={Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning},
author={Joseph G. Flowers},
year={2025},
url={https://huggingface.co/Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning}
}
- Downloads last month
- 51
4-bit
8-bit
16-bit
Model tree for Josephgflowers/Phinance-Phi-4-mini-instruct-finance-v0.4-with-reasoning-gguf
Base model
microsoft/Phi-4-mini-instruct