Finance
Bloomberg-grade financial data and AI-powered analysis through a conversational chat interface you can self-host.
Finance is an open-source AI financial research assistant that brings institutional-grade data to a natural language chat interface. Built by Valyu, it unifies access to real-time market data, SEC filings, academic research, economic indicators, patent databases, and prediction market data — all through a single conversational query, powered by Valyu’s specialized financial search API.
The application is designed with two distinct deployment paths sharing one codebase: a fully self-hosted mode using SQLite and local LLMs (Ollama or LM Studio) that requires no external authentication or cloud services, and a production Valyu mode with Supabase, OAuth, and credit-based billing. Toggling between them is a single environment variable, making Finance equally usable as a private research workstation or a scalable cloud platform.
Beyond retrieval, Finance integrates secure Python code execution via Daytona sandboxes, allowing users to run Monte Carlo simulations, backtests, and machine learning models directly from the chat interface. Results are returned with interactive Recharts visualizations, inline citations with LaTeX math support, and exportable CSV tables — all rendered in the same conversational flow.
The project targets financial analysts, quantitative researchers, and investors who need to consolidate expensive, fragmented research tools into a single open-source alternative that can run entirely on their own infrastructure.
What You Get
- Unified Financial Search - Access real-time stock prices, SEC filings (10-K, 10-Q, 8-K), economic data from BLS/FRED/World Bank, patent databases, and Polymarket prediction odds through a single natural language query interface powered by Valyu’s specialized API.
- Secure Python Code Execution - Run Monte Carlo simulations, backtests, portfolio optimization algorithms, and machine learning models in isolated Daytona sandboxes with automatic result capture and artifact rendering.
- Interactive Chart Generation - Create publication-ready line, bar, area, scatter, and quadrant charts from natural language prompts using Recharts, with multi-chart Embla Carousel display and PNG export.
- Self-Hosted Mode - Run the entire application locally with SQLite storage, mock authentication, and Ollama or LM Studio for private, unlimited, offline AI inference — no Supabase or external auth required.
- Inline Citation Rendering - Responses include embedded citations from source documents with LaTeX math support and linked financial charts in a seamless narrative format.
- CSV Export and Tables - Generate downloadable CSV files with financial data tables — income statements, balance sheet comparisons, time series exports — directly from conversational queries.
- Multi-LLM Provider Support - Switch between OpenAI, Ollama, and LM Studio models from the UI with automatic provider detection and thinking/reasoning mode for compatible models like DeepSeek-R1.
- PDF Report Generation - Export complete analysis sessions as formatted PDF reports with embedded charts, citations, and markdown content using Puppeteer with Chromium.
Common Use Cases
- Quantitative backtesting - A hedge fund analyst asks Finance to write and execute a Python Monte Carlo simulation on Tesla’s stock using real historical volatility data fetched from the financial search API, then visualize the distribution of outcomes as an interactive scatter chart.
- SEC filing due diligence - An M&A analyst queries the SEC search tool to extract revenue trends, debt covenants, and management risk factors from a target company’s 10-K filings, rendered with inline citations linking directly to source documents.
- Private research on sensitive data - A quant researcher deploys Finance in self-hosted mode with a local Ollama model to run proprietary financial models without exposing strategies or data to cloud APIs or third-party services.
- Market sentiment cross-referencing - A portfolio manager queries news sentiment, Polymarket prediction odds, and analyst reports simultaneously to gauge market reaction to an earnings announcement before trading hours open.
- Academic finance research - A graduate student searches Wiley finance journals and arXiv papers for peer-reviewed research on options pricing models, then runs the referenced formulas as Python code to validate results.
- Economic indicator dashboards - A macro analyst generates time series charts of CPI, unemployment, and GDP growth by querying BLS, FRED, and World Bank data sources in a single natural language session, then exports the data as CSV.
Under The Hood
Architecture
Finance adopts Next.js 15 App Router as its structural backbone, establishing a clear boundary between server-rendered data fetching and client-side interaction. The most architecturally significant decision is a dual-backend abstraction: a unified database interface module switches between Supabase and SQLite at runtime based on a single environment variable, so identical route handlers and tool logic operate in both self-hosted and production cloud modes without branching. AI tool definitions are centralized in a single module using the Vercel AI SDK’s tool pattern, with each financial data source exposed as a semantically distinct tool — the route handler selects between direct API key calls and OAuth proxy forwarding based on deployment mode. Client state uses Zustand for authentication state, React Query for server data caching, and a dedicated Ollama context provider for local LLM provider switching and model enumeration. The architecture is cohesive and pragmatic rather than strictly layered, with some business logic in route handlers alongside library modules.
Tech Stack
The application is built on Next.js 15 with React 19 and TypeScript throughout, using the App Router with server components and API routes. Data persistence uses Drizzle ORM with better-sqlite3 for local SQLite storage and Supabase for cloud PostgreSQL, accessed through a shared schema and unified query interface. LLM inference flows through the Vercel AI SDK with OpenAI as the default provider, and Ollama or LM Studio through OpenAI-compatible endpoints for local inference, with Valyu’s custom AI SDK providing specialized financial data tools. Secure Python sandboxing uses the Daytona SDK. Recharts handles chart rendering with Embla Carousel for multi-chart display, Puppeteer with a bundled Chromium handles PDF generation, and PostHog plus Vercel Analytics cover behavioral tracking. Tailwind CSS v4 provides styling with Radix UI primitives and class-variance-authority for accessible, composable UI components.
Code Quality
The codebase has no automated tests — no testing framework is installed, no spec files exist, and no CI pipeline is configured. This is a notable gap for a financial data application where accuracy of data handling and transformation matters. Error handling in tool implementations is explicit and defensive: tool execute functions catch errors and return structured error strings rather than throwing, preventing LLM streaming failures from breaking the session. TypeScript strict mode is enforced throughout, and Drizzle ORM provides schema-level type safety for database operations. Zod validates all AI tool input schemas before execution. ESLint is configured via eslint-config-next with Next.js-specific rules. Naming is consistent and the codebase reads cleanly, but the lack of testing infrastructure represents technical debt that would need to be addressed before high-stakes production deployments.
What Makes It Unique
The defining innovation is the single-codebase dual-deployment architecture: flipping one environment variable transforms Finance from a fully private self-hosted research tool with local SQLite and Ollama inference into a production SaaS platform with Supabase, Valyu OAuth, and credit billing — without any code changes. This means quantitative researchers can run sensitive analyses locally with complete data privacy, then hand the same codebase to an ops team for cloud deployment. The financial search integration is also deliberately granular: rather than a generic search tool, the Valyu API is exposed as six semantically distinct tools (financeSearch, secSearch, economicsSearch, patentSearch, polymarketSearch, financeJournalSearch), allowing the LLM to select the most appropriate data source for each query and combine results across sources in a single conversational turn. Inline citation rendering that merges streaming financial data, LaTeX math, and interactive charts into a single markdown response stream is a distinctive design pattern not commonly found in open-source financial AI tools.
Self-Hosting
Finance is released under the MIT License, which is a permissive open-source license. It grants unrestricted rights to use, copy, modify, merge, publish, distribute, sublicense, and sell copies of the software, including for commercial purposes. There are no copyleft implications: organizations using Finance internally or embedding it in a commercial product are not required to open-source their modifications or pay royalties. The only obligation is to retain the copyright notice in distributions.
Running Finance yourself requires Node.js 18 or later, a Valyu API key for the financial data search layer, and a Daytona API key for sandboxed Python code execution. In self-hosted mode, SQLite handles persistence locally and Ollama or LM Studio provides free local LLM inference — eliminating Supabase and OpenAI API costs entirely. Infrastructure requirements are modest for single-user research workstations, but production deployments serving multiple users will need to account for Daytona sandbox concurrency limits and Valyu API credit consumption at scale. There is no bundled authentication system in self-hosted mode; users are auto-logged in as a development user, so network-level access controls are the operator’s responsibility.
The production Valyu mode adds Supabase for multi-user data storage, Valyu OAuth for authentication and credit billing, and OpenAI or Vercel AI Gateway for cloud LLM inference. This path provides managed user accounts and usage tracking but requires Valyu OAuth credentials that are not yet publicly available — interested parties must contact Valyu directly. Self-hosters also forgo any SLA guarantees, support contracts, or managed upgrades: version tracking, database migrations, and dependency updates are entirely the operator’s responsibility. The codebase has no automated tests, which increases the operational risk of applying updates without thorough manual validation.
Related Apps
AutoGPT
Automation · Productivity · AI Assistants
Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.
AutoGPT
OtherOpen WebUI
AI Assistants · AI Agents
The extensible, privacy-first AI platform that runs Ollama, OpenAI, and any LLM backend behind a polished, feature-packed web interface.
Open WebUI
OtherLobeHub
AI Assistants · Productivity · Automation
Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.