CoolFace
Modelpublic

OsamaAli313/CFO-Agent-14B

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
0likes10downloads
Model Card

CFO-Agent-14B

A fine-tuned language model trained to function as an AI Chief Financial Officer. It provides expert-level financial analysis, forecasting, risk assessment, scenario planning, and executive-level financial communication.

Proof-of-Concept: This version uses Qwen2.5-0.5B-Instruct as the base model for budget-efficient validation. A production version on Qwen2.5-14B-Instruct is planned.

Capabilities

CapabilityDescription
Financial Statement AnalysisAnalyze balance sheets, income statements, and cash flow statements
Revenue & Expense ForecastingProject future financials with quantified assumptions
Risk AssessmentIdentify, quantify, and prioritize financial risks
Scenario PlanningModel best/worst/base case scenarios with financial impact
Budget OptimizationAllocate resources and optimize departmental budgets
Executive CommunicationGenerate board-level reports, investor updates, and CFO memos
M&A AnalysisEvaluate acquisitions with DCF, multiples, and synergy analysis
Cash Flow ManagementMonitor burn rate, runway, and working capital

Quick Start

With PEFT (Recommended)

python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

base_model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen2.5-0.5B-Instruct",
    device_map="auto",
)
model = PeftModel.from_pretrained(base_model, "OsamaAli313/CFO-Agent-14B")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")

messages = [
    {"role": "system", "content": "You are CFO-Agent, an expert Chief Financial Officer AI assistant."},
    {"role": "user", "content": "Analyze this: Revenue $500K, COGS $200K, OpEx $150K. What are our margins?"}
]

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))

With 4-bit Quantization (Low VRAM)

python
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
import torch

bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16,
)

base_model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen2.5-0.5B-Instruct",
    quantization_config=bnb_config,
    device_map="auto",
)
model = PeftModel.from_pretrained(base_model, "OsamaAli313/CFO-Agent-14B")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")

Training Details

Dataset

Trained on OsamaAli313/CFO-Agent-14B-Dataset — a curated dataset of 47,481 training samples across three layers:

LayerSourceSamplesContent
Layer 1Public HF datasets~10KFinancial instruction-following (FiQA, Alpaca Finance, FinGPT)
Layer 2Structured financial data~5KBalance sheet analysis, income statement review, earnings calls, risk reports
Layer 3Synthetic CFO scenarios~50KScenario planning, risk assessment, M&A analysis, budget allocation, executive communication

All data formatted in ChatML with a CFO-Agent system prompt.

Training Configuration

ParameterValue
Base modelQwen/Qwen2.5-0.5B-Instruct
MethodQLoRA (SFT)
LoRA rank64
LoRA alpha128
Target modulesq, k, v, o, gate, up, down projections
Epochs3
Batch size1 (x16 gradient accumulation)
Learning rate2e-4 (cosine decay)
Max sequence length512
Optimizerpagedadamw8bit
Precisionbf16
HardwareNVIDIA T4 (HF Jobs)
Training time~3.5 hours

Training Results

MetricValue
Final training loss0.1036
Average training loss0.1706
Mean token accuracy95.75%
Total steps938

Training metrics are available on the Trackio dashboard.

Example Prompts

Analyze our income statement: Revenue $500K, COGS $200K, Operating Expenses $150K.
What's our gross margin and operating margin?
We have $100K cash with $20K monthly burn rate. When do we run out of cash?
What cost reduction targets should we set?
Compare two scenarios: Base case 20% revenue growth / 15% margin vs
Worst case 5% growth / 10% margin. What's the year-end profitability impact?
Our revenue grows 10% quarterly starting from $1M.
Project revenue for the next 4 quarters and calculate CAGR.

Limitations

  • Proof-of-concept model — built on 0.5B parameter base, limited reasoning depth compared to larger models
  • Not financial advice — outputs should be validated by qualified financial professionals
  • Training subset — trained on 5,000 of 47,481 available samples due to compute budget
  • Context window — trained with max 512 tokens, longer inputs may degrade quality
  • No real-time data — cannot access live market data or financial feeds

Roadmap

  • [ ] Train on full 47K dataset
  • [ ] Scale to Qwen2.5-14B-Instruct base model
  • [ ] Add tool-use capabilities (calculator, spreadsheet, API calls)
  • [ ] GGUF export for local deployment (Ollama, LM Studio)
  • [ ] Evaluation benchmark on financial reasoning tasks

Links

Citation

bibtex
@misc{cfo-agent-14b,
  title={CFO-Agent-14B: An AI Chief Financial Officer},
  author={Osama Ali},
  year={2026},
  url={https://huggingface.co/OsamaAli313/CFO-Agent-14B}
}