explaingit

shaneliu04/finance-deepseek

15PythonAudience · researcherComplexity · 4/5LicenseSetup · hard

TLDR

A finance question-answering system that runs a compact AI model on a single consumer GPU, showing its step-by-step reasoning alongside answers and supporting OpenAI-compatible API calls.

Mindmap

mindmap
  root((finance-deepseek))
    What it does
      Finance Q&A with reasoning
      Streams thinking steps
      OpenAI API compatible
    How it works
      DeepSeek distilled model
      QLoRA fine-tuning
      RAG with FAISS index
    Answer modes
      Model only
      With retrieved docs
      With structured reasoning
    Tech stack
      Python
      PyTorch
      HuggingFace
      FAISS
      Docker Compose
    Hardware
      RTX 4060 8GB GPU
      Consumer-grade setup
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Ask finance questions and get answers that include the AI's step-by-step reasoning so you can verify the logic, not just the conclusion.

USE CASE 2

Build a finance chatbot that plugs into existing OpenAI-compatible front-ends with minimal changes.

USE CASE 3

Fine-tune a compact AI model on your own finance documents and deploy it locally without cloud API costs.

USE CASE 4

Create a document search index from financial reports and query them with an AI that retrieves relevant passages before answering.

Tech stack

PythonPyTorchHuggingFaceFAISSDocker

Getting it running

Difficulty · hard Time to first run · 1h+

Requires an NVIDIA RTX 4060 or equivalent GPU with 8GB VRAM, needs Python deps installed and a data prep script run before first use.

MIT license, use freely for any purpose, including commercial, as long as you keep the copyright notice.

In plain English

Finance-DeepSeek is a question-answering system built for finance topics. It runs on a single consumer GPU (an RTX 4060 with 8GB of memory) and gives answers that include the reasoning steps the model took to reach them, not just a final answer. The README is written in Chinese. The system is built on top of DeepSeek-R1-Distill-Qwen-1.5B, which is a compact AI model derived from a much larger 671-billion-parameter model through a process called knowledge distillation. The idea is that the smaller model inherits some of the larger model's reasoning behavior without requiring the same hardware. The base model is downloaded automatically from HuggingFace on first run. Two techniques work together to improve answer quality. The first is QLoRA, a method for fine-tuning the model on finance-specific data without needing a lot of GPU memory. The second is RAG (retrieval-augmented generation), where relevant documents are searched and fed into the prompt before the model generates an answer. The document index is built using FAISS and a financial text embedding model. Users can choose between three modes: answering from the model alone, answering with retrieved context, or answering with retrieved context plus structured reasoning output. The model's responses often contain a thinking section (wrapped in think tags) before the final answer. The system parses this automatically and can stream both parts back to the caller in order, so a front-end can display the reasoning as it arrives. The API follows the OpenAI chat completions format, so tools built for OpenAI's API can talk to it with minimal changes. Setup involves cloning the repository, installing Python dependencies, and running a data preparation script that generates training data and builds the vector index. Optional fine-tuning can be run locally. A Docker Compose configuration is also included for containerized deployment. The project is MIT licensed.

Copy-paste prompts

Prompt 1
I have cloned finance-deepseek. Walk me through running the data preparation script to build the FAISS vector index and then querying it in RAG mode.
Prompt 2
How does the QLoRA fine-tuning in finance-deepseek work and what data format does it expect for training on my own finance documents?
Prompt 3
I want to use finance-deepseek with my existing OpenAI-compatible chatbot front-end. What endpoint and request format should I use?
Prompt 4
Explain how finance-deepseek streams the thinking section separately from the final answer and how a front-end should handle those two parts.
Open on GitHub → Explain another repo

← shaneliu04 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.