Infinity is a lightweight, sleek, and feature-rich AI Chat Assistant designed for power users who want a simple, unified interface to chat with either local models or commercial LLMs.
Built on a modern stack utilizing React + Vite for the frontend and FastAPI with Andrew Ng's aisuite for the backend, Infinity gives you full control over your models and credentials.
- Collapsible LLM Control Center: Collapses into a single toggle button at the bottom of the sidebar to maximize visible chat history. Expand it instantly to switch between Local (Ollama), Gemini, OpenAI, and Anthropic.
- Local Ollama: Dynamically pulls your locally installed models in a dropdown list, with a fallback option to input custom model tags or use typed names. Displays status checks to verify if Ollama is online.
- Commercial Providers: Integrated dropdown model choosers for the latest models (GPT-5, Gemini 2.5/3.5, Claude 4, etc.) and in-app API key configuration.
- PDF & TXT File Ingestion: Attach PDF, TXT, or MD documents (up to 20MB and 500 pages) to chat messages. Extracted text context is automatically structured and injected into the LLM prompt.
- Ollama Warning: Displays context window warnings when Ollama is active to remind users of local resource constraints.
- Scanned PDF Detection: Automatically checks for and blocks scanned/empty PDFs to guide users to upload searchable files.
- Tavily RAG Web Search: Real-time internet access with a manual toggle or auto-detection keywords (e.g. asking for "latest news", "today", "current weather"). Formats source citations and search snippets directly below response bubbles.
- Passcode Protection: Keep your conversations secure when hosting online. The app features a passcode gate modal that locks the application interface and credentials until a matching server-configured passcode is supplied.
- Polished UX & Safe Markdown: Responsive sidebar design for chat history, fluid transitions, and a secure custom markdown parser rendering code blocks, lists, and inline styles safely (100% XSS protected).
- Local SQLite Chat History: End and title your chat sessions to save them to a local SQLite database, allowing you to reload or delete conversations instantly.
- Node.js (v18+)
- Python (3.10+)
- Ollama (optional, for local LLM execution)
git clone https://github.com/bodhidude/InfinityChatAssistant.git
cd InfinityChatAssistantInitialize a Python virtual environment and install the required modules:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtCreate a .env file inside the backend/ directory to configure your keys:
# Optional Tavily API Key for Web Search capabilities
TAVILY_API_KEY=your-tavily-api-key
# Optional Passcode to lock the application online
APP_PASSWORD=your-secure-passcode
# Optional Restricted CORS Origins (comma-separated)
ALLOWED_ORIGINS=http://localhost:5173Navigate back to the root directory and install dependencies:
cd ..
npm installTo start both the FastAPI backend server (port 8080) and the Vite React frontend client (port 5173) concurrently:
npm run startOpen http://localhost:5173 in your browser.
- API Keys: Keys entered in the sidebar are transmitted securely in HTTP headers (
X-OpenAI-Key, etc.). If the "Save key" checkbox is checked, they are persisted locally in the browser'slocalStoragein plaintext. Serves best under HTTPS. - Passcode Protection: When
APP_PASSWORDis defined in the backend.env, all secure endpoints are guarded with a 401 gate. It is highly recommended to set this passcode if you deploy your instance on a public cloud server.